/* ========================================
   TheCertCoach.com — Qstream-Inspired SaaS
   ======================================== */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }
input { font: inherit; color: inherit; }
table { border-collapse: collapse; }

/* --- Custom Properties --- */
:root {
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --bg:            #FFFFFF;
  --bg-alt:        #F4F5F2;
  --bg-surface:    #FFFFFF;
  --border:        #DFE1DC;
  --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:     0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --fg:            #1E2228;
  --fg-secondary:  #5A6068;
  --fg-muted:      #8B9098;
  --green:         #4DA648;
  --green-hover:   #3E8E3A;
  --green-dim:     rgba(77, 166, 72, 0.1);
  --accent:        #D49B2A;
  --accent-hover:  #BE8A22;
  --accent-dim:    rgba(212, 155, 42, 0.1);
  --radius:        8px;
  --radius-lg:     12px;
  --radius-sm:     6px;
  --nav-height:    5.5rem;
  --nav-bg:        #FFFFFF;
  --nav-shadow:    0 1px 3px rgba(0,0,0,0.1);
  --footer-bg:     #1E2228;
  --footer-fg:     #CDD0D4;
  --footer-fg-dim: #8B9098;
}

.dark {
  --bg:            #191C21;
  --bg-alt:        #21252B;
  --bg-surface:    #21252B;
  --border:        #353A42;
  --shadow:        0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:     0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg:     0 10px 15px rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.2);
  --fg:            #E8EAED;
  --fg-secondary:  #9BA1AB;
  --fg-muted:      #6B7280;
  --green-dim:     rgba(77, 166, 72, 0.15);
  --accent-dim:    rgba(212, 155, 42, 0.15);
  --nav-bg:        #191C21;
  --nav-shadow:    0 1px 3px rgba(0,0,0,0.4);
  --footer-bg:     #111316;
  --footer-fg:     #CDD0D4;
  --footer-fg-dim: #6B7280;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--green);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus {
  top: 0.5rem;
}

/* --- Screen reader only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Exam fieldset reset --- */
.exam-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg);
  letter-spacing: -0.02em;
}

h1 { font-size: 2.625rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* --- Layout --- */
.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { flex: 1; }

/* ============================
   NAVIGATION
   ============================ */
.nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--nav-shadow);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo img {
  height: 3.5rem;
  width: auto;
}

.logo-light { display: block; }
.logo-dark { display: none; }
.dark .logo-light { display: none; }
.dark .logo-dark { display: block; }

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg-secondary);
  transition: color 0.2s;
  padding: 0.25rem 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--fg);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  background: var(--green);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--green-hover); }

.theme-toggle {
  padding: 0.375rem;
  color: var(--fg-muted);
  transition: color 0.2s;
  margin-left: 0.5rem;
}
.theme-toggle:hover { color: var(--fg); }

.icon-sun { display: none; }
.dark .icon-sun { display: block; }
.dark .icon-moon { display: none; }

.mobile-toggle {
  padding: 0.5rem;
  color: var(--fg-secondary);
}
.mobile-toggle:hover { color: var(--fg); }
.icon-close { display: none; }
.mobile-open .icon-menu { display: none; }
.mobile-open .icon-close { display: block; }

.mobile-menu {
  display: none;
  padding: 1rem 1.5rem 1.5rem;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 0;
  color: var(--fg-secondary);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a:last-of-type { border-bottom: none; }
.mobile-menu a:hover,
.mobile-menu a.active { color: var(--green); }
.mobile-menu .nav-cta {
  display: block;
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: none;
}
.mobile-menu .nav-cta:hover { color: #FFFFFF; }

/* --- Auth Nav --- */
.nav-auth-btn {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.nav-auth-btn:hover {
  color: var(--fg);
  background: var(--bg-alt);
}

.user-menu {
  position: relative;
  display: none;
  align-items: center;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.user-menu-trigger:hover { background: var(--bg-alt); }

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.375rem;
  min-width: 12rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  z-index: 60;
}
.user-menu-dropdown.open { display: block; }

.user-menu-email {
  display: block;
  font-size: 0.75rem;
  color: var(--fg-muted);
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-secondary);
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.user-menu-item:hover {
  color: var(--fg);
  background: var(--bg-alt);
}

.mobile-auth-btn {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 0;
  color: var(--fg-secondary);
  border-bottom: 1px solid var(--border);
}
.mobile-auth-btn:hover { color: var(--green); }

.mobile-user-name {
  display: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  padding: 0.75rem 0;
}

/* ============================
   FOOTER
   ============================ */
.footer {
  margin-top: auto;
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand img {
  height: 6rem;
  margin-bottom: 1.25rem;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--footer-fg-dim);
  line-height: 1.6;
  max-width: 20rem;
}

.footer .logo-light { display: none; }
.footer .logo-dark { display: block; }

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--footer-fg);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--footer-fg-dim);
  padding: 0.25rem 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: #FFFFFF; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--footer-fg-dim);
}

