:root {
  --bg: #F5EFE0;
  --navy: #14304A;
  --yellow: #E8C463;
  --muted: #6B6356;
  --card: #FFFFFF;
  --border: #E2D9C2;
  --input-bg: #FBF8F0;
  --success: #2E7D4F;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.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;
}

/* Header */
.site-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.wordmark {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--navy);
}

/* Shared bits */
.eyebrow {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 12px;
}

.start-btn {
  padding: 16px 34px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.start-btn:hover { opacity: 0.92; }
.start-btn:active { transform: translateY(1px); box-shadow: none; }

/* ================================================================= */
/* SCREEN 1 · Landing                                                */
/* ================================================================= */
.screen-landing { text-align: center; padding: 40px 0 16px; }
.landing-inner { max-width: 600px; margin: 0 auto; }
.screen-landing h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.08;
  margin: 0 0 16px;
}
.screen-landing .subhead {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  margin: 0 auto 24px;
  max-width: 520px;
}
.landing-systems {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 32px;
  font-family: system-ui, sans-serif;
}
.landing-systems li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.landing-hint {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 0;
}

/* ================================================================= */
/* SCREEN 2 · Quiz                                                   */
/* ================================================================= */
.quiz-inner { max-width: 600px; margin: 0 auto; padding-top: 12px; }
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: system-ui, sans-serif;
  margin-bottom: 14px;
}
.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 4px;
}
.back-btn:hover:not(:disabled) { color: var(--navy); }
.back-btn:disabled { opacity: 0.35; cursor: default; }
.progress {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.progress-track {
  height: 6px;
  background: #E7DEC8;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 40px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--yellow);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.question-lead {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 10px;
}
.question-text {
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
  margin: 0 auto 36px;
  max-width: 540px;
  min-height: 2.4em;
}
.scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  font-family: system-ui, sans-serif;
}
.scale-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.scale-btn:hover { border-color: var(--navy); }
.scale-btn:active { transform: translateY(1px); }
.scale-btn.selected {
  background: var(--yellow);
  border-color: #d8b04f;
}
.scale-num {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.scale-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.scale-btn.selected .scale-label { color: var(--navy); }

/* ================================================================= */
/* SCREEN 3 · Result                                                 */
/* ================================================================= */
.result-inner { max-width: 600px; margin: 0 auto; }
.screen-result { text-align: center; padding-top: 16px; }
.result-title {
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 14px;
}
.winner-name {
  color: var(--navy);
  background: var(--yellow);
  padding: 2px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.result-why {
  font-size: 17px;
  line-height: 1.55;
  color: var(--navy);
  margin: 0 auto 28px;
  max-width: 520px;
}

/* Ranked list */
.ranked {
  text-align: left;
  font-family: system-ui, sans-serif;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rank-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.rank-row.rank-winner {
  border-color: #d8b04f;
  background: #FCF6E6;
}
.rank-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rank-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--navy);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
}
.rank-bar {
  height: 8px;
  background: #EDE4CE;
  border-radius: 999px;
  overflow: hidden;
}
.rank-bar-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 999px;
}
.rank-winner .rank-bar-fill { background: #d8b04f; }
.rank-score {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  min-width: 34px;
}

/* Gate card */
.gate-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}
.gate-title {
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 700;
  margin: 0 0 8px;
}
.gate-sub {
  font-family: system-ui, sans-serif;
  font-size: 15px;
  color: var(--muted);
  margin: 0 auto 20px;
  max-width: 400px;
}
.lead-form {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: system-ui, sans-serif;
}
.lead-form input {
  padding: 13px 14px;
  border: 1px solid #C8BFA8;
  border-radius: 8px;
  font-size: 15px;
  background: var(--input-bg);
  color: var(--navy);
  font-family: inherit;
}
.lead-form input:focus {
  outline: 2px solid var(--yellow);
  outline-offset: 1px;
}
.lead-form button {
  padding: 14px 18px;
  border: none;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}
.lead-form button:disabled { opacity: 0.45; cursor: not-allowed; }
.lead-form button:hover:not(:disabled) { opacity: 0.92; }
.consent {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.4;
}
.form-error {
  font-size: 13px;
  color: #B33;
  margin: 4px 0 0;
}

/* Confirmation card */
.confirmation-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 24px;
}
.confirmation-card .check {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}
.confirmation-card h3 {
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 700;
  margin: 0 0 10px;
}
.confirmation-card p {
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 auto;
  max-width: 420px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 32px 20px 48px;
  font-family: system-ui, sans-serif;
  color: var(--muted);
}
.footer-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.footer-bio {
  font-size: 15px;
  line-height: 1.5;
  color: var(--navy);
  margin: 0 0 16px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin: 0;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--muted); }
.footer-icon { width: 16px; height: 16px; flex-shrink: 0; }
.footer-sep { color: var(--border); }

/* Responsive */
@media (max-width: 520px) {
  .scale { gap: 8px; }
  .scale-btn { padding: 14px 4px; }
  .scale-num { font-size: 22px; }
  .scale-label { font-size: 11px; }
  .rank-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name score"
      "bar  bar";
    gap: 8px 12px;
  }
  .rank-name { grid-area: name; }
  .rank-score { grid-area: score; }
  .rank-bar { grid-area: bar; }
}
