/* ==========================================================================
   AbroEd India - PathFinder (Phase 0)
   Self contained. Does not touch any existing site stylesheet.
   ========================================================================== */

:root {
  --brand: #2E5BBA;
  --brand-dark: #24488f;
  --brand-tint: #eef3fc;
  --nav-blue: #2563eb;

  --ink: #0f172a;
  --body: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  --page: #faf8f5;
  --card: #ffffff;
  --line: rgba(0, 0, 0, 0.08);

  --ok: #16a34a;
  --warn: #ca8a04;
  --bad: #dc2626;

  --radius: 1.25rem;
  --radius-lg: 2rem;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02);
  --shadow-lift: 0 20px 25px -5px rgba(0,0,0,0.06), 0 10px 10px -5px rgba(0,0,0,0.02);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 0.5rem 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Site nav, mirrored from the rest of the site
   -------------------------------------------------------------------------- */

.site-nav {
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.site-nav-brand {
  display: flex; align-items: center; gap: 0.625rem;
  text-decoration: none; color: inherit; flex-shrink: 0; padding: 6px 0;
}
.site-nav-brand svg { flex-shrink: 0; }
.site-nav-wordmark {
  font-weight: 800; font-size: 1.125rem;
  color: var(--nav-blue); letter-spacing: -0.01em;
}
.site-nav-links { display: flex; align-items: center; gap: 1.75rem; }
.site-nav-link {
  font-weight: 600; font-size: 0.9375rem; color: var(--ink);
  text-decoration: none; white-space: nowrap; padding: 0.75rem 0.5rem;
  transition: color 0.2s ease;
}
.site-nav-link:hover { color: var(--nav-blue); }
.site-nav-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; background: #25D366; color: #fff !important;
  border-radius: 9999px; text-decoration: none;
  font-weight: 600; font-size: 0.875rem; white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}
