/* ═══════════════════════════════════════════════════════
   PRAYAS EXAM — Design System (Modern Minimal)
   ═══════════════════════════════════════════════════════ */

:root {
  --pri: #2d5a3f;
  --pri-dark: #1f4230;
  --pri-light: #e8f0eb;
  --acc: #f4c430;
  --acc-dark: #d4a420;
  --ink: #1a1a1a;
  --text: #2a2a2a;
  --mute: #6b6b6b;
  --subtle: #9a9a9a;
  --paper: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f5f5f0;
  --bd: #e5e5e0;
  --bd-strong: #d4d4cc;
  --ok: #2d5a3f;
  --warn: #d97706;
  --err: #b91c1c;
  --info: #0e7490;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, sans-serif;
  --font-guj: 'Noto Sans Gujarati', 'Manrope', sans-serif;
  --text-xs: .7rem; --text-sm: .82rem; --text-base: .95rem;
  --text-lg: 1.1rem; --text-xl: 1.4rem; --text-2xl: 1.8rem;
  --text-3xl: 2.4rem; --text-4xl: 3rem;
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(26,26,26,.04);
  --shadow: 0 4px 12px rgba(26,26,26,.06);
  --shadow-lg: 0 12px 32px rgba(26,26,26,.08);
  --container: 1200px;
  --tr: all .15s ease;
}

.dark {
  --pri: #4a8865; --pri-dark: #3a6e50; --pri-light: #1a2d22;
  --ink: #f5f5f0; --text: #e5e5e0; --mute: #a8a8a3; --subtle: #7a7a75;
  --paper: #121410; --surface: #1a1d18; --surface-2: #22261f;
  --bd: #2a2e26; --bd-strong: #3a3e36;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga", "calt";
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: var(--tr); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); font-weight: 700; }
h4 { font-size: var(--text-lg); font-weight: 700; }
p { color: var(--text); line-height: 1.7; }
.lead { font-size: var(--text-lg); color: var(--mute); line-height: 1.55; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pri);
}

em { font-style: italic; }
h1 em, h2 em, h3 em { color: var(--pri); font-weight: 700; }
:lang(gu), .gu { font-family: var(--font-guj); }

/* Header */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bd);
  position: sticky;
  top: 0;
  z-index: 50;
}
.dark .site-header { background: rgba(26,29,24,.92); }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--pri);
  letter-spacing: -0.02em;
}
.logo em { color: var(--acc-dark); font-style: normal; font-weight: 700; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--r-full);
  transition: var(--tr);
}
.nav-links a:hover { background: var(--surface-2); color: var(--pri); }
.nav-links a.active { color: var(--pri); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.btn-lang {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid var(--bd);
  border-radius: var(--r-full);
  background: transparent;
  color: var(--mute);
  transition: var(--tr);
}
.btn-lang:hover { border-color: var(--pri); color: var(--pri); }
.btn-lang.active { color: var(--pri); border-color: var(--pri); background: var(--pri-light); }

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--bd);
  border-radius: var(--r-full);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute);
  transition: var(--tr);
  font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--pri); color: var(--pri); }

.btn-mobile {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.3rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  transition: var(--tr);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn-pri { background: var(--pri); color: #fff; border-color: var(--pri); }
.btn-pri:hover { background: var(--pri-dark); transform: translateY(-1px); }
.btn-sec { background: var(--surface); color: var(--ink); border-color: var(--bd); }
.btn-sec:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text); border: none; }
.btn-ghost:hover { color: var(--pri); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); }
.btn-sm { padding: 8px 16px; font-size: var(--text-xs); }
.btn-accent { background: var(--acc); color: var(--ink); border-color: var(--acc); }
.btn-accent:hover { background: var(--acc-dark); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: var(--tr);
}
.card:hover { border-color: var(--bd-strong); box-shadow: var(--shadow); }
.card-interactive { cursor: pointer; }
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--pri);
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.pill-pri { background: var(--pri-light); color: var(--pri); }
.pill-acc { background: #fef5d0; color: #856200; }
.pill-gray { background: var(--surface-2); color: var(--mute); }
.pill-live { background: var(--pri-light); color: var(--pri); }
.pill-live::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--pri);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Sections */
.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }
.section-lg { padding: 96px 0; }
.section-head { margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 12px; display: block; }
.section-head p { color: var(--mute); max-width: 600px; margin-top: 8px; }

/* Hero */
.hero { padding: 64px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(45,90,63,.08), transparent 70%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--mute);
  margin-bottom: 24px;
}
.hero-tag .dot {
  width: 6px; height: 6px;
  background: var(--pri);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.05; margin-bottom: 20px; }
