/* ==========================================================================
   PrepTrack Design System (style.css)
   Premium Indigo/Violet + Teal Accent, Dark & Light Mode, Mobile-First
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-main: #090b14;
  --bg-subtle: #101424;
  --bg-card: #151a2e;
  --bg-card-hover: #1b223b;
  --bg-glass: rgba(21, 26, 46, 0.78);
  --text-main: #f3f5ff;
  --text-muted: #9aa3c2;
  --border-color: rgba(255, 255, 255, 0.09);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.28);
  --accent: #14b8a6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.35);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.18);
  --accent: #0d9488;
  --shadow-card: 0 10px 25px rgba(15, 23, 42, 0.06);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  background-color: var(--bg-main);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.narrow-container {
  max-width: 780px;
}

/* Theme Icon Visibility */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-lg {
  padding: 0.9rem 1.65rem;
  font-size: 1.02rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
}

.full-width {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.25rem;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.header-nav {
  display: none;
  gap: 1.75rem;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.header-nav a:hover {
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

@media (min-width: 900px) {
  .header-nav { display: flex; }
}

/* Landing Hero */
.hero-section {
  padding: 4.5rem 0 4rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.pill-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--primary-glow);
  color: #a5b4fc;
  margin-bottom: 1.2rem;
}

[data-theme="light"] .pill-badge {
  color: var(--primary);
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

.text-gradient {
  background: linear-gradient(135deg, #818cf8, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Preview Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-card);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.badge-accent {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--success);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.preview-rings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.mini-ring-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.circular-chart {
  width: 54px;
  height: 54px;
}

.circle-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 3.6;
}

.circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3.6;
  stroke-linecap: round;
}

.accent-teal .circle {
  stroke: var(--accent);
}

.ring-meta strong {
  display: block;
  font-size: 1.2rem;
}

.ring-meta span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.bar-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin: 0.75rem 0 0.35rem;
}

.progress-track {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
}

/* Sections & Grids */
.section {
  padding: 4.5rem 0;
}

.bg-subtle {
  background: var(--bg-subtle);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-muted);
}

.grid-2, .grid-3, .grid-4, .pricing-grid {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .pricing-grid { grid-template-columns: repeat(5, 1fr); }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  box-shadow: var(--shadow-card);
}

.q-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  margin-bottom: 0.6rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
}

.step-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--primary-glow);
  color: #a5b4fc;
  margin-bottom: 0.8rem;
}

.weight-list {
  margin: 1.2rem 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.weight-list li {
  margin-bottom: 0.5rem;
}

.honesty-box {
  margin-top: 1.2rem;
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

/* Pricing */
.price-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  text-align: center;
}

.price-card.popular {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.popular-ribbon {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
}

.price-tag {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.8rem 0 0.25rem;
}

.price-tag span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.price-sub {
  margin-bottom: 1.4rem;
  font-size: 0.84rem;
}

.coupon-callout {
  margin-top: 2rem;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px dashed var(--accent);
  font-size: 0.95rem;
}

.quote-author {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-item p {
  margin-top: 0.75rem;
}

.cta-banner {
  text-align: center;
}

.cta-banner h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.cta-banner p {
  color: var(--text-muted);
  margin-bottom: 1.6rem;
}

.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

/* Modal & Auth Form */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-subtle);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.auth-tab {
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
}

.divider {
  text-align: center;
  margin: 1.1rem 0;
  position: relative;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.dev-auth-box {
  margin-top: 1.25rem;
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.35);
  font-size: 0.82rem;
}

.dev-auth-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.dev-auth-box p {
  margin-bottom: 0.65rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Logged-in App Shell & Onboarding (app.html)
   ========================================================================== */
.onboarding-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.onboarding-card {
  width: 100%;
  max-width: 520px;
}

.exam-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.exam-radio-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  cursor: pointer;
}

.exam-radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 265px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border-color);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

@media (min-width: 900px) {
  .app-sidebar {
    display: flex;
  }
}

.exam-pill {
  margin-top: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1.5rem 0 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.93rem;
}

.nav-item:hover,
.nav-item.active {
  background: var(--bg-card);
  color: var(--text-main);
}

.nav-item.active {
  border-left: 3px solid var(--primary);
}

.trial-status-card {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--primary-glow);
  border: 1px solid rgba(99, 102, 241, 0.35);
  margin-bottom: 1rem;
}

.trial-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.trial-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.user-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-info strong {
  display: block;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 76px;
}

@media (min-width: 900px) {
  .app-main {
    padding-bottom: 0;
  }
}

.app-topbar {
  height: 68px;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.target-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.route-container {
  padding: 1.5rem;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

/* Mobile Bottom Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  z-index: 60;
}

@media (min-width: 900px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.mob-nav-item small {
  font-size: 0.68rem;
  font-weight: 600;
}

.mob-nav-item.active {
  color: var(--primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 200;
}

.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  color: var(--text-main);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}