:root {
  --navy: #0f1f3d;
  --navy-mid: #1a3560;
  --navy-light: #2a4a8a;
  --gold: #c8972a;
  --gold-light: #e8b84b;
  --gold-pale: #fdf3de;
  --red: #c0392b;
  --red-pale: #fdecea;
  --green: #1a7a4a;
  --green-pale: #eaf7f0;
  --amber: #c07a1a;
  --amber-pale: #fef6e6;
  --white: #ffffff;
  --off-white: #f7f5f0;
  --border: #ddd8cc;
  --text: #1a1a2e;
  --muted: #6b6b85;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
}

/* HEADER */
header {
  background: var(--navy);
  padding: 0;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 360px; height: 360px;
  border: 60px solid rgba(200,151,42,0.12);
  border-radius: 50%;
}
header::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -120px;
  width: 240px; height: 240px;
  border: 40px solid rgba(200,151,42,0.07);
  border-radius: 50%;
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 40px;
  position: relative;
  z-index: 1;
}
.header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(200,151,42,0.15);
  border: 1px solid rgba(200,151,42,0.3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 20px;
}
header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(28px, 4vw, 42px);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 14px;
  font-weight: 400;
}
header h1 em {
  color: var(--gold-light);
  font-style: italic;
}
header p {
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  line-height: 1.6;
  max-width: 560px;
  font-weight: 300;
}

/* PROGRESS BAR */
.progress-bar-wrap {
  background: var(--navy-mid);
  padding: 0 32px;
}
.progress-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}
.progress-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  font-weight: 500;
  min-width: 80px;
  text-align: right;
}

/* MAIN */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

/* SECTION CARD */
.section-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
  display: none;
  animation: fadeUp 0.35s ease;
}
.section-card.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  background: var(--navy);
  padding: 24px 28px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.section-num {
  background: var(--gold);
  color: var(--navy);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.section-header-text h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: #fff;
  font-weight: 400;
  margin-bottom: 4px;
}
.section-header-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  font-weight: 300;
}
.section-header-text .law-ref {
  display: inline-block;
  background: rgba(200,151,42,0.2);
  color: var(--gold-light);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: 0.05em;
}

.section-body { padding: 28px; }

/* QUESTION */
.question-block {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.question-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.question-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
}
.question-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
  font-weight: 300;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  user-select: none;
}
.radio-option:hover { border-color: var(--navy-light); background: #f5f8ff; }
.radio-option.selected {
  border-color: var(--navy);
  background: #eef2fb;
  font-weight: 500;
}
.radio-option.selected-yes { border-color: var(--green); background: var(--green-pale); }
.radio-option.selected-no { border-color: var(--red); background: var(--red-pale); }
.radio-option.selected-partial { border-color: var(--amber); background: var(--amber-pale); }
.radio-option.selected-na { border-color: var(--muted); background: #f5f5f8; }

.radio-dot {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.radio-option.selected .radio-dot,
.radio-option.selected-yes .radio-dot { border-color: var(--green); }
.radio-option.selected-no .radio-dot { border-color: var(--red); }
.radio-option.selected-partial .radio-dot { border-color: var(--amber); }
.radio-option.selected-na .radio-dot { border-color: var(--muted); }
.radio-dot-inner {
  width: 8px; height: 8px; border-radius: 50%;
  display: none;
}
.radio-option.selected .radio-dot-inner,
.radio-option.selected-yes .radio-dot-inner { display: block; background: var(--green); }
.radio-option.selected-no .radio-dot-inner { display: block; background: var(--red); }
.radio-option.selected-partial .radio-dot-inner { display: block; background: var(--amber); }
.radio-option.selected-na .radio-dot-inner { display: block; background: var(--muted); }

/* NAV BUTTONS */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
}
.btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--navy); }
.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* SCOPE GATE */
#scopeGate {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 36px;
  text-align: center;
  display: none;
}
#scopeGate.active { display: block; animation: fadeUp 0.35s ease; }
#scopeGate h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  margin-bottom: 12px;
  font-weight: 400;
}
#scopeGate p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 24px;
  font-weight: 300;
}