.hero .lead { max-width: 560px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Trust strip */
.trust-strip {
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  background: var(--surface);
  padding: 28px 0;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  text-align: center;
}
.trust-item .num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--pri);
  line-height: 1;
}
.trust-item .lbl {
  font-size: var(--text-xs);
  color: var(--mute);
  margin-top: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Category list */
.cat-list { display: flex; flex-direction: column; }
.cat-row {
  padding: 22px 0;
  border-bottom: 1px solid var(--bd);
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  color: var(--ink);
  transition: var(--tr);
}
.cat-row:hover {
  background: var(--surface-2);
  margin: 0 -16px;
  padding: 22px 24px;
  border-radius: var(--r);
}
.cat-row .cat-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mute);
}
.cat-row:hover .cat-num { color: var(--pri); }
.cat-row .cat-name { font-weight: 700; font-size: var(--text-base); margin-bottom: 2px; }
.cat-row .cat-desc { font-size: var(--text-xs); color: var(--mute); }
.cat-row .cat-arrow { color: var(--mute); font-size: 1.3rem; transition: var(--tr); }
.cat-row:hover .cat-arrow { color: var(--pri); transform: translateX(4px); }

/* Exams section (dark green block) */
.exams-section { background: var(--pri); color: #fff; padding: 64px 0; }
.exams-section h2 { color: #fff; }
.exams-section .lead { color: rgba(255,255,255,.7); }
.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: 32px;
}
.exam-tile {
  background: var(--pri);
  padding: 20px 12px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  transition: var(--tr);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}
.exam-tile:hover { background: rgba(255,255,255,.06); }

/* Article cards */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--tr);
  color: inherit;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  border-color: var(--pri);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.article-card .cover {
  height: 180px;
  background: linear-gradient(135deg, var(--pri-light), var(--surface-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--pri);
}
.article-card .body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.article-card .cat {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pri);
  margin-bottom: 8px;
}
.article-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
}
.article-card .excerpt {
  font-size: var(--text-sm);
  color: var(--mute);
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}
.article-card .meta {
  font-size: var(--text-xs);
  color: var(--subtle);
  margin-top: auto;
  display: flex;
  gap: 10px;
}

/* Quiz cards */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 14px;
  transition: var(--tr);
}
.quiz-card:hover { border-color: var(--pri); box-shadow: var(--shadow); }
.quiz-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.quiz-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.quiz-card .guj { color: var(--mute); font-size: var(--text-sm); margin-bottom: 12px; }
.quiz-card .meta {
  display: flex;
  gap: 14px;
  font-size: var(--text-xs);
  color: var(--mute);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--surface);
  font-size: var(--text-sm);
  color: var(--ink);
  transition: var(--tr);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--pri);
  box-shadow: 0 0 0 3px rgba(45,90,63,.1);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0;
  font-size: var(--text-xs);
  color: var(--mute);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--pri); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--subtle); }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--bd);
  padding: 48px 0 24px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--mute);
  padding: 5px 0;
  transition: var(--tr);
}
.footer-col a:hover { color: var(--pri); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--bd);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--subtle);
}

/* Ad slot */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--bd);
  border-radius: var(--r);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--subtle);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 32px 0;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }

/* Mobile-nav drawer: hidden by default at every breakpoint. The mobile
   media-query below re-enables it at <=768px; the .open class is what the
   hamburger toggle adds to reveal it on mobile. On desktop, users see the
   inline .nav-links instead, so this drawer must stay hidden. */
.mobile-nav { display: none; }

/* Auth-state gating for header buttons. Until onAuthStateChanged has fired,
   body.auth-known is not set and BOTH buttons stay hidden — prevents the
   "Login flash → Dashboard" flicker on pages where the user is logged in. */
#loginBtn, #dashBtn { display: none; }
body.auth-known:not(.signed-in) #loginBtn { display: inline-flex; }
body.auth-known.signed-in #dashBtn { display: inline-flex; }

/* Mobile */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav-links { display: none; }
  .btn-mobile { display: flex; align-items: center; justify-content: center; }
  .mobile-nav {
    position: fixed;
    top: 64px; left: 0; right: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--bd);
    padding: 16px;
    display: none;
    z-index: 49;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
  }
  .mobile-nav.open { display: block; }
  .mnav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .mnav-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 12px;
    min-height: 88px;
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  }
  .mnav-card:hover,
  .mnav-card:active,
  .mnav-card:focus-visible {
    border-color: var(--pri);
    background: var(--pri-light);
    box-shadow: 0 4px 10px rgba(45,90,63,.08);
    transform: translateY(-1px);
    outline: none;
  }
  .mnav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--pri-light);
    color: var(--pri);
    font-size: 20px;
    line-height: 1;
  }
  .mnav-label {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
  }
  .mnav-login {
    display: block;
    margin-top: 12px;
    padding: 14px;
    text-align: center;
    background: var(--pri);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    font-size: var(--text-sm);
    text-decoration: none;
  }
  .mnav-login:hover,
  .mnav-login:focus-visible { background: var(--pri-dark); outline: none; }
  /* When user is already signed-in (body.signed-in), hide the login CTA. */
  body.signed-in .mnav-login { display: none; }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .hero { padding: 40px 0 32px; }
  .section { padding: 40px 0; }
  .exams-grid { grid-template-columns: repeat(2, 1fr); }
}
