/* StillAdvisory — Nonprofit Executive Management Assessment
   Brand tokens pulled from the StillAdvisory / STER Analytics landing page. */
:root {
  --navy: #0b2343;
  --navy-deep: #071225;
  --navy-2: #172033;
  --gold: #d6a642;
  --gold-light: #f1c76b;
  --gold-dark: #a87314;
  --cream: #fffaf0;
  --paper: #f7f8fb;
  --line: #e7e9ee;
  --line-2: #d9e0ea;
  --ink: #172033;
  --muted: #5b6678;
  --muted-2: #8fa0b7;
  --green: #1b7f5f;
  --risk-high: #c0392b;
  --risk-med: #b98518;
  --risk-low: #1b7f5f;
  --shadow: 0 10px 40px rgba(7, 18, 37, 0.10);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: "Playfair Display", Georgia, serif; font-weight: 800; color: var(--navy); line-height: 1.15; }
a { color: var(--gold-dark); }

/* ---- Header ---- */
.site-header {
  background: var(--navy);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(214,166,66,0.35);
}
.site-header .brand { display: flex; align-items: center; gap: 12px; }
.site-header img { height: 34px; width: auto; display: block; }
.site-header img.logo-print { display: none; }   /* dark logo: only in the printed PDF */
.site-header .tagline { color: var(--gold-light); font-size: 12.5px; letter-spacing: .04em; }
.site-header .header-cta {
  color: var(--navy); background: var(--gold); border: none; border-radius: 8px;
  padding: 9px 16px; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none;
}
.site-header .header-cta:hover { background: var(--gold-light); }

/* ---- Layout ---- */
.wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px 80px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px;
}
.eyebrow { color: var(--gold-dark); font-weight: 700; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: 16px; max-width: 60ch; }

/* ---- Hero / intro ---- */
.hero { text-align: center; padding: 30px 0 6px; }
.hero h1 { font-size: clamp(28px, 4.5vw, 44px); margin: 10px 0 8px; }
.hero .gold { color: var(--gold-dark); }
.hero .eyebrow { font-size: 16px; letter-spacing: .04em; }
.hero .sub { color: var(--muted); font-size: 17px; max-width: 64ch; margin: 0 auto 20px; }
.pillrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 6px; }
.pill { background: var(--cream); border: 1px solid var(--line-2); color: var(--navy-2); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  border-radius: 10px; padding: 13px 22px; font-weight: 700; font-size: 15px; font-family: inherit; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line-2); }
.btn-ghost:hover { background: var(--paper); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.spacer { flex: 1; }

/* ---- Forms ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; color: var(--navy-2); margin-bottom: 6px; }
.field .req { color: var(--risk-high); }
.field input, .field select {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line-2); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,166,66,0.2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }
.err { color: var(--risk-high); font-size: 12.5px; margin-top: 6px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--risk-high); }

/* ---- Progress ---- */
.progress { position: sticky; top: 62px; z-index: 20; background: var(--paper); padding: 14px 0 10px; }
.progress .bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .35s ease; }
.progress .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 7px; }

/* ---- Assessment ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.section-head h2 { font-size: 24px; margin: 0; }
.section-head .count { color: var(--muted-2); font-size: 13px; font-weight: 600; }
.q { border-top: 1px solid var(--line); padding: 20px 0; }
.q:first-of-type { border-top: none; }
.q .qtext { font-weight: 600; color: var(--navy-2); font-size: 16px; }
.q .qstd { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.q .wtag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--gold-dark);
  background: var(--cream); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
@media (max-width: 620px) { .scale { grid-template-columns: repeat(5, 1fr); gap: 5px; } }
.scale .opt { position: relative; }
.scale .opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.scale .opt label {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 6px; background: #fff; text-align: center;
}
.scale .opt label { justify-content: center; min-height: 52px; }
.scale .opt .lab { font-size: 12px; font-weight: 700; color: var(--navy); line-height: 1.25; }
.scale .opt input:checked + label { border-color: var(--navy); background: var(--cream); box-shadow: 0 0 0 2px rgba(11,35,67,.25); }
.scale .opt input:focus-visible + label { box-shadow: 0 0 0 3px rgba(214,166,66,.4); }

/* ---- Results ---- */
.score-hero { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.gauge { --pct: 0; width: 168px; height: 168px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--line) 0);
  display: grid; place-items: center; position: relative; }