.site-nav-cta:hover { background: #1FAE54; transform: translateY(-1px); }

@media (max-width: 767px) {
  .site-nav-links { display: none; }
  .site-nav-inner { padding: 0.875rem 1rem; }
  .site-nav-wordmark { font-size: 1rem; }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

@media (max-width: 640px) {
  .wrap { padding: 1.75rem 1rem 4rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { margin-bottom: 2rem; }

.hero-eyebrow {
  display: inline-block;
  background: var(--brand-tint);
  color: var(--brand);
  border: 1px solid rgba(46,91,186,0.18);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.hero-sub {
  font-size: 1.0625rem;
  color: var(--muted);
  margin: 0 0 1rem;
  max-width: 34rem;
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--faint);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Progress
   -------------------------------------------------------------------------- */

.progress {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: var(--page);
  padding: 0.75rem 0 1rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.07);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.progress-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Question cards
   -------------------------------------------------------------------------- */

.q {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .q { padding: 1.25rem; border-radius: var(--radius); }
}

/* q-num and q-title are spans inside <legend> on radio questions and
   block elements elsewhere. Force block so both render identically. */
.q-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.q-title {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin: 0 0 0.25rem;
}

.q-help {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.q-title + .options,
.q-title + .field-row,
.q-title + .field { margin-top: 1rem; }

/* Legend needs resetting because fieldset styling varies by browser */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
/* A <legend> is painted in the fieldset's border, not in normal flow, so a
   multi-line legend spills above the card. Floating it puts it back into the
   padding box. The next sibling clears the float. */
legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0;
}

legend + * { clear: both; }

/* Questions with no help line would otherwise sit 0.25rem under the title,
   while questions with a help line get 1.25rem. Match them. Padding, not
   margin: the clearance above absorbs margin-top but leaves padding alone. */
legend + .options { padding-top: 0.75rem; }

/* --------------------------------------------------------------------------
   Option buttons (radio and checkbox)
   -------------------------------------------------------------------------- */

.options { display: grid; gap: 0.625rem; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 480px) {
  .options.cols-2 { grid-template-columns: 1fr; }
}

.opt { position: relative; display: block; }

.opt input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}

.opt-face {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.8125rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 0.875rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.opt-face:hover { border-color: rgba(46,91,186,0.45); background: #fcfdff; }

.opt-mark {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 2px;
  border: 1.5px solid #c7ccd6;
  border-radius: 50%;
  background: #fff;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.opt input[type="checkbox"] ~ .opt-face .opt-mark { border-radius: 6px; }

.opt-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: #fff;
  transform: scale(0);
  transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1);
}

.opt-text { font-size: 0.9375rem; font-weight: 500; color: var(--ink); }
.opt-note { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }

.opt input:checked ~ .opt-face {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.opt input:checked ~ .opt-face .opt-mark {
  border-color: var(--brand);
  background: var(--brand);
}
.opt input:checked ~ .opt-face .opt-mark::after { transform: scale(1); }

.opt input:focus-visible ~ .opt-face {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Text and number inputs
   -------------------------------------------------------------------------- */

.field { display: block; }
.field + .field { margin-top: 1rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--body);
  margin-bottom: 0.375rem;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 1rem; /* 16px stops iOS zooming on focus */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 0.75rem;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input:hover { border-color: rgba(46,91,186,0.45); }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(46,91,186,0.15); }
.input::placeholder { color: var(--faint); }

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}

.field-hint { font-size: 0.8125rem; color: var(--muted); margin: 0.375rem 0 0; }

/* --------------------------------------------------------------------------
   Glossary terms

   A term inside a sentence that a student can tap to have explained. The panel
   is a sibling block rather than a floating tooltip: it cannot be clipped by an
   overflow on an ancestor, needs no position maths, and behaves the same on a
   phone as on a desktop. Opening it pushes the rest of the form down, which is
   the honest thing to do on a page the user is reading top to bottom.
   -------------------------------------------------------------------------- */

.term {
  font: inherit;
  color: var(--brand);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}
.term:hover { color: var(--brand-dark); }

.term-pop {
  margin: 0.625rem 0 0;
  padding: 0.75rem 0.875rem;
  background: var(--brand-tint);
  border: 1px solid rgba(46, 91, 186, 0.18);
  border-radius: 10px;
}

.term-pop-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.term-pop p {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0.375rem 0 0;
}

/* --------------------------------------------------------------------------
   Errors
   -------------------------------------------------------------------------- */

.q.has-error {
  border-color: rgba(220,38,38,0.35);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.06);
}

.q-error {
  display: none;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bad);
  margin-top: 0.75rem;
}
.q-error.show { display: flex; }

.input.is-invalid { border-color: var(--bad); }

.form-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.form-error.show { display: block; }

/* --------------------------------------------------------------------------
   Consent and submit
   -------------------------------------------------------------------------- */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0;
}

.consent input {
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.consent-text { font-size: 0.875rem; color: var(--body); line-height: 1.55; }
.consent-text a { color: var(--brand); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 54px;
  padding: 0.9375rem 1.5rem;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover:not(:disabled) {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(46,91,186,0.28);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-secondary:hover:not(:disabled) { background: var(--brand-tint); color: var(--brand-dark); }

.btn-whatsapp { background: #25D366; }
.btn-whatsapp:hover:not(:disabled) { background: #1FAE54; box-shadow: 0 8px 20px rgba(37,211,102,0.3); }

.submit-note {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin: 0.875rem 0 0;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hidden until relevant */
[hidden] { display: none !important; }

/* Honeypot. Kept out of the tab order and off screen for real users. */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: #f1ede7;
  border-top: 1px solid #e2ddd5;
  padding: 2.5rem 1.25rem;
  text-align: center;
}
.site-footer-brand { font-size: 1.125rem; font-weight: 900; color: var(--nav-blue); margin: 0 0 0.5rem; }
.site-footer p { font-size: 0.875rem; color: var(--muted); margin: 0 0 0.5rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--nav-blue); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; font-size: 0.875rem; margin-top: 0.75rem; }