.footer-bottom a {
  color: var(--footer-fg-dim);
  transition: color 0.2s;
}
.footer-bottom a:hover { color: #FFFFFF; }

/* ============================
   SECTIONS
   ============================ */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--bg-alt);
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h1,
.section-header h2 {
  margin-bottom: 0.75rem;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--fg-secondary);
  max-width: 36rem;
  margin: 0 auto;
  line-height: 1.65;
}

/* ============================
   HERO
   ============================ */
.hero {
  padding: 7.5rem 0 5rem;
  text-align: center;
  background: var(--bg);
}

.hero-heading {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-shield {
  height: 6.5rem;
  width: auto;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.hero h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  margin: 0;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  max-width: 36rem;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================
   CARDS
   ============================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.9375rem;
  color: var(--fg-secondary);
  line-height: 1.65;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  margin-top: 1rem;
  transition: gap 0.2s;
}
.card-link:hover { gap: 0.5rem; }

/* ============================
   STATS BAR
   ============================ */
.stats-bar {
  background: var(--green);
  color: #FFFFFF;
  padding: 3rem 0;
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.9;
}

.stat-divider {
  width: 1px;
  height: 2.5rem;
  background: rgba(255,255,255,0.3);
}

/* ============================
   STATUS BADGES
   ============================ */
.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.status-soon {
  color: #166534;
  background: #DCFCE7;
}
.dark .status-soon {
  color: #4ADE80;
  background: rgba(72, 168, 75, 0.2);
}

.status-ready {
  color: #166534;
  background: #DCFCE7;
}
.dark .status-ready {
  color: #4ADE80;
  background: rgba(72, 168, 75, 0.2);
}

.status-planned {
  color: var(--fg-secondary);
  background: var(--bg-alt);
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #FFFFFF;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}

.btn:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn:disabled:hover {
  background: var(--green);
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  transition: border-color 0.2s, color 0.2s;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: var(--green);
  color: var(--green);
}

.text-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--green);
  transition: opacity 0.2s;
}
.text-link:hover { opacity: 0.8; }

/* ============================
   SEARCH INPUT
   ============================ */
.search-wrap {
  max-width: 24rem;
  margin: 0 auto 2.5rem;
  position: relative;
}

.search-input {
  width: 100%;
  font-size: 0.9375rem;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}
.search-input::placeholder {
  color: var(--fg-muted);
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
}

/* ============================
   CERT DETAIL
   ============================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--green); }

.cert-header {
  margin-bottom: 2.5rem;
}

.cert-fullname {
  font-size: 1rem;
  color: var(--fg-secondary);
  margin-bottom: 0.75rem;
}

.cert-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--fg-secondary);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.meta-sep { color: var(--border); }

.cert-detail-desc {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg-secondary);
  margin-bottom: 2.5rem;
}

/* Learn list with checkmark icons */
.learn-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.learn-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg-secondary);
}

.learn-icon {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

/* Domain & Module hierarchy */
details.domain-section {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

summary.domain-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  background: var(--bg-alt);
  transition: background 0.15s;
  list-style: none;
}

summary.domain-title::-webkit-details-marker { display: none; }

summary.domain-title::before {
  content: '▸';
  font-size: 1rem;
  color: var(--green);
  transition: transform 0.2s;
  flex-shrink: 0;
}

details.domain-section[open] > summary.domain-title::before {
  transform: rotate(90deg);
}

summary.domain-title:hover {
  background: var(--border);
}

details.domain-section > :not(summary) {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.domain-desc {
  font-size: 0.9375rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  margin-top: 1.25rem;
}

details.domain-section .module-list:last-child {
  margin-bottom: 1.5rem;
}

.module-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

/* Module list with numbered cards */
.module-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.module-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.module-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--green-dim);
  color: var(--green);
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}

