:root {
  --navy: #0b1e3d;
  --navy-light: #1a3460;
  --gold: #c9a84c;
  --gold-light: #e2c47a;
  --gold-dim: #8a6d2f;
  --ink: #1b2433;
  --muted: #5b6577;
  --line: #dde1e8;
  --paper: #f6f4ef;
  --card: #ffffff;
  --error: #a8322d;
  --radius: 10px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--navy); border-bottom: 3px solid var(--gold); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border: 1.5px solid var(--gold); border-radius: 6px;
  display: grid; place-items: center; color: var(--gold);
  font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 24px; color: #fff; }
.brand-sub { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-light); }
.tagline { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-light); }

/* Intro */
.intro { padding: 36px 0 12px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; }
h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 6vw, 42px); line-height: 1.1; color: var(--navy); margin: 0 0 14px; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 28px; color: var(--navy); margin: 0 0 6px; line-height: 1.15; }
h3 { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--navy); margin: 0; }
.lede { margin: 0 0 10px; font-size: 18px; max-width: 680px; }
.privacy-note { margin: 0; font-size: 14px; color: var(--muted); }

/* Progress */
.progress { margin: 20px 0 18px; }
.progress-steps { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.progress-steps span { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-steps span.active { color: var(--navy); font-weight: 700; }
.progress-steps span.done { color: var(--gold-dim); }
.progress-track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--gold); transition: width .3s ease; }

/* Steps */
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.step-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.step-count { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-dim); font-weight: 700; margin: 0 0 4px; }
.step-intro { margin: 6px 0 0; color: var(--muted); }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .req { color: var(--gold-dim); }
.field input, .field select {
  width: 100%; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid #c4cad4; border-radius: 6px; background: #fff;
}
.field input:focus, .field select:focus, .option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.field.invalid input, .field.invalid select { border-color: var(--error); }

fieldset.question { border: 0; margin: 0 0 26px; padding: 0; }
fieldset.question:last-child { margin-bottom: 0; }
.question legend { font-weight: 600; font-size: 17px; margin-bottom: 10px; padding: 0; }
.question legend .qnum { color: var(--gold-dim); margin-right: 6px; }
.question.invalid legend { color: var(--error); }
.options { display: grid; gap: 8px; }
.option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--gold); }
.option input { margin: 4px 0 0; accent-color: var(--navy); flex-shrink: 0; }
.option.selected { border-color: var(--navy); background: #f1f4f9; }
.option.unsure span { color: var(--muted); }

.form-error { color: var(--error); font-weight: 600; margin: 14px 0 0; }
.form-nav { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0 48px; }

.btn { font: inherit; font-weight: 700; font-size: 16px; padding: 12px 22px; border-radius: 6px; cursor: pointer; border: 1.5px solid var(--navy); min-height: 46px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: #e9ecf2; }
.btn[hidden] { display: none; }
.btn:disabled { opacity: .6; cursor: wait; }

/* Results */
.results { margin: 8px 0 48px; }
.results-head { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 28px 24px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.results-head h2 { color: #fff; }
.results-head .meta { color: #c3cbd8; font-size: 14px; margin: 0 0 12px; }
.score-ring { --pct: 0; --band: var(--gold); width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--band) calc(var(--pct) * 3.6deg), rgba(255,255,255,.12) 0); display: grid; place-items: center; }
.score-ring-inner { width: 118px; height: 118px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; text-align: center; }
.score-num { font-family: var(--serif); font-size: 50px; font-weight: 700; line-height: 1; }
.score-of { font-size: 12px; color: #c3cbd8; letter-spacing: .08em; }
.band-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.results-head p.summary { margin: 12px 0 0; color: #e4e8ef; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-top: 18px; }
.card > h3 { margin-bottom: 14px; }

.pillar-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 64px; gap: 14px; align-items: center; padding: 8px 0; }
.pillar-row + .pillar-row { border-top: 1px solid #eef0f4; }
.pillar-name { font-weight: 600; }
.bar { height: 10px; background: #e9ecf2; border-radius: 5px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 5px; }
.pillar-score { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pillar-score small { color: var(--muted); font-weight: 400; }

.pillar-detail + .pillar-detail { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.pillar-detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.pillar-detail p { margin: 0 0 8px; }
.flags { margin: 8px 0 0; padding-left: 20px; }
.flags li { margin-bottom: 6px; }
.flags li::marker { color: var(--gold-dim); }
.muted { color: var(--muted); font-size: 15px; }

.profile-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.profile-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 0; width: 42%; vertical-align: top; }
.profile-table td { padding: 6px 0; }
.profile-table tr + tr th, .profile-table tr + tr td { border-top: 1px solid #eef0f4; }

.next-step { border-left: 4px solid var(--gold); }
.next-step a { color: var(--navy); font-weight: 700; }
.disclaimer { font-size: 13px; color: var(--muted); margin-top: 18px; }
.result-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* Footer */
.site-footer { background: var(--navy); color: #c3cbd8; font-size: 14px; padding: 18px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--gold-light); text-decoration: none; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .tagline { display: none; }
  .step { padding: 20px 16px; }
  .profile-grid { grid-template-columns: 1fr; }
  .progress-steps span:not(.active) { display: none; }
  .progress-steps { justify-content: flex-start; }
  .results-head { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 24px 16px; }
  .card { padding: 18px 16px; }
  .pillar-row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .pillar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .form-nav .btn, .result-actions .btn { flex: 1; }
}

/* Browser Save-as-PDF fallback */
@media print {
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .intro, .progress, #assessment, .result-actions { display: none !important; }
  .results-head, .band-pill, .bar > span, .score-ring { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card { break-inside: avoid; }
}

/* Call to action and confirmation */
.cta-card { border-left: 4px solid var(--gold); }
.cta-headline { margin-bottom: 16px !important; font-size: 24px; line-height: 1.2; }
.cta-btn { display: inline-block; text-decoration: none; }
.cta-note { margin: 12px 0 0; font-size: 13px; font-style: italic; color: var(--muted); }
.confirmation { margin: 36px 0 48px; }
.confirm-card { padding: 32px 28px; border-top: 4px solid var(--gold); }
.confirm-card h2 { margin-bottom: 10px; }
.confirm-card .btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) { .cta-btn { display: block; text-align: center; } }

/* Lead gate */
.field-msg { margin: 4px 0 0; font-size: 13px; color: var(--error); min-height: 0; }
.field-msg:empty { display: none; }
.privacy-line { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.privacy-line a { color: var(--navy); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
a.btn { text-decoration: none; }
.btn-sm { font-size: 14px; padding: 7px 14px; min-height: 36px; }

/* Facilitator view */
#facPanel { margin-top: 18px; }
.fac-bar, .fac-login { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #fff7e0; border: 1px solid var(--gold); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.fac-bar span { color: var(--muted); flex: 1; min-width: 200px; }
.fac-login input { font: inherit; padding: 7px 10px; border: 1px solid #c4cad4; border-radius: 6px; min-width: 200px; flex: 1; }
.fac-msg { color: var(--error); font-weight: 600; }
.fac-pts { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; align-self: center; }
.fac-tally { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--gold-dim); }
