/* ==========================================================================
   NoGapPrep — shared design system
   Brand: teal/amber. Screens: home grid + 3-screen exam SPA (welcome/exam/result).
   ========================================================================== */

/* ---- Reset & base variables ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--neutral-800);
  background: var(--neutral-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

:root {
  --brand: #0f766e;
  --brand-dark: #0b4742;
  --brand-darker: #082f2c;
  --brand-light: #14b8a6;
  --brand-rgb: 15, 118, 110;
  --accent: #f59e0b;
  --accent-dark: #b45309;
  --success: #16a34a;
  --success-light: #dcfce7;
  --success-dark: #15803d;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-dark: #b91c1c;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .10);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, .14);
  --shadow-card: 0 18px 40px rgba(15, 23, 42, .10);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: .22s cubic-bezier(.4, 0, .2, 1);
}

:focus-visible {
  outline: 3px solid rgba(var(--brand-rgb), .45);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

/* ---- Decorative background --------------------------------------------- */
body.theme-home,
body.theme-servsafe {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(160deg, #f8fafc 0%, #f1f5f9 55%, #ecfdf5 100%);
}
body.theme-home::before,
body.theme-servsafe::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 12%, rgba(var(--brand-rgb), .12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 82%, rgba(245, 158, 11, .10) 0%, transparent 58%);
}
body.theme-home > *,
body.theme-servsafe > * { position: relative; z-index: 1; }

/* ==========================================================================
   Home page
   ========================================================================== */
.home-screen {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.home-header { text-align: center; max-width: 760px; }
.home-logo-wrapper {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 14px;
}
.home-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -.02em;
}
.home-subtitle {
  margin-top: 14px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--neutral-600);
}
.home-year-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .04em;
  box-shadow: var(--shadow-sm);
}
.home-beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  margin-left: 10px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--warning-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .03em;
  border: 1px solid rgba(245, 158, 11, .35);
}

.home-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.cert-card {
  display: block;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(var(--brand-rgb), .16);
  background: linear-gradient(180deg, var(--white), #f6fdfb);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.cert-card:hover,
.cert-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 26px 56px rgba(var(--brand-rgb), .22);
}
.cert-card-inner { padding: 30px 30px 26px; display: flex; flex-direction: column; gap: 16px; }
.cert-card-icon {
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(var(--brand-rgb), .12);
  color: var(--brand);
  font-size: 1.4rem;
}
.cert-card-org {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
}
.cert-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--neutral-900);
}
.cert-card-desc { color: var(--neutral-600); line-height: 1.55; font-size: .95rem; }

.cert-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--neutral-200);
  border-bottom: 1px solid var(--neutral-200);
}
.cert-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cert-stat-value { font-size: 1.15rem; font-weight: 800; color: var(--brand-dark); }
.cert-stat-label { font-size: .72rem; color: var(--neutral-500); text-transform: uppercase; letter-spacing: .04em; }

.cert-card-modules { display: flex; flex-wrap: wrap; gap: 8px; }
.cert-module-tag {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(var(--brand-rgb), .09);
  color: var(--brand-dark);
  font-size: .76rem;
  font-weight: 600;
}

.cert-card-cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), .28);
  transition: box-shadow var(--transition);
}
.cert-card:hover .cert-card-cta { box-shadow: 0 14px 32px rgba(var(--brand-rgb), .38); }
.cert-card-arrow { transition: transform var(--transition); }
.cert-card:hover .cert-card-arrow { transform: translateX(3px); }

.home-tip {
  text-align: center;
  color: var(--neutral-600);
  font-size: .95rem;
}
.home-resource-link-wrap { display: flex; justify-content: center; }
.home-resource-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--neutral-200);
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.home-resource-link:hover { border-color: rgba(var(--brand-rgb), .4); box-shadow: var(--shadow-md); }

/* ---- Shared footer ------------------------------------------------------ */
.seo-footer {
  width: 100%;
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 26px 20px 40px;
  text-align: center;
  color: var(--neutral-500);
  font-size: .85rem;
  border-top: 1px solid var(--neutral-200);
}
.seo-footer p { margin: 6px 0; }
.seo-footer a { color: var(--brand-dark); font-weight: 600; }
.seo-footer a:hover { text-decoration: underline; }
.seo-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }

/* ==========================================================================
   3-screen exam SPA (welcome / exam / result)
   ========================================================================== */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

#screen-welcome {
  width: 100%;
  padding: 40px 16px 24px;
  gap: 24px;
}
#screen-welcome > .welcome-container,
#screen-welcome > .seo-toggle-wrap,
#screen-welcome > .seo-content,
#screen-welcome > .seo-footer {
  width: min(1080px, 100%);
}

.welcome-container.card {
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: 0 30px 70px rgba(var(--brand-rgb), .18), var(--shadow-card);
  overflow: hidden;
}

