/* AI Portfolio Management Survey: respondent-facing styles.
   Mobile first, max width 720px, 16px gutters, light and dark themes. */

:root {
  --ink: #0E0E10;
  --bg: #FFFFFF;
  --accent: #2456E0;
  --accent-ink: #2456E0;
  --accent-soft: #EAF0FD;
  --accent-track: #C9D6F7;
  --muted: #5C5C63;
  --rule: #E4E4E7;
  --panel: #F5F5F7;
  --danger: #B42318;
  --danger-soft: #FCEBEA;
  --ok: #1A7F4B;
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(14, 14, 16, 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F2F2F4;
    --bg: #0E0E10;
    --accent: #2456E0;
    --accent-ink: #8FA9F5;
    --accent-soft: #171F3A;
    --accent-track: #2B3A6B;
    --muted: #A1A1AA;
    --rule: #2A2A30;
    --panel: #17171B;
    --danger: #F28B82;
    --danger-soft: #3A1715;
    --ok: #6CCB95;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  --ink: #F2F2F4;
  --bg: #0E0E10;
  --accent: #2456E0;
  --accent-ink: #8FA9F5;
  --accent-soft: #171F3A;
  --accent-track: #2B3A6B;
  --muted: #A1A1AA;
  --rule: #2A2A30;
  --panel: #17171B;
  --danger: #F28B82;
  --danger-soft: #3A1715;
  --ok: #6CCB95;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

.lead { font-size: 20px; line-height: 1.45; font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Layout */

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  padding: 20px 0 8px;
}

.site-footer {
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--rule);
  margin-top: 40px;
}
.site-footer a { color: inherit; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.kicker.accent { color: var(--accent-ink); }

.screen { padding: 8px 0 24px; }
.screen > h1:focus, .screen > h2:focus, .question h2:focus, [tabindex="-1"]:focus { outline: none; }
.focus-ring:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Panels */

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 20px;
}
.panel.intro {
  border-left: 3px solid var(--accent);
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
.panel.insight {
  background: var(--accent-soft);
  border: 1px solid var(--accent-track);
}
.panel.saved {
  background: var(--panel);
}
.panel.note { font-size: 15px; color: var(--muted); }
.panel.error { background: var(--danger-soft); color: var(--danger); }
.panel.resume { border: 1px solid var(--rule); background: transparent; }

/* Forms */

.field { margin: 0 0 20px; }
.field label, .field .label {
  display: block;
  font-weight: 600;
  margin: 0 0 6px;
}
.field .hint { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.field .error-text { color: var(--danger); font-size: 15px; margin: 6px 0 0; }

input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  min-height: var(--tap);
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.check, .field .check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  margin: 0 0 8px;
  cursor: pointer;
  background: var(--bg);
}
.check:hover { border-color: var(--muted); }
.check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}
.check.is-checked { border-color: var(--accent); background: var(--accent-soft); }
.check:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.btn:hover { background: #1E4AC4; border-color: #1E4AC4; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn.secondary {
  background: transparent;
  color: var(--accent-ink);
  border-color: var(--accent-track);
}
.btn.secondary:hover { background: var(--accent-soft); }

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-weight: 500;
  padding-left: 8px;
  padding-right: 8px;
}
.btn.ghost:hover { color: var(--ink); background: var(--panel); }

.btn.link {
  background: none;
  border: none;
  color: var(--accent-ink);
  text-decoration: underline;
  padding: 0;
  min-height: 0;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}
.actions.stack { flex-direction: column; align-items: stretch; }
.actions.stack .btn { width: 100%; }

/* Progress */

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 8px 0 8px;
}
.progress-head .kicker { margin: 0; }
.progress-head .mins { font-size: 13px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.02em; white-space: nowrap; }
.progress {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 0 24px;
}
.progress .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 240ms ease;
}
.progress-tools { display: flex; justify-content: flex-end; margin: -16px 0 16px; }

/* Questions */

.question { margin: 0 0 28px; }
.question h2 { font-size: 21px; font-weight: 500; margin-bottom: 16px; }
.question .stem-note { color: var(--muted); font-size: 15px; margin: -8px 0 14px; }
.pair .question + .question { padding-top: 24px; border-top: 1px solid var(--rule); }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: block;
  width: 100%;
  min-height: 52px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.choice:hover { border-color: var(--muted); }
.choice:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.choice.is-selected, .choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choices.is-locked .choice, .strip.is-locked .choice, .choice[disabled] { cursor: default; }
.choices.is-locked .choice:not(.is-selected), .strip.is-locked .choice:not(.is-selected) { opacity: 0.6; }

.other-box { margin-top: 12px; }

.strip {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}
.strip.scale { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.strip.likert { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.strip .choice {
  min-height: 48px;
  padding: 8px 2px;
  text-align: center;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.strip .choice .sub {
  display: none;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
}
@media (min-width: 600px) {
  .strip.likert .choice .sub { display: block; }
  .strip.likert .choice { min-height: 64px; padding: 8px 4px; }
}
.anchors {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.picked { font-size: 15px; color: var(--muted); min-height: 1.5em; margin: 0 0 8px; }
.picked strong { color: var(--ink); font-weight: 600; }

.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }

/* Invite panel */

.invite .emails { display: grid; gap: 8px; margin: 0 0 12px; }
.invite .result { margin-top: 12px; font-size: 15px; }
.invite .result ul { margin: 6px 0 0; padding-left: 20px; }
.share-text { margin-top: 12px; }
.share-text blockquote {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 4px;
  font-size: 15px;
}
.copy-fallback { margin-top: 8px; }

/* Level cards on confirmation screens */

.level-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
.level-card h3 { margin-bottom: 4px; }
.level-card p { margin: 0 0 12px; color: var(--muted); }

/* Finale */

.finale .question { padding: 20px 0; border-top: 1px solid var(--rule); }
.finale .question:first-of-type { border-top: none; }
.finale .question h2 { font-size: 19px; }

/* Closing */

.closing .panel { font-size: 18px; }

/* Results page */

.profile-head { padding: 12px 0 8px; }
.profile-head h1 { font-size: 28px; }
.hook-line { font-size: 19px; color: var(--muted); }

.dials { display: grid; gap: 14px; margin: 20px 0; }
.dial {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow);
}
.dial .kicker { margin-bottom: 4px; }
.dial .value { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
.dial .sentence { margin: 8px 0 0; }
.dial svg { width: 100%; height: auto; overflow: visible; }
.dial .gauge { margin: 6px 0 2px; }
.dial .scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.02em; }
.dial ul { margin: 8px 0 0; padding-left: 20px; }
.bars { display: grid; gap: 8px; margin: 8px 0 6px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(104px, 38%) 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.bar-row .bar { width: 100%; height: 14px; display: block; }
.bar-row .bar-value { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--muted);
}
.chip.on { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.chip.on .dot { background: var(--accent); }

.compare table, .advanced table { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td, .advanced th, .advanced td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare th, .advanced th { font-weight: 600; font-size: 13px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }

.card-preview { margin: 12px 0; }
.card-preview canvas { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); }

.section { margin: 36px 0 0; }
.section h2 { margin-bottom: 6px; }

/* Static pages */

.doc h2 { margin-top: 32px; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }

/* Utilities */

.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;
}
.hidden { display: none !important; }
.counter { color: var(--muted); font-size: 15px; margin: 0 0 16px; }

@media (min-width: 600px) {
  body { font-size: 18px; }
  h1 { font-size: 34px; }
  .site-header { padding-top: 32px; }
  .screen { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
