:root {
  /* ── Yulzari Brand Palette ── */
  --bg:        #f9fafb;          /* warm off-white page bg      */
  --surface:   #ffffff;          /* pure white cards            */
  --surface2:  #f1f5f2;          /* subtle green-tinted panel   */
  --border:    #e2e8e4;          /* warm grey-green border      */
  --accent:    #059669;          /* emerald green — Yulzari CTA */
  --accent-lt: #d1fae5;          /* emerald tint                */
  --accent2:   #0369a1;          /* deep blue secondary         */
  --accent2-lt:#e0f2fe;          /* blue tint                   */
  --navy:      #0f172a;          /* deep navy for headings      */
  --gold:      #d97706;          /* amber for flags / warnings  */
  --danger:    #dc2626;          /* red for errors              */
  --warn:      #ea580c;          /* orange                      */
  --success:   #059669;          /* same as accent              */
  --text:      #0f172a;          /* deep navy text              */
  --text2:     #334155;          /* slate grey                  */
  --text3:     #94a3b8;          /* light slate                 */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08);

  --font-d: 'Inter', system-ui, -apple-system, sans-serif;
  --font-b: 'Inter', system-ui, -apple-system, sans-serif;
  --font-m: 'Inter', monospace;
}

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

html{scroll-behavior:smooth}

body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.sec-open{overflow:hidden}

/* Global button styles */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-b);
  transition: all 0.2s;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(5,150,105,.30);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover { background: #047857; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(5,150,105,.40); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-b);
  transition: all 0.2s;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lt); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* Section Management */
.sec-outer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: none;
  flex-direction: column;
}

.sec-outer.active {
  display: flex;
}

.sec-nav {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  flex-shrink: 0;
}

.sec-nav-l { display: flex; align-items: center; gap: 20px; }

.sec-back {
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sec-back:hover { background: var(--bg); color: var(--accent); }

.sec-nav-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: var(--accent-lt);
  padding: 4px 10px;
  border-radius: 4px;
}

.sec-nav-r {
  font-size: 13px;
  color: var(--text3);
  font-weight: 600;
}

.sec-inner {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Modal Overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.mtitle {
  font-family: var(--font-d);
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.msub {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.macts {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── RESPONSIVE DESIGN ── */
@media (max-width: 768px) {
  .sec-nav {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .sec-nav-l {
    gap: 10px;
  }

  .sec-nav-r {
    display: none; /* Hide non-critical info on mobile nav */
  }

  .sec-back {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .modal {
    padding: 20px;
    border-radius: var(--radius);
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
  }

  .overlay {
    padding: 12px;
  }

  /* Path selector overlay — full width on mobile */
  #pathOv > div {
    padding: 24px 16px !important;
    max-width: 100% !important;
  }

  #pathOv h1 {
    font-size: 24px !important;
  }

  #pathOv .btn-primary,
  #pathOv .btn-secondary {
    padding: 20px 16px !important;
    font-size: 16px !important;
  }

  /* Paywall modal grid — stack on mobile */
  #paywallOv .modal > div:nth-child(2) {
    grid-template-columns: 1fr !important;
    padding: 20px !important;
  }

  #paywallOv .modal > div:first-child {
    padding: 24px 20px !important;
  }

  #paywallOv .modal > div:first-child h2 {
    font-size: 22px !important;
  }

  /* Writing & Speaking results modals — stack band + scores */
  #writingResModal .modal > div > div[style*="display:flex"],
  #speakResModal .modal > div > div[style*="display:flex"] {
    flex-direction: column !important;
  }

  /* Login modal */
  #loginModal > div {
    width: 95% !important;
    padding: 28px 20px !important;
  }

  /* Confirmation modal actions */
  .macts {
    flex-wrap: wrap;
  }

  .macts .btn-primary,
  .macts .btn-secondary {
    flex: 1;
    min-width: 120px;
    min-height: 44px;
    justify-content: center;
  }

  /* FAQ items — better tap targets */
  .faq-item {
    padding: 16px 18px;
  }

  .faq-q {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .btn-primary, .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 44px;
  }

  .mtitle {
    font-size: 20px;
  }

  .msub {
    font-size: 14px;
  }

  .sec-nav {
    padding: 6px 8px;
    gap: 6px;
  }

  .sec-nav-tag {
    font-size: 10px;
    padding: 3px 8px;
  }

  .sec-back {
    padding: 8px;
    font-size: 13px;
  }

  /* Path overlay — phone */
  #pathOv > div {
    padding: 20px 12px !important;
  }

  #pathOv h1 {
    font-size: 22px !important;
  }

  #pathOv p {
    font-size: 14px !important;
  }

  /* Paywall — phone */
  #paywallOv .modal {
    border-radius: 16px !important;
  }

  #paywallOv .modal > div:first-child h2 {
    font-size: 20px !important;
  }

  /* Login — phone */
  #loginModal > div {
    border-radius: 16px !important;
    padding: 24px 16px !important;
  }

  #loginModal h2 {
    font-size: 19px !important;
  }

  /* Results modal band numbers */
  #writingResModal .band-box,
  #speakResModal .band-box {
    padding: 16px !important;
  }

  #writingBand, #speakBand {
    font-size: 40px !important;
  }

  /* Global: prevent horizontal overflow */
  .overlay > .modal {
    word-break: break-word;
  }

  .faq-a {
    font-size: 13px;
  }
}

/* ── Shared: pulse highlight (used by listening + reading nav jump) ── */
@keyframes pulse-highlight {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); border-color: var(--accent); }
  70%  { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.pulse-highlight { animation: pulse-highlight 2s ease-out; }

/* ── Shared: FAQ accordion (used by hub + study center) ── */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s;
}
.faq-item:hover { border-color: var(--accent); }
.faq-q {
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-icon { font-size: 10px; transition: transform 0.2s; }
.faq-item.open .faq-icon { transform: rotate(180deg); }
.faq-a {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  display: none;
}
.faq-item.open .faq-a { display: block; }