.welcome-header {
  position: relative;
  overflow: hidden;
  padding: 38px 42px 30px;
  color: var(--white);
  background: radial-gradient(circle at 88% 10%, rgba(20, 184, 166, .25), transparent 34%),
              linear-gradient(135deg, var(--brand-darker) 0%, var(--brand-dark) 55%, var(--brand) 100%);
}
.welcome-header::after {
  content: "";
  position: absolute;
  right: -70px; bottom: -100px;
  width: 240px; height: 240px;
  border: 40px solid rgba(255, 255, 255, .06);
  border-radius: 50%;
}
.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}
.welcome-heading {
  margin-top: 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.01em;
}
.welcome-lead {
  margin-top: 10px;
  max-width: 640px;
  color: rgba(255, 255, 255, .88);
  line-height: 1.6;
}
.beta-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35);
  font-size: .8rem;
  font-weight: 700;
}

.welcome-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 28px 34px;
  padding: 34px 42px 42px;
}

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--neutral-700);
}
.form-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--neutral-200);
  font-size: 1rem;
  font-family: inherit;
  color: var(--neutral-800);
  background: var(--neutral-50);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12);
  background: var(--white);
}
.form-input.invalid { border-color: var(--danger); }
.form-error {
  display: block;
  margin-top: 6px;
  color: var(--danger-dark);
  font-size: .82rem;
  font-weight: 600;
}

.exam-size-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.exam-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--neutral-200);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.exam-size-btn:hover { border-color: rgba(var(--brand-rgb), .4); }
.exam-size-btn.selected {
  border-color: var(--brand);
  background: rgba(var(--brand-rgb), .08);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12);
}
.exam-size-number { font-size: 1.3rem; font-weight: 800; color: var(--brand-dark); }
.exam-size-label { font-size: .78rem; color: var(--neutral-600); font-weight: 600; }
.exam-size-time { font-size: .72rem; color: var(--neutral-400); }
.exam-size-badge {
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--warning-light);
  color: var(--accent-dark);
  font-size: .66rem;
  font-weight: 700;
}

.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  font-size: .88rem;
  color: var(--neutral-600);
  line-height: 1.5;
}
.terms-checkbox { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.terms-link { color: var(--brand-dark); font-weight: 700; }
.terms-link:hover { text-decoration: underline; }

.btn-primary {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white);
  font-size: 1.02rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(var(--brand-rgb), .32);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(var(--brand-rgb), .4); }
.btn-primary:active { transform: translateY(0); }

.modules-info {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  align-self: start;
}
.modules-info-title { font-weight: 800; color: var(--neutral-900); margin-bottom: 4px; }
.modules-info-sub { font-size: .82rem; color: var(--neutral-500); margin-bottom: 14px; }
.modules-info-list { display: flex; flex-direction: column; gap: 9px; }
.modules-info-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: .87rem;
  color: var(--neutral-700);
  line-height: 1.4;
}
.modules-info-item .num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(var(--brand-rgb), .12);
  color: var(--brand-dark);
  font-size: .72rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.fact-box { margin-top: 18px; padding: 18px; border-radius: var(--radius-lg); background: var(--white); border: 1px dashed var(--neutral-300); }
.fact-box-title { font-weight: 800; font-size: .85rem; color: var(--neutral-800); margin-bottom: 12px; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fact-item { display: flex; flex-direction: column; gap: 2px; }
.fact-value { font-weight: 800; color: var(--brand-dark); font-size: .95rem; }
.fact-label { font-size: .72rem; color: var(--neutral-500); }
.fact-source { grid-column: 1 / -1; font-size: .74rem; color: var(--neutral-400); margin-top: 4px; }
.fact-source a { color: var(--brand-dark); font-weight: 600; }

/* ---- SEO expandable content --------------------------------------------- */
.seo-toggle-wrap { display: flex; justify-content: center; margin-top: 4px; }
.seo-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--neutral-200);
  background: var(--white);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: .88rem;
  box-shadow: var(--shadow-sm);
}
.seo-toggle-btn:hover { box-shadow: var(--shadow-md); }
.seo-content {
  margin-top: 6px;
  padding: 30px;
  border-radius: var(--radius-xl);
  background: var(--white);
  border: 1px solid var(--neutral-200);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.seo-section h2 { font-size: 1.2rem; font-weight: 800; color: var(--neutral-900); margin-bottom: 10px; }
.seo-section p {
  color: var(--neutral-600);
  line-height: 1.65;
  margin-bottom: 10px;
  text-align: justify;
  text-justify: inter-word;
}
.seo-section table {
  width: 100%;
  margin: 18px 0 8px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  border-spacing: 0;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.seo-section th,
.seo-section td { padding: 13px 16px; border-bottom: 1px solid var(--neutral-200); }
.seo-section th {
  background: var(--brand-dark);
  color: var(--white);
  font-size: .82rem;
  font-weight: 700;
}
.seo-section th:first-child { border-top-left-radius: calc(var(--radius-md) - 1px); }
.seo-section th:last-child { border-top-right-radius: calc(var(--radius-md) - 1px); }
.seo-section tbody tr:nth-child(even) { background: var(--neutral-50); }
.seo-section tbody tr:hover { background: rgba(var(--brand-rgb), .07); }
.seo-section tbody td { color: var(--neutral-600); line-height: 1.5; }
.seo-section tbody td:first-child { color: var(--neutral-800); font-weight: 700; }
.seo-section tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .seo-section table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }
  .seo-section th,
  .seo-section td { padding: 11px 12px; white-space: nowrap; }
}
.seo-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 12px; }
.seo-mini-card { padding: 16px; border-radius: var(--radius-md); background: var(--neutral-50); border: 1px solid var(--neutral-200); }
.seo-mini-card h3 { font-size: .95rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 6px; }
.seo-mini-card p { font-size: .85rem; margin: 0; }