.module-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg);
}

.module-lock {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ============================
   METHOD STEPS
   ============================ */
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--green);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ============================
   ABOUT - PROSE + VALUES
   ============================ */
.prose-body p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--fg-secondary);
  margin-bottom: 1.25rem;
}
.prose-body p:last-child { margin-bottom: 0; }

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.value-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.value-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.value-card p {
  font-size: 0.9375rem;
  color: var(--fg-secondary);
  line-height: 1.65;
}

.contact-section {
  text-align: center;
}

.contact-section p {
  font-size: 1.0625rem;
  color: var(--fg-secondary);
  margin-top: 0.75rem;
}

/* ============================
   BLOG
   ============================ */
.blog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.blog-card:hover { box-shadow: var(--shadow-md); }

.blog-card time {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.blog-card h2 {
  font-size: 1.375rem;
  margin-bottom: 0.75rem;
}

.blog-card h2 a {
  color: var(--fg);
  transition: color 0.2s;
}
.blog-card h2 a:hover { color: var(--green); }

.blog-card p {
  font-size: 0.9375rem;
  color: var(--fg-secondary);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.reading-time {
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

/* Post cards for related articles */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  flex-wrap: wrap;
}
.post-card:hover { box-shadow: var(--shadow-md); }

.post-card time {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  transition: color 0.2s;
}
.post-link:hover { color: var(--green); }

/* ============================
   PROSE (Blog Articles)
   ============================ */
.article-header {
  margin-bottom: 2.5rem;
}

.article-header time {
  font-size: 0.875rem;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: 2.25rem;
  line-height: 1.25;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.prose p {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--fg-secondary);
  margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
  font-size: 1.0625rem;
  color: var(--fg-secondary);
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { line-height: 1.8; margin-bottom: 0.5rem; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose em { font-style: italic; }

.prose a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { text-decoration: none; }

.prose blockquote {
  border-left: 3px solid var(--green);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-size: 1.0625rem;
  color: var(--fg);
  line-height: 1.7;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.continue-reading {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.continue-reading h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* ============================
   MODULE PAGE
   ============================ */
.module-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.module-meta-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-secondary);
}

.module-meta-sep {
  color: var(--fg-muted);
  font-size: 0.75rem;
}

/* Knowledge check — details/summary */
.prose details {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.prose summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s;
  list-style: none;
}

.prose summary::-webkit-details-marker { display: none; }

.prose summary::before {
  content: '▸';
  font-size: 0.875rem;
  color: var(--green);
  transition: transform 0.2s;
}

.prose details[open] summary::before {
  transform: rotate(90deg);
}

.prose summary:hover {
  background: var(--bg-alt);
}

.prose details .answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--fg-secondary);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.prose details .answer strong {
  color: var(--green);
}

/* Prose tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.prose th,
.prose td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}
.prose th {
  background: var(--bg-alt, var(--bg));
  font-weight: 600;
}
.prose tr:nth-child(even) td {
  background: var(--bg-alt, var(--bg));
}

/* Next module navigation */
.next-module {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.next-module-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.next-module-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-top: 0.25rem;
}

.next-module-arrow {
  font-size: 1.25rem;
  color: var(--green);
  flex-shrink: 0;
}

a.next-module:hover {
  border-color: var(--green);
}

.module-item-active {
  border-color: var(--green);
  background: var(--green-dim);
}

.module-item-active .module-lock {
  color: var(--green);
  font-weight: 600;
}

/* ============================
   EMPTY STATE
   ============================ */
.empty-msg {
  font-size: 0.9375rem;
  color: var(--fg-secondary);
  text-align: center;
  margin-top: 2rem;
}

/* ============================
   PRACTICE EXAM
   ============================ */
.exam-start-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.exam-start-header h1 { margin-bottom: 0.75rem; }
.exam-start-header p {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--fg-secondary);
  font-size: 1.125rem;
  line-height: 1.6;
}

.exam-size-label {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.exam-size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 24rem;
  margin: 0 auto 2rem;
}

.exam-size-btn {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  padding: 0.875rem 1rem;
  background: var(--bg-surface);
  color: var(--fg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.exam-size-btn:hover {
  border-color: var(--green);
}
.exam-size-btn.active {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}

#exam-start-btn {
  display: block;
  margin: 0 auto;
}

.exam-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.exam-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.exam-question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.exam-counter {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg-secondary);
}
.exam-score-live {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.exam-question-text {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.exam-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.exam-option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  color: var(--fg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.exam-option:hover:not(.exam-option-locked) {
  border-color: var(--green);
  background: var(--green-dim);
}
.exam-option-locked { cursor: default; }
.exam-option-correct {
  border-color: var(--green);
  background: var(--green-dim);
}
.exam-option-incorrect {
  border-color: #DC2626;
  background: rgba(220, 38, 38, 0.08);
}
.dark .exam-option-incorrect {
  background: rgba(220, 38, 38, 0.15);
}
.exam-option-dimmed {
  opacity: 0.5;
}

.exam-feedback {
  padding: 1.25rem 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.exam-feedback-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--fg-secondary);
  margin-bottom: 1rem;
}
.exam-feedback-text strong {
  color: var(--green);
}
.exam-feedback-incorrect strong {
  color: #DC2626;
}
.dark .exam-feedback-incorrect strong {
  color: #FCA5A5;
}

.exam-results-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}
.exam-results-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.exam-results-pct {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg-secondary);
  margin-bottom: 0.75rem;
}
.exam-results-verdict {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.375rem 1.25rem;
  border-radius: 9999px;
}
.exam-verdict-pass {
  color: #166534;
  background: #DCFCE7;
}
.dark .exam-verdict-pass {
  color: #4ADE80;
  background: rgba(72, 168, 75, 0.2);
}
.exam-verdict-fail {
  color: #991B1B;
  background: #FEE2E2;
}
.dark .exam-verdict-fail {
  color: #FCA5A5;
  background: rgba(220, 38, 38, 0.15);
}

.exam-results-breakdown {
  margin-bottom: 2rem;
}
.exam-domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}
.exam-domain-row:last-child { border-bottom: none; }
.exam-domain-name { color: var(--fg); font-weight: 500; }
.exam-domain-score { color: var(--fg-secondary); }

.exam-results-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================
   SETTINGS PAGE
   ============================ */
.settings-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}
.settings-gate h2 { font-size: 1.5rem; }
.settings-gate p { color: var(--fg-secondary); }

