/* ===========================================================
   Gradewell — Brand Stylesheet
   Palette: navy-ink #0F1F3D · amber-gold #F5A623 · white
            ice-blue #F0F4FF · slate-muted #6B7A99
   Type: Syne (display) + Inter (body)
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0F1F3D;
  --navy-soft: #16294f;
  --amber: #F5A623;
  --amber-soft: #fff1d9;
  --white: #ffffff;
  --ice: #F0F4FF;
  --slate: #6B7A99;
  --border: #dfe5f2;
  --danger: #c4453b;
  --danger-soft: #fbe9e7;
  --success: #1f7a4d;
  --success-soft: #e7f5ec;

  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 14px rgba(15, 31, 61, 0.06);
  --shadow-pop: 0 12px 32px rgba(15, 31, 61, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.section--ice { background: var(--ice); }
.section--navy { background: var(--navy); color: var(--white); }
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
  display: block;
}
.section--navy .eyebrow { color: var(--amber); }

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; hyphens: none; -webkit-hyphens: none; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 700; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 14px; color: var(--slate); }
.section--navy p { color: #b9c4dd; }
.lede { font-size: 1.15rem; color: var(--slate); max-width: 600px; }
.section--navy .lede { color: #cfd8ec; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--amber); color: var(--navy); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(245,166,35,0.35); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1120px; margin: 0 auto; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--navy); letter-spacing: -0.02em; }
.logo span { color: var(--amber); }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-link { font-weight: 600; font-size: 0.92rem; color: var(--navy); padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav-link.active { border-bottom-color: var(--amber); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: none; padding: 6px; }
@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 64px 0 0 0; background: var(--white); flex-direction: column; padding: 28px 24px; gap: 22px; transform: translateY(-110%); transition: transform .25s ease; align-items: flex-start; }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: inline-flex; }
}

/* Hero */
.hero { padding: 80px 0 70px; }
.hero-logo-wrap { display: inline-block; margin-bottom: 1.5rem; }
.hero-logo { width: 260px; display: block; mix-blend-mode: screen; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-art {
  position: relative; background: var(--navy); border-radius: var(--radius-lg);
  aspect-ratio: 4/3.4; overflow: hidden; display: flex; flex-direction: column;
  justify-content: space-between; padding: 28px;
}
.hero-art-top { display: flex; flex-direction: column; gap: 6px; }
.hero-art .atar-counter {
  font-family: var(--font-display); font-weight: 700; color: var(--amber);
  font-size: 6rem; line-height: 1;
}
.hero-art .atar-label { color: #b9c4dd; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-art-quote { color: var(--white); font-size: 0.95rem; max-width: 280px; margin: 0; }
.hero-art-quote strong { color: var(--amber); }
.hero-quotes { position: relative; min-height: 110px; }
.hero-quotes .hero-art-quote { position: absolute; bottom: 0; left: 0; right: 0; opacity: 0; transition: opacity 0.7s ease; }
.hero-quotes .hero-art-quote.active { opacity: 1; position: relative; }

/* Price callout */
.section--price-callout { padding: 80px 0; }
.price-callout-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center;
}
@media (max-width: 860px) { .price-callout-inner { grid-template-columns: 1fr; gap: 40px; } }
.price-callout-heading { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 16px; line-height: 1.1; }
.price-highlight { color: var(--amber); }
.price-callout-numbers {
  background: var(--ice); border-radius: var(--radius-lg); padding: 36px;
  border: 1px solid var(--border);
}
.price-compare-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; }
.price-compare-row.featured-row { background: var(--navy); border-radius: var(--radius-md); padding: 16px 20px; margin: 0 -8px; }
.price-compare-label { font-size: 0.9rem; font-weight: 600; color: var(--slate); }
.featured-row .price-compare-label { color: #b9c4dd; }
.price-compare-amount { font-family: var(--font-display); font-weight: 800; font-size: 2rem; color: var(--slate); opacity: 0.45; }
.price-compare-amount small { font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; }
.price-compare-amount.ours { color: var(--amber); opacity: 1; font-size: 2.4rem; }
.price-compare-divider { text-align: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-faint, #AAB4CC); padding: 4px 0; }
.price-compare-note { font-size: 0.82rem; color: var(--slate); text-align: center; margin: 16px 0 0; font-style: italic; }

/* Cards / grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 760px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 26px; box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-weight: 700; }

/* Steps */
.steps { margin-top: 32px; display: grid; gap: 24px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--amber);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 1rem;
}
.step h3 { margin-bottom: 4px; }
.step p { margin-bottom: 0; }

/* Section heads */
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { margin-bottom: 12px; }

/* Tutor cards w/ ATAR watermark — signature element */
.tutor-card {
  position: relative; background: var(--ice); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 26px; overflow: hidden; isolation: isolate;
}
.tutor-watermark {
  position: absolute; right: -10px; top: -28px; font-family: var(--font-display);
  font-weight: 800; font-size: 7.2rem; color: var(--navy); opacity: 0.07; line-height: 1;
  z-index: 0; pointer-events: none;
}
.tutor-card .tutor-content { position: relative; z-index: 1; }
.tutor-atar-pill {
  display: inline-flex; align-items: baseline; gap: 4px; background: var(--navy); color: var(--amber);
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; padding: 6px 14px;
  border-radius: 999px; margin-bottom: 14px;
}
.tutor-atar-pill small { font-family: var(--font-body); font-weight: 600; font-size: 0.7rem; color: #b9c4dd; text-transform: uppercase; letter-spacing: 0.06em; }
.tutor-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.tutor-uni { font-size: 0.82rem; color: var(--slate); margin-bottom: 10px; }
.tutor-subjects { font-size: 0.85rem; color: var(--navy); font-weight: 500; }

/* Pricing */
.price-card { text-align: left; position: relative; }
.price-card.featured { box-shadow: var(--shadow-pop); }
.price-packs { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.price-pack-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.83rem; color: var(--slate); }
.price-pack-row strong { color: var(--navy); font-weight: 700; }
.price-pack-row em { font-style: normal; color: var(--amber-deep); font-size: 0.78rem; font-weight: 600; }
.price-card .badge {
  position: absolute; top: -12px; right: 20px; background: var(--amber); color: var(--navy);
  font-size: 0.7rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: 0.04em;
}
.price-amount { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; color: var(--navy); margin: 10px 0; }
.price-amount span { font-family: var(--font-body); font-weight: 500; font-size: 1rem; color: var(--slate); }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; padding: 20px 4px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--navy);
}
.faq-q .chev { transition: transform .2s ease; color: var(--amber); flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(45deg); }
.faq-a { padding: 0 4px 0; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; }
.faq-item.open .faq-a { max-height: 400px; padding: 0 4px 20px; }