.faq-item { border-bottom: 1px solid var(--neutral-200); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-weight: 700; color: var(--neutral-900); margin-bottom: 6px; }
.faq-answer { color: var(--neutral-600); line-height: 1.6; font-size: .92rem; }

/* ==========================================================================
   Exam screen
   ========================================================================== */
#screen-exam { width: 100%; min-height: 100vh; align-items: stretch; }
.exam-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(8, 47, 44, .94);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 5;
}
.back-home-btn {
  color: rgba(255, 255, 255, .78);
  font-size: .85rem;
  font-weight: 600;
}
.back-home-btn:hover { color: var(--white); }
.exam-user-badge { font-weight: 700; font-size: .92rem; }
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .12);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.exam-progress {
  padding: 12px 22px;
  background: rgba(11, 71, 66, .86);
}
.progress-bar { height: 8px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .18); overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand-light), var(--accent)); transition: width .3s ease; }
.progress-text { display: block; margin-top: 6px; font-size: .76rem; color: rgba(255, 255, 255, .78); }

.exam-content {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}
.question-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 30px;
}
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.question-counter {
  font-weight: 700;
  color: var(--brand-dark);
  background: rgba(var(--brand-rgb), .1);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: .85rem;
}
.module-badge {
  font-size: .78rem;
  font-weight: 700;
  color: var(--neutral-500);
  background: var(--neutral-100);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}
.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--neutral-900);
  line-height: 1.55;
  margin-bottom: 22px;
}

.options-container { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--neutral-200);
  background: var(--white);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.option-btn:hover:not(.disabled) { border-color: rgba(var(--brand-rgb), .45); transform: translateX(2px); }
.option-btn.disabled { cursor: default; }
.option-letter {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-weight: 800;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.option-text { color: var(--neutral-800); line-height: 1.5; }
.option-btn.correct { border-color: var(--success); background: var(--success-light); }
.option-btn.correct .option-letter { background: var(--success); color: var(--white); }
.option-btn.wrong { border-color: var(--danger); background: var(--danger-light); }
.option-btn.wrong .option-letter { background: var(--danger); color: var(--white); }

.explanation-box {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.explanation-box.state-correct { background: var(--success-light); border: 1px solid rgba(22, 163, 74, .3); }
.explanation-box.state-wrong { background: var(--danger-light); border: 1px solid rgba(220, 38, 38, .3); }
.explanation-icon { font-size: 1.4rem; line-height: 1; }
.explanation-title { display: block; font-weight: 800; margin-bottom: 4px; }
.explanation-box.state-correct .explanation-title { color: var(--success-dark); }
.explanation-box.state-wrong .explanation-title { color: var(--danger-dark); }
.explanation-text { color: var(--neutral-700); line-height: 1.55; font-size: .92rem; }

.exam-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}
.btn-next {
  padding: 13px 28px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), .3);
  transition: opacity var(--transition), transform var(--transition);
}
.btn-next:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn-next:not(:disabled):hover { transform: translateY(-2px); }

/* ==========================================================================
   Result screen
   ========================================================================== */
#screen-result { width: 100%; align-items: stretch; }
.result-hero {
  padding: 44px 22px 54px;
  text-align: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--brand-darker), var(--brand-dark) 55%, var(--brand));
  position: relative;
}
.result-hero .back-home-btn { position: absolute; left: 22px; top: 22px; }
.result-user-name { font-weight: 700; opacity: .88; margin-bottom: 18px; }