.settings-layout {
  display: grid;
  grid-template-columns: 16rem 1fr;
  min-height: calc(100vh - var(--nav-height));
}

.settings-sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 2rem 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.settings-nav-group {
  padding: 0 1rem;
  margin-bottom: 1.5rem;
}

.settings-nav-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.375rem;
}

.settings-nav-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.settings-nav-item:hover {
  color: var(--fg);
  background: var(--bg-surface);
}
.settings-nav-item.active {
  color: var(--green);
  background: var(--green-dim);
  font-weight: 600;
}

.settings-main {
  padding: 2rem 2.5rem;
  max-width: 52rem;
}

.settings-section {
  display: none;
}
.settings-section.active {
  display: block;
}

.settings-page-header {
  margin-bottom: 1.5rem;
}
.settings-page-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.settings-page-header p {
  color: var(--fg-secondary);
  font-size: 0.9375rem;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.settings-card-title {
  font-size: 1rem;
  font-weight: 600;
}

.settings-card-content {
  padding: 1.25rem;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }

.settings-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
}

.settings-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
}

.plan-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  background: var(--green-dim);
  color: var(--green);
}

.settings-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  background: var(--bg-alt);
  color: var(--fg-secondary);
}

.btn-sm {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--fg-secondary);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}
.btn-sm:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--fg-muted);
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--fg-secondary);
  line-height: 1.7;
}

/* Forms */
.settings-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg);
}
.form-input {
  font-size: 0.875rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--green);
}
.form-textarea { resize: vertical; }
.form-success {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--green-dim);
  border-radius: var(--radius);
}
.form-success svg { flex-shrink: 0; margin-top: 0.125rem; }
.form-success p { font-size: 0.875rem; color: var(--fg); }

