/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   PAGE — full viewport, no scroll, gradient background
============================================================ */
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* white → light blue → rose-red gradient */
  background:
    radial-gradient(ellipse at 0% 0%,   rgba(255,255,255,1.0) 0%,  transparent 40%),
    radial-gradient(ellipse at 100% 0%,  rgba(147,197,253,0.70) 0%, transparent 45%),
    radial-gradient(ellipse at 100% 100%,rgba(251,113,133,0.75) 0%, transparent 45%),
    radial-gradient(ellipse at 0% 100%,  rgba(199,210,254,0.65) 0%, transparent 40%),
    linear-gradient(135deg, #e0eaff 0%, #f8e8ee 50%, #fce4ec 100%);
  overflow: hidden;
}

/* ============================================================
   OVERLAY WRAPPER (kept for JS compatibility)
============================================================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.popup-overlay.show .popup-container {
  animation: popIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ============================================================
   CONTAINER
============================================================ */
.popup-container {
  position: relative;
  width: 1180px;
  max-width: 98vw;
 
  height: calc(100vh - 25px);
  max-height: calc(100vh - 25px);
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  box-shadow:
    0 8px 40px rgba(99, 102, 241, 0.14),
    0 2px 8px  rgba(244, 63, 94,  0.08),
    0 32px 80px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}

/* ============================================================
   CLOSE BUTTON
============================================================ */
.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.30);
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.25s;
  line-height: 1;
}
.close-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1) rotate(90deg);
}

/* ============================================================
   HEADER
============================================================ */
.popup-header {
  position: relative;
  overflow: hidden;
  padding: 22px 40px 20px;
  text-align: center;
  color: #fff;
  border-radius: 22px 22px 0 0;
  flex-shrink: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(56,189,248,0.28) 0%, transparent 40%),
    radial-gradient(ellipse at 85% 30%, rgba(244,63,94,0.28)  0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%,rgba(99,102,241,0.22) 0%, transparent 40%),
    linear-gradient(160deg, #0c1a3a 0%, #0f1d55 45%, #1a0a35 100%);
}

/* Starfield dots */
.popup-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.25) 1px, transparent 1px);
  background-size: 55px 55px, 28px 28px;
  background-position: 0 0, 14px 14px;
  opacity: 0.20;
  pointer-events: none;
}

.popup-header > * { position: relative; z-index: 2; }

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.brand-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.10em;
  color: #ffffff;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f43f5e;
  text-transform: uppercase;
}

.header-title {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #ffffff;
  line-height: 1.05;
  margin-bottom: 7px;
}