.gauge::before { content: ""; position: absolute; inset: 14px; background: #fff; border-radius: 50%; }
.gauge .inner { position: relative; text-align: center; }
.gauge .num { font-family: "Playfair Display", serif; font-weight: 900; font-size: 44px; color: var(--navy); line-height: 1; }
.gauge .of { font-size: 12px; color: var(--muted); }
.band { font-family: "Playfair Display", serif; font-weight: 800; font-size: 22px; }
.band-action { color: var(--muted); margin-top: 4px; max-width: 46ch; }
.catbars { margin-top: 26px; }
.catbar { display: grid; grid-template-columns: 200px 1fr 44px; gap: 12px; align-items: center; padding: 7px 0; }
@media (max-width: 620px) { .catbar { grid-template-columns: 130px 1fr 38px; } }
.catbar .name { font-size: 13.5px; font-weight: 600; color: var(--navy-2); }
.catbar .track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.catbar .track > span { display: block; height: 100%; border-radius: 999px; }
.catbar .val { text-align: right; font-weight: 700; font-size: 13px; }
.riskdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.note { background: var(--cream); border: 1px solid var(--line-2); border-left: 4px solid var(--gold); border-radius: 10px; padding: 16px 18px; margin-top: 24px; color: var(--navy-2); }
.demo-cta { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 26px; margin-top: 22px; text-align: center; }
.demo-cta h3 { color: #fff; margin: 0 0 6px; }
.demo-cta p { color: #cdd5e1; margin: 0 0 16px; }

.privacy { display: flex; gap: 10px; align-items: flex-start; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 18px 0 2px;
  font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.privacy .lock { font-size: 15px; line-height: 1.3; flex: none; }
.privacy strong { color: var(--navy-2); }
.privacy a { color: var(--gold-dark); font-weight: 600; }

.hidden { display: none !important; }
.footer { text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 28px 20px; }

/* ---- Methodology button + modal ---- */
.methodology-bar { margin: 4px 0 14px; }
.btn-methodology {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: #fff; color: var(--navy); border: 1px solid var(--gold);
  border-radius: 10px; padding: 14px 20px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(214,166,66,0.12);
  text-align: left; line-height: 1.3;
}
.btn-methodology:hover { background: var(--cream); border-color: var(--gold-dark); }
.btn-methodology .info-glyph { color: var(--gold-dark); font-size: 19px; line-height: 1; flex: none; margin-top: 1px; }
.btn-methodology-text { display: flex; flex-direction: column; gap: 3px; }
.btn-methodology-title { color: var(--navy); }
.btn-methodology-hint { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 0; }
@media (max-width: 620px) {
  .btn-methodology { font-size: 12.5px; padding: 10px 14px; }
  .btn-methodology-hint { font-size: 11.5px; }
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(7, 18, 37, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 1000; backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 820px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(7,18,37,0.45); overflow: hidden;
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 28px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf6 0%, #fff 100%);
}
.modal-head .eyebrow { font-size: 11.5px; }
.modal-head h2 { font-size: 22px; line-height: 1.2; }
.modal-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.modal-action {
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}
.modal-action:hover { background: var(--navy-2); }
.modal-action span { color: var(--gold); font-size: 14px; line-height: 1; }
.modal-close {
  background: transparent; border: none; cursor: pointer; font-size: 28px; line-height: 1;
  color: var(--muted); padding: 2px 8px; border-radius: 6px; flex: none;
}
.modal-close:hover { background: var(--paper); color: var(--navy); }
@media (max-width: 620px) {
  .modal-action { font-size: 12px; padding: 7px 10px; }
}
.modal-body {
  padding: 22px 28px 28px; overflow-y: auto; color: var(--ink); font-size: 14.5px; line-height: 1.65;
}
.modal-loading { color: var(--muted); display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.modal-foot {
  flex: none; padding: 16px 28px; border-top: 1px solid var(--line);
  background: linear-gradient(0deg, #fffdf6 0%, #fff 100%);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.modal-foot .gate-hint { font-size: 12.5px; color: var(--muted); }
.modal-foot .gate-hint.ready { color: var(--green); font-weight: 600; }
@media (max-width: 620px) {
  .modal-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 18px; }
  .modal-foot .btn { justify-content: center; }
}

/* Non-scored options (Not Applicable / I Don't Know / Prefer Not to Respond) —
   a row of 3 clear, clickable gold buttons below the 1-5 scale, every question. */
.non-scored { margin-top: 10px; }
.non-scored .hint { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.scale-na { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 620px) { .scale-na { grid-template-columns: 1fr; } }
.scale-na .opt-na { position: relative; }
.scale-na .opt-na input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.scale-na .opt-na label {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; padding: 10px 12px; border-radius: 10px; text-align: center;
  border: 1.5px solid var(--gold); background: var(--cream); transition: background .15s ease, box-shadow .15s ease;
}
.scale-na .opt-na label:hover { background: #fff2d6; box-shadow: 0 0 0 3px rgba(214,166,66,.2); }
.scale-na .radio-dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none; border: 2px solid var(--gold-dark); background: #fff;
  transition: background .15s ease, box-shadow .15s ease;
}
.scale-na .opt-na input:checked + label .radio-dot { background: var(--gold-dark); box-shadow: inset 0 0 0 3px #fff; }
.scale-na .lab { font-size: 12px; color: var(--navy-2); }
.scale-na .opt-na input:checked + label { border-color: var(--gold-dark); background: var(--cream); box-shadow: 0 0 0 3px rgba(214,166,66,.35); }

/* Markdown rendering inside the modal */
.modal-body h1 { font-size: 22px; margin: 0 0 6px; }
.modal-body h2 { font-size: 17px; margin: 26px 0 8px; color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.modal-body h3 { font-size: 15px; margin: 20px 0 6px; color: var(--gold-dark); font-family: Inter, sans-serif; font-weight: 800; letter-spacing: 0.01em; }
.modal-body p { margin: 0 0 12px; }
.modal-body ul { margin: 0 0 14px; padding-left: 22px; }
.modal-body li { margin: 3px 0; }
.modal-body strong { color: var(--navy-2); }
.modal-body blockquote {
  margin: 12px 0; padding: 12px 16px; border-left: 4px solid var(--gold);
  background: var(--cream); border-radius: 0 8px 8px 0; color: var(--navy-2);
}
.modal-body blockquote p { margin: 0; }
.modal-body hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.modal-body code { background: var(--cream); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.modal-body table { width: 100%; border-collapse: collapse; margin: 4px 0 16px; font-size: 13.5px; }
.modal-body th, .modal-body td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.modal-body th { color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--line-2); }
.modal-body tr:last-child td { font-weight: 700; color: var(--navy); }
@media (max-width: 620px) {
  .modal-backdrop { padding: 12px; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-head h2 { font-size: 18px; }
}

/* ---- Report actions (results page) + report modal (respondent's own view) ---- */
.report-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
#oehsReport .report-head { margin-bottom: 18px; }
#oehsReport .report-head h2 { font-size: 26px; }
.report-fields { font-size: 13.5px; line-height: 1.75; }
.report-fields .k { font-weight: 700; color: var(--navy); margin-right: 5px; }
.report-fields .v { color: var(--navy-2); }

.report-detail { margin-top: 28px; }
.report-cat-head {
  font-family: "Playfair Display", serif; font-weight: 800; font-size: 15px; color: var(--navy);
  margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--line);
}
.report-cat-head:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.report-q { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.report-q:last-child { border-bottom: none; }
.report-q-text { font-size: 13.5px; color: var(--navy-2); }
.report-q-ans { font-size: 12.5px; font-weight: 700; white-space: nowrap; flex: none; }

/* ---- Print (native browser Ctrl+P) — unrelated to the report modal above ---- */
@media print {
  /* Everything the lead sees is dropped when printing the page directly. */
  #intro, #assessment, #results, .footer,
  .site-header .header-cta { display: none !important; }

  /* Header keeps its layout; logo swaps to the blue one. */
  .site-header { position: static; box-shadow: none; }
  .logo-screen { display: none !important; }
  .logo-print { display: block !important; }

  /* Let the brand colors (gauge ring, bars) render in the PDF. */
  .gauge, .catbar .track > span, .gauge::before, .riskdot {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  @page { margin: 12mm; size: Letter; }
}
.spin { width: 18px; height: 18px; border: 2px solid rgba(11,35,67,.25); border-top-color: var(--navy); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