/* Admin tables */
.settings-loading {
  text-align: center;
  padding: 2rem;
  color: var(--fg-muted);
  font-size: 0.875rem;
}
.settings-loading .btn-sm {
  margin-left: 0.5rem;
}
.settings-card-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-table {
  width: 100%;
  min-width: 500px;
  font-size: 0.8125rem;
}
.settings-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
}
.settings-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg-secondary);
}
.settings-table tr:last-child td { border-bottom: none; }
.settings-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.settings-table th::after { content: ''; display: inline-block; width: 0.75em; margin-left: 0.25em; }
.settings-table th.sort-asc::after { content: '\25B2'; font-size: 0.6em; vertical-align: middle; }
.settings-table th.sort-desc::after { content: '\25BC'; font-size: 0.6em; vertical-align: middle; }
.user-cell { display: flex; flex-direction: column; }
.user-cell-name { font-weight: 500; color: var(--fg); }
.user-cell-email { font-size: 0.8125rem; color: var(--fg-muted); }

/* Mobile sidebar toggle */
.settings-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
}

/* --- Form error message --- */
.form-error {
  color: #c0392b;
  font-size: 0.875rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(192, 57, 43, 0.08);
  border-radius: var(--radius);
}

/* --- Small button variant --- */
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}
.breadcrumbs a {
  color: var(--blue);
  text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .breadcrumb-sep {
  margin: 0 0.15rem;
}

/* --- Coming Soon banner --- */
.coming-soon-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 1.5rem;
  color: var(--fg-secondary);
  font-size: 0.9rem;
}
.coming-soon-banner svg { flex-shrink: 0; color: var(--accent); }

/* --- 404 Page --- */
.error-code {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--green);
  margin-bottom: 0.5rem;
}

/* --- Progress tracking --- */
.module-check {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--green);
}
.module-item-completed .module-check { display: block; }
.module-item-completed .module-lock { display: none; }

/* Module status labels (signed-in users) */
.module-lock.status-not-started { color: var(--fg-muted); font-weight: 500; }
.module-lock.status-in-progress { color: var(--accent); font-weight: 600; }
.module-lock.status-completed { color: var(--green); font-weight: 600; }

.btn-completed {
  background: var(--bg-surface);
  color: var(--green);
  border: 2px solid var(--green);
  cursor: default;
}

.cert-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 1rem 0 0.5rem;
  overflow: hidden;
}
.cert-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.cert-progress-text {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin-bottom: 1.5rem;
}

/* --- Exam history --- */
.exam-history { margin-top: 2rem; }
.exam-history-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--fg);
}
.exam-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.exam-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.exam-history-score {
  font-weight: 600;
}
.exam-history-pass { color: var(--green); }
.exam-history-fail { color: #c0392b; }
.exam-history-date {
  color: var(--fg-muted);
  font-size: 0.8rem;
}
.exam-history-empty {
  color: var(--fg-muted);
  font-size: 0.875rem;
  font-style: italic;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (min-width: 640px) {
  .container { padding: 0 2rem; }
  .container-narrow { padding: 0 2rem; }
  .hero { padding: 8rem 0 5rem; }
  .hero h1 { font-size: 2rem; }
  .hero-shield { height: 7rem; }
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .mobile-toggle { display: none; }
  .nav-logo img { height: 4.5rem; }
  .hero h1 { font-size: 2.15rem; }
  .hero-shield { height: 8rem; }
}

@media (min-width: 1024px) {
  .hero h1 { font-size: 2.4rem; }
  .hero-shield { height: 9rem; }
}

@media (max-width: 767px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-grid-2 { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .stats-grid { gap: 2rem; }
  .stat-divider { display: none; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero { padding: 5rem 0 3rem; }
  .hero-heading { flex-direction: column; gap: 1rem; }
  .hero h1 { text-align: center; }
  .section { padding: 3.5rem 0; }
  .section-alt { padding: 3.5rem 0; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: auto;
    max-height: 60vh;
    z-index: 40;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .settings-sidebar.open { display: block; }
  .settings-sidebar-toggle { display: flex; }
  .settings-main { padding: 1.5rem; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