/* RESULT */
#resultSection {
  display: none;
  animation: fadeUp 0.35s ease;
}
#resultSection.active { display: block; }

.result-hero {
  background: var(--navy);
  border-radius: 16px;
  padding: 40px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.result-hero::before {
  content: '';
  position: absolute;
  left: -60px; top: -60px;
  width: 280px; height: 280px;
  border: 50px solid rgba(200,151,42,0.1);
  border-radius: 50%;
}
.result-hero h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: #fff;
  font-weight: 400;
  margin-bottom: 8px;
  position: relative;
}
.result-hero p {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin-bottom: 28px;
  font-weight: 300;
  position: relative;
}
.score-ring-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
}
.score-ring {
  width: 140px; height: 140px;
  position: relative;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring-number {
  position: absolute;
  inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 38px;
  color: #fff;
  line-height: 1;
}
.score-ring-number span { font-size: 14px; color: rgba(255,255,255,0.5); font-family: 'DM Sans', sans-serif; font-weight: 300; }

.score-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}
.score-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 400;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

/* GAP CARDS */
.gap-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.gap-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.gap-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.gap-card-header:hover { background: #fafafa; }
.gap-status-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.status-red .gap-status-icon { background: var(--red-pale); }
.status-amber .gap-status-icon { background: var(--amber-pale); }
.status-green .gap-status-icon { background: var(--green-pale); }
.status-na .gap-status-icon { background: #f0f0f5; }

.gap-card-title {
  flex: 1;
}
.gap-card-title h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.gap-card-title .gap-subtitle {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}
.gap-chip {
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip-red { background: var(--red-pale); color: var(--red); }
.chip-amber { background: var(--amber-pale); color: var(--amber); }
.chip-green { background: var(--green-pale); color: var(--green); }
.chip-na { background: #f0f0f5; color: var(--muted); }

.chevron { font-size: 12px; color: var(--muted); transition: transform 0.2s; }
.gap-card.open .chevron { transform: rotate(180deg); }

.gap-card-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}
.gap-card.open .gap-card-body { display: block; }

.gap-findings {
  margin-top: 14px;
  margin-bottom: 14px;
}
.gap-finding-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  border-bottom: 1px solid #f0f0f0;
}
.gap-finding-item:last-child { border-bottom: none; }
.finding-icon { font-size: 14px; margin-top: 1px; flex-shrink: 0; }

.recommendations-box {
  background: #f7f9ff;
  border: 1px solid #d5dcf0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.recommendations-box h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.rec-item {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 7px;
  line-height: 1.5;
  font-weight: 300;
}
.rec-item:last-child { margin-bottom: 0; }
.rec-arrow { color: var(--navy); font-weight: 700; flex-shrink: 0; }

/* PRINT BUTTON */
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* DISCLAIMER */
.disclaimer {
  background: var(--gold-pale);
  border: 1px solid rgba(200,151,42,0.3);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 12.5px;
  color: #7a5c10;
  line-height: 1.6;
  margin-top: 24px;
  font-weight: 300;
}
.disclaimer strong { font-weight: 600; }

/* WELCOME */
#welcomeSection {
  display: block;
  animation: fadeUp 0.35s ease;
}
.welcome-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 40px;
  text-align: center;
}
.welcome-icon { font-size: 48px; margin-bottom: 20px; }
.welcome-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--text);
}
.welcome-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 28px;
  font-weight: 300;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  text-align: left;
}
.info-tile {
  background: var(--off-white);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border);
}
.info-tile-num {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 4px;
}
.info-tile-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.4;
}

@media print {
  header, .progress-bar-wrap, .nav-buttons, .result-actions { display: none !important; }
  body { background: #fff; }
  .gap-card-body { display: block !important; }
  #resultSection { display: block !important; }
  .gap-card { break-inside: avoid; }
}

@media (max-width: 600px) {
  main { padding: 24px 16px 60px; }
  .header-inner { padding: 32px 16px 28px; }
  .section-body { padding: 20px; }
  .welcome-card { padding: 28px 20px; }
}
