/* Divorce Right quiz. Mobile first; brand blue + leaf green from the logo,
   deepened for text and buttons so contrast stays above WCAG AA. */
:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --ink: #22302f;
  --muted: #5d6b69;
  --line: #d9e0dc;
  --blue: #2f6f7f;          /* deep logo blue: buttons, links */
  --blue-soft: #a9d6df;     /* logo blue: accents */
  --green: #5b7a12;         /* deep leaf green */
  --green-soft: #b6cf3c;    /* logo leaf green: accents */
  --track: #e6ece9;
  --warn-bg: #f7f3e8;
  --warn-line: #b07a1e;
  --safety-bg: #fff4e5;
  --safety-line: #b4561b;
  --focus: #1b5fd1;
  --radius: 14px;
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a19; --surface: #1d2524; --ink: #e8eeec; --muted: #a7b4b1; --line: #33403e;
    --blue: #7cc4d3; --green: #b6cf3c; --track: #2b3634;
    --warn-bg: #2a2619; --warn-line: #d9a441; --safety-bg: #2e2117; --safety-line: #e58a52; --focus: #8ab4ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; }
main:focus { outline: none; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
p { margin: 0 0 14px; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
/* Headings and regions get focus only so screen readers land on new content. */
[tabindex="-1"]:focus { outline: none; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.site-header { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 8px; }
.brand { font-family: var(--serif); font-size: 1.3rem; text-decoration: none; }
.brand-a { color: var(--blue); }
.brand-b { color: var(--green); }
.site-footer { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; font-size: .85rem; color: var(--muted); }
.site-footer p { margin: 0 0 6px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 22px 20px; margin: 0 0 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.eyebrow { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); font-weight: 700; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Buttons: 56px tall minimum for thumbs. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 12px 22px; border-radius: 12px; border: 2px solid transparent;
  background: var(--blue); color: #fff; font: 700 1.05rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; width: 100%;
}
@media (prefers-color-scheme: dark) { .btn { color: #0f1716; } }
.btn:hover { filter: brightness(1.07); }
.btn-green { background: var(--green); }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--line); }
.btn-link { background: none; border: 0; color: var(--blue); font: 600 1rem var(--sans); padding: 12px 4px; min-height: 48px; cursor: pointer; text-decoration: underline; }
.btn[disabled] { opacity: .6; cursor: wait; }
.stack > * + * { margin-top: 12px; }

/* Intro */
.intro h1 { font-size: 2rem; }
.intro .promise { font-size: 1.15rem; }
.intro-h { font-size: 1.05rem; margin: 20px 0 6px; }
.checks { list-style: none; padding: 0; margin: 0 0 14px; }
.checks li { position: relative; padding-left: 28px; margin: 0 0 8px; }
.checks li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg); }
.intro .meta-line { margin-top: 20px; align-items: flex-start; }
.intro .meta-line .dot { margin-top: .5em; flex: none; }
.meta-line { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .95rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-soft); display: inline-block; }

/* Question screen */
.progress { margin: 4px 0 18px; }
.progress-top { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.progress-track { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue-soft), var(--blue)); border-radius: 99px; transition: width .25s ease; }
.question h2 { font-size: 1.35rem; margin-bottom: 18px; }
.question h2:focus { outline: none; }
.helper { color: var(--muted); font-size: .95rem; margin: -8px 0 16px; }
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer {
  text-align: left; width: 100%; min-height: 56px; padding: 14px 16px;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-radius: 12px;
  font: 400 1.02rem/1.4 var(--sans); cursor: pointer;
}
.answer:hover { border-color: var(--blue-soft); }
.answer[aria-pressed="true"] { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); font-weight: 600; }
.q-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* Result */
.safety { background: var(--safety-bg); border: 2px solid var(--safety-line); border-radius: var(--radius); padding: 18px 18px; margin: 0 0 16px; font-size: 1.05rem; }
.safety p { margin: 0 0 8px; }
.safety p:last-child { margin: 0; }
.safety a { font-weight: 700; }
.art { width: 132px; height: 132px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; color: #fff; font: 700 3rem var(--serif); overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.result-hero { text-align: center; }
.result-hero h1 { font-size: 2.2rem; margin-bottom: 6px; }
.result-hero .headline { font-size: 1.1rem; }
.blend { margin: 6px 0 0; padding: 0; list-style: none; }
.blend li { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: 10px; margin: 0 0 8px; font-size: .95rem; }
.blend .bar { height: 12px; background: var(--track); border-radius: 99px; overflow: hidden; }
.blend .bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.blend .pct { text-align: right; font-variant-numeric: tabular-nums; }
.warning { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 12px 14px; border-radius: 6px; margin: 4px 0 0; }

/* Forms */
.field { margin: 0 0 14px; }
.field label, .field legend { display: block; font-weight: 600; margin: 0 0 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea, .field select {
  width: 100%; min-height: 52px; padding: 12px 14px; font: 1rem var(--sans);
  border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.field .err { color: #b3261e; font-size: .9rem; margin: 6px 0 0; }
@media (prefers-color-scheme: dark) { .field .err { color: #ff8a80; } }
.field [aria-invalid="true"] { border-color: #b3261e; }
fieldset.field { border: 0; padding: 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; margin: 0 0 8px; cursor: pointer; min-height: 52px; }
.field label.choice { display: flex; font-weight: 400; margin: 0 0 8px; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); }
.row-3 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 520px) { .row-3 { grid-template-columns: 2fr 1fr 1.2fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 10px 0 0; font-weight: 600; }
.success { border-left: 4px solid var(--green); padding-left: 14px; }

/* Share modal */
dialog { border: 0; border-radius: var(--radius); padding: 20px; max-width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog img { width: 100%; height: auto; border-radius: 10px; display: block; margin: 0 0 12px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