.header-sub {
  font-size: 13.5px;
  color: rgba(255,255,255,0.72);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================
   FORM BODY
============================================================ */
.form-body {
  padding: 18px 22px 18px;
  background: #f4f5fb;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

form#admissionForm {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ============================================================
   FORM COLUMNS — 60 / 40 split
============================================================ */
.form-columns {
  display: grid;
  grid-template-columns: 60fr 40fr;
  gap: 16px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ============================================================
   SECTIONS
============================================================ */
.section {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid #e8eaf0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon-pink { background: #fff1f2; }

.section-heading h2 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
}

/* ============================================================
   GRID & FIELDS
============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.req {
  color: #ef4444;
  margin-left: 2px;
}

/* ============================================================
   INPUT WRAPPER
============================================================ */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #9ca3af;
  pointer-events: none;
  flex-shrink: 0;
}

.input-wrap input { padding-left: 42px !important; }

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrap .input-icon {
  position: absolute;
  left: 14px;
  z-index: 1;
}

.select-wrap select { padding-left: 42px !important; }

/* ============================================================
   INPUTS & SELECT
============================================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #f0f2f8;
  color: #111827;
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

input::placeholder { color: #b0b8c8; }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
  outline: none;
  background: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #f0f2f8 inset;
  -webkit-text-fill-color: #111827;
}

/* Select chevron */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 17px;
  padding-right: 42px !important;
  cursor: pointer;
}

select.placeholder-active { color: #b0b8c8; }
select option { color: #111827; background: #ffffff; }
select option[value=""] { color: #b0b8c8; }

/* ============================================================
   PHONE INPUT
============================================================ */
.phone-input {
  display: flex;
  align-items: center;
  height: 52px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #f0f2f8;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  background: #ffffff;
}

.country-code {
  width: 64px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8ecf8;
  border-right: 1.5px solid #e5e7eb;
  font-weight: 700;
  font-size: 14px;
  color: #4338ca;
  flex-shrink: 0;
}

.phone-input input {
  flex: 1;
  height: 100%;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 0 14px !important;
  font-size: 14.5px;
  color: #111827 !important;
  box-shadow: none !important;
}

/* ============================================================
   PROGRAM LIST — right column
============================================================ */
.program-sub {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 12px;
  margin-top: -6px;
  flex-shrink: 0;
}

.program-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.program-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid #e8eaf0;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  flex: 1;
}

.program-row:hover {
  border-color: #c7d2fe;
  background: #f5f3ff;
}

.program-row input[type="radio"] { display: none; }

.program-row:has(input:checked) {
  border-color: #f43f5e;
  background: #fff5f7;
  box-shadow: 0 0 0 1px rgba(244,63,94,0.15);
}

.program-row:has(input:checked) .radio-circle {
  border-color: #f43f5e;
  background: #f43f5e;
}

.program-row:has(input:checked) .radio-circle::after { opacity: 1; }

.prog-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prog-blue   { background: #eff6ff; color: #3b82f6; }
.prog-purple { background: #f5f3ff; color: #8b5cf6; }
.prog-orange { background: #fff7ed; color: #f97316; }
.prog-indigo { background: #eef2ff; color: #6366f1; }

.prog-icon-wrap svg { stroke: currentColor; }

.prog-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.prog-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.prog-sub {
  font-size: 11.5px;
  color: #6b7280;
  font-weight: 500;
}

.radio-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #ffffff;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.radio-circle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  transition: opacity 0.2s;
  position: absolute;
}

/* ============================================================
   TERMS + SUBMIT — below the columns
============================================================ */
.terms {
  margin: 14px 0 10px;
  padding: 0 2px;
  flex-shrink: 0;
}

.terms label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  line-height: 1.5;
}

.terms input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.terms input[type="checkbox"]:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.terms input[type="checkbox"]:checked {
  background: #6366f1;
  border-color: #6366f1;
}

.terms input[type="checkbox"]:checked::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.terms a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
}

.terms a:hover { text-decoration: underline; }

/* ============================================================
   SUBMIT BUTTON
============================================================ */
.submit-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #3730a3 0%, #7c3aed 40%, #db2777 75%, #f43f5e 100%);
  background-size: 200% 100%;
  background-position: 0% 0;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
  transition: transform 0.2s, box-shadow 0.2s, background-position 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.submit-btn:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 8px 30px rgba(99,102,241,0.45);
}

.submit-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 10px rgba(99,102,241,0.28);
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   SUCCESS MODAL
============================================================ */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-overlay.hidden { display: none; }

.success-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 44px 34px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  animation: popIn 0.4s cubic-bezier(0.22,1,0.36,1) both;
}

.success-card svg { margin: 0 auto 18px; display: block; }

.checkmark-circle { fill: none; stroke: #22c55e; stroke-width: 3; }
.checkmark-check  { fill: none; stroke: #22c55e; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

.success-card h2 { font-size: 22px; font-weight: 800; color: #111827; margin-bottom: 8px; }
.success-card p  { font-size: 13.5px; color: #6b7280; line-height: 1.65; margin-bottom: 24px; }

.success-card button {
  background: #6366f1;
  color: #fff;
  border: none;
  padding: 11px 34px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, transform 0.2s;
}

.success-card button:hover { background: #4f46e5; transform: translateY(-1px); }

/* ============================================================
   RESPONSIVE — Tablet ≤ 900px
============================================================ */
@media (max-width: 900px) {
  .form-columns { grid-template-columns: 1fr; overflow-y: auto; }
  .popup-container { height: auto; max-height: 96vh; overflow-y: auto; }
  .header-title { font-size: 34px; }
  .popup-header { padding: 20px 24px 18px; }
  .form-body { padding: 16px 16px 16px; overflow-y: visible; }
}

/* ============================================================
   RESPONSIVE — Mobile ≤ 600px
============================================================ */
@media (max-width: 600px) {
  body { overflow-y: auto; align-items: flex-start; }

  .popup-overlay {
    padding: 0;
    align-items: flex-start;
    position: relative;
    min-height: 100vh;
    overflow-y: auto;
  }

  .popup-container {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: none;
    overflow-y: visible;
    border-radius: 0;
  }

  .form-body {
    overflow-y: visible;
    overflow: visible;
  }

  form#admissionForm { overflow: visible; }

  .form-columns {
    grid-template-columns: 1fr;
    overflow: visible;
    height: auto;
  }

  .section { overflow: visible; }

  .header-title { font-size: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .close-btn { top: 10px; right: 10px; }
}

/* ============================================================
   REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