.score-circle-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto 18px; }
.score-circle { transform: rotate(-90deg); }
.score-circle-bg { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 12; }
.score-circle-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.score-circle-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 800;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 10px;
}
.result-badge.passed { background: rgba(22, 163, 74, .22); color: #bbf7d0; }
.result-badge.failed { background: rgba(220, 38, 38, .22); color: #fecaca; }
.result-message { max-width: 520px; margin: 0 auto; color: rgba(255, 255, 255, .9); line-height: 1.55; }

.result-content {
  width: 100%;
  max-width: 820px;
  margin: 20px auto 0;
  padding: 0 20px 50px;
}
.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}
.result-stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.result-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--brand-dark); }
.result-stat-label { font-size: .76rem; color: var(--neutral-500); margin-top: 4px; }

.module-breakdown {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.module-row-header { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 6px; }
.module-row-name { font-weight: 700; color: var(--neutral-800); }
.module-row-score { color: var(--neutral-500); font-weight: 600; }
.module-row-bar { height: 8px; border-radius: var(--radius-pill); background: var(--neutral-100); overflow: hidden; }
.module-row-bar-fill { height: 100%; border-radius: var(--radius-pill); }
.module-row-bar-fill.good { background: var(--success); }
.module-row-bar-fill.warn { background: var(--warning); }
.module-row-bar-fill.poor { background: var(--danger); }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}
.btn-secondary {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--neutral-200);
  background: var(--white);
  color: var(--neutral-700);
  font-weight: 700;
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.btn-secondary:hover { border-color: rgba(var(--brand-rgb), .4); box-shadow: var(--shadow-sm); }
.btn-secondary.solid {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 10px 22px rgba(var(--brand-rgb), .28);
}

.review-section { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 22px; }
.review-container { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.review-item { padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--neutral-200); }
.review-item.correct { border-left: 4px solid var(--success); }
.review-item.wrong { border-left: 4px solid var(--danger); }
.review-index { font-size: .76rem; font-weight: 700; color: var(--neutral-500); margin-bottom: 6px; }
.review-question { font-weight: 700; color: var(--neutral-900); margin-bottom: 10px; line-height: 1.45; }
.review-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.review-option { padding: 8px 12px; border-radius: var(--radius-sm); font-size: .88rem; background: var(--neutral-50); color: var(--neutral-600); }
.review-option.was-correct { background: var(--success-light); color: var(--success-dark); font-weight: 700; }
.review-option.was-selected-wrong { background: var(--danger-light); color: var(--danger-dark); font-weight: 700; }
.review-explanation { font-size: .85rem; color: var(--neutral-600); line-height: 1.55; }

/* ==========================================================================
   Standalone SEO pages (about / privacy / terms / guides / 404)
   ========================================================================== */
.seo-page { min-height: 100vh; }
.seo-article {
  max-width: 780px;
  margin: 0 auto;
  padding: 56px 22px 60px;
}
.seo-eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-dark);
  margin-bottom: 10px;
}
.seo-article h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; color: var(--neutral-900); letter-spacing: -.01em; }
.seo-lead { margin-top: 14px; font-size: 1.05rem; color: var(--neutral-600); line-height: 1.6; }
.seo-article h2 { margin-top: 34px; margin-bottom: 12px; font-size: 1.25rem; font-weight: 800; color: var(--neutral-900); }
.seo-article h3 { margin-top: 20px; margin-bottom: 8px; font-size: 1.05rem; font-weight: 700; color: var(--brand-dark); }
.seo-article p { color: var(--neutral-600); line-height: 1.7; margin-bottom: 14px; }
.seo-article ul, .seo-article ol { margin: 0 0 14px; padding-left: 22px; list-style: disc; color: var(--neutral-600); line-height: 1.7; }
.seo-article ol { list-style: decimal; }
.seo-article li { margin-bottom: 6px; }
.seo-article a { color: var(--brand-dark); font-weight: 600; text-decoration: underline; }
.seo-article table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .92rem; }
.seo-article th, .seo-article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--neutral-200); }
.seo-article th { color: var(--neutral-700); font-weight: 700; background: var(--neutral-50); }
.seo-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.seo-button {
  padding: 13px 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(var(--brand-rgb), .3);
}
.seo-button-secondary {
  padding: 13px 22px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--neutral-200);
  color: var(--neutral-700);
  font-weight: 700;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .welcome-body { grid-template-columns: 1fr; }
  .result-stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .home-cards { grid-template-columns: 1fr; }
  .welcome-header, .welcome-body { padding-left: 24px; padding-right: 24px; }
  .exam-size-grid { grid-template-columns: repeat(2, 1fr); }
  .result-hero .back-home-btn { position: static; display: inline-block; margin-bottom: 14px; }
  .fact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .exam-topbar, .exam-progress { padding-left: 14px; padding-right: 14px; }
  .exam-content { padding-left: 12px; padding-right: 12px; }
  .question-card { padding: 22px 18px; }
  .result-actions { flex-direction: column; }
  .result-actions .btn-secondary { width: 100%; }
}