/* Stat callout */
.stat-callout {
  background: var(--navy); border-radius: var(--radius-lg); padding: 40px; color: var(--white);
  display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; margin: 36px 0;
}
@media (max-width: 700px) { .stat-callout { grid-template-columns: 1fr; } }
.stat-callout .big { font-family: var(--font-display); font-weight: 800; font-size: 3rem; color: var(--amber); }

/* CTA band */
.cta-band {
  background: var(--ice); border-radius: var(--radius-lg); padding: 48px; text-align: center;
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { max-width: 460px; margin: 0 auto 24px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.95rem; color: var(--navy); background: var(--white);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
textarea { resize: vertical; min-height: 110px; }
.form-hint { font-size: 0.8rem; color: var(--slate); margin-top: 6px; }
.form-error { font-size: 0.85rem; color: var(--danger); margin-top: 6px; display: none; }
.form-card { max-width: 460px; margin: 0 auto; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-card); }
.form-card-wide { max-width: 640px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--slate); }
.auth-switch a { color: var(--navy); font-weight: 600; border-bottom: 1px solid var(--amber); }

/* Alerts / toasts */
.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 18px; display: none; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warn { background: var(--amber-soft); color: #8a5a00; }
.alert.show { display: block; }

/* Dashboard */
.dash-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.dash-greeting .eyebrow { margin-bottom: 6px; }
.booking-list { display: grid; gap: 16px; }
.booking-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: var(--white);
}
@media (max-width: 640px) { .booking-card { grid-template-columns: 1fr; } }
.booking-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.booking-date { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.status-pill { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; }
.status-pending { background: var(--amber-soft); color: #8a5a00; }
.status-confirmed { background: var(--success-soft); color: var(--success); }
.status-cancelled { background: #f1f2f5; color: var(--slate); }
.status-rescheduled { background: var(--amber-soft); color: #8a5a00; }
.status-completed { background: var(--ice); color: var(--navy); }
.booking-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--radius-md); color: var(--slate); }
.empty-state h3 { color: var(--navy); margin-bottom: 6px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,31,61,0.55); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 36px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-close { float: right; background: none; border: none; font-size: 1.4rem; color: var(--slate); line-height: 1; margin-top: -6px; }

/* Footer */
.footer { background: var(--navy); color: #b9c4dd; padding: 56px 0 28px; }
.footer .logo { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--amber); margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; font-size: 0.88rem; color: #b9c4dd; margin-bottom: 10px; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 22px; font-size: 0.8rem; color: #8290ab; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Page visibility (hash router) */
.page { display: none; }
.page.active { display: block; }

/* Auth-gated nav items */
[data-auth="in"], [data-auth="out"], [data-auth="client-in"], [data-auth="tutor-in"] { display: none; }
body.auth-in [data-auth="in"] { display: inline-flex; }
body.auth-out [data-auth="out"] { display: inline-flex; }
body.auth-client [data-auth="client-in"] { display: inline-flex; }
body.auth-tutor [data-auth="tutor-in"] { display: inline-flex; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(15,31,61,0.2); border-top-color: var(--navy); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkout-summary { background: var(--ice); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 1rem; }
.checkout-summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; }

.skeleton { background: linear-gradient(90deg, var(--ice) 25%, #e4eaf8 37%, var(--ice) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); height: 80px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ============================================================
   DARK MODE — respects system preference
   Navy/amber identity is preserved; backgrounds invert to dark
   ============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #0d1117;
    --ice: #161c27;
    --border: #2a3347;
    --slate: #8f9fc0;
    --navy: #e8edf8;
    --navy-soft: #c8d0e8;
    --amber-soft: #2a1f00;
    --danger-soft: #2a0f0d;
    --success-soft: #0a1f14;
    --shadow-card: 0 2px 14px rgba(0,0,0,0.4);
    --shadow-pop: 0 12px 32px rgba(0,0,0,0.5);
  }

  body { background: #0d1117; color: #e8edf8; }

  /* Nav */
  .nav { background: rgba(13,17,23,0.92); border-bottom-color: var(--border); }
  .nav-links { background: #0d1117; }
  .logo { color: #e8edf8; }
  .nav-link { color: #e8edf8; }

  /* Hero art card stays navy-on-dark — it's intentionally dark already */
  .hero-art { background: #1a2640; }

  /* Cards */
  .card { background: #161c27; border-color: var(--border); }
  .card h3 { color: #e8edf8; }

  /* Ice sections */
  .section--ice { background: #111720; }

  /* Price callout */
  .price-callout-numbers { background: #111720; border-color: var(--border); }
  .price-compare-row.featured-row { background: #1a2640; }

  /* Steps */
  .step-num { background: #1a2640; }

  /* Forms */
  input, select, textarea { background: #161c27; border-color: var(--border); color: #e8edf8; }
  input:focus, select:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,166,35,0.15); }
  .form-card { background: #161c27; border-color: var(--border); }

  /* Auth */
  .auth-switch { color: #8f9fc0; }
  .auth-switch a { color: #e8edf8; }

  /* Buttons */
  .btn-secondary { color: #e8edf8; border-color: #e8edf8; }
  .btn-secondary:hover { background: #e8edf8; color: #0d1117; }

  /* Booking cards */
  .booking-card { background: #161c27; border-color: var(--border); }
  .booking-date { color: #e8edf8; }
  .empty-state { border-color: var(--border); color: #8f9fc0; }
  .empty-state h3 { color: #e8edf8; }

  /* Modal */
  .modal { background: #161c27; }

  /* FAQ */
  .faq-q { color: #e8edf8; }
  .faq-item { border-color: var(--border); }

  /* Tutor cards */
  .tutor-card { background: #161c27; border-color: var(--border); }
  .tutor-watermark { color: #e8edf8; opacity: 0.04; }
  .tutor-name { color: #e8edf8; }
  .tutor-subjects { color: #c8d0e8; }

  /* Pricing cards */
  .price-card { background: #161c27; border-color: var(--border); }
  .price-amount { color: #e8edf8; }

  /* Stat callout stays navy intentionally */
  .stat-callout { background: #1a2640; }

  /* CTA band */
  .cta-band { background: #111720; }
  .cta-band h2 { color: #e8edf8; }

  /* Section headings */
  h1, h2, h3 { color: #e8edf8; }
  p { color: #8f9fc0; }
  .lede { color: #8f9fc0; }

  /* Footer stays dark — already dark, minor tweaks */
  .footer { background: #080c12; }
  .footer .logo { color: #ffffff; }
  .footer-col a, .footer-col p { color: #8290ab; }
  .footer-bottom { border-top-color: rgba(255,255,255,0.08); }

  /* Hero art card — force readable text regardless of dark mode var remapping */
  .hero-art-quote { color: #e8edf8 !important; }
  .hero-art .atar-label { color: #8f9fc0 !important; }

  /* Divider */
  .divider { border-top-color: var(--border); }

  /* Alerts */
  .alert-warn { background: #2a1f00; color: #f5c842; }
  .alert-error { background: #2a0f0d; color: #e07070; }
  .alert-success { background: #0a1f14; color: #5bbf8a; }

  /* Status pills */
  .status-pending { background: #2a1f00; color: #f5c842; }
  .status-confirmed { background: #0a1f14; color: #5bbf8a; }
  .status-cancelled { background: #1e2535; color: #8f9fc0; }
  .status-rescheduled { background: #2a1f00; color: #f5c842; }
  .status-completed { background: #161c27; color: #8f9fc0; }
}
