/* Poppins, self hosted (latin subset, SIL Open Font License). Two weights only. */
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/poppins-400.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/poppins-700.woff2") format("woff2");
}
/* Arial sized like Poppins, so text does not jump when the font arrives */
@font-face {
  font-family: "Poppins Fallback"; src: local("Arial"), local("Helvetica");
  size-adjust: 112%; ascent-override: 93.75%; descent-override: 31.25%; line-gap-override: 8.9%;
}

:root {
  --bg: #ffffff;
  --text: #0f1b2d;      /* body and consent text */
  --navy: #0b1a45;      /* headlines, questions, answers */
  --muted: #536079;
  --border: #e1e7f0;
  --border-strong: #c9d3e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --soft: #eef3fd;      /* question card, icon circles, selected answer */
  --danger: #b42318;
  --focus: #1d4ed8;
  --radius: 14px;
  --font: "Poppins", "Poppins Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--navy);
}
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header: slim text logo */
.site-header .inner { max-width: 520px; margin: 0 auto; padding: 12px 16px 0; display: flex; justify-content: center; }
.logo {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  color: var(--navy); font-size: 14px; font-weight: 700; letter-spacing: 0.01em; padding: 6px 4px;
}
.logo svg { flex: none; }

main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 8px 16px 28px; }

/* Headline + blue subline */
.intro { text-align: center; margin: 10px 0 14px; }
.intro h1 {
  font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--navy);
  margin: 0 auto 8px; max-width: 15em; letter-spacing: -0.02em;
}
.subline { margin: 0; color: var(--primary); font-weight: 700; font-size: 16px; }
@media (min-width: 480px) { .intro h1 { font-size: 34px; } }

/* Progress: dots + small "Step X of 10" */
.progress { text-align: center; margin: 0 0 14px; }
.dots { display: flex; justify-content: center; gap: 7px; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--border); transition: background 0.2s; }
.dots span.done { background: var(--primary); }
.dots span.now { background: var(--primary); box-shadow: 0 0 0 3px #cddcfb; }
.step-count { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Question card */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-card {
  background: var(--soft); border-radius: 16px; padding: 20px 18px;
  text-align: center; margin: 0 0 16px;
}
legend.q-card { float: left; width: 100%; margin: 0; }
legend.q-card + * { clear: both; padding-top: 16px; }
.q-title {
  font-size: 21px; line-height: 1.3; font-weight: 700; color: var(--navy);
  margin: 0; letter-spacing: -0.01em; outline: none;
}
.q-sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Answers */
.options { display: grid; gap: 12px; }
.options.pair, .options.tiles { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.option {
  appearance: none; width: 100%; min-height: 60px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font: inherit; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--navy);
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .option:hover { border-color: var(--primary); } }
.option:active { background: var(--soft); }
.option[aria-pressed="true"] { border-color: var(--primary); background: var(--soft); box-shadow: inset 0 0 0 1px var(--primary); }
.options.pair .option { min-height: 120px; padding: 16px 10px; }

/* Icon tiles (2 columns) */
.option.tile { flex-direction: column; gap: 10px; min-height: 140px; padding: 16px 8px; font-size: 15px; }
.tile-icon {
  width: 68px; height: 68px; border-radius: 50%; background: var(--soft); color: var(--primary);
  display: grid; place-items: center; flex: none;
}
.option.tile[aria-pressed="true"] .tile-icon { background: #fff; }

/* Back link under the answers */
.back {
  appearance: none; border: 0; background: none; color: var(--primary);
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; margin: 10px auto 0; padding: 10px 16px; min-height: 44px; border-radius: 10px;
}
.back svg { flex: none; }
.back[hidden] { display: none; }

/* Trust line under the quiz */
.trust {
  list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 18px; font-size: 14px; color: var(--muted);
}
.trust li { display: flex; align-items: center; gap: 6px; }
.trust svg { color: var(--primary); }

/* Form fields */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 15px; color: var(--navy); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; min-height: 56px; padding: 12px 16px;
  font: inherit; font-size: 17px; color: var(--text);
  background: #fff; border: 1.5px solid var(--border-strong); border-radius: 12px;
}
.field input::placeholder { color: #8391a7; }
.field select {
  appearance: none; padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
.field input:focus, .field select:focus { border-color: var(--primary); outline: 3px solid #cddcfb; outline-offset: 0; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); }
.tel { display: flex; align-items: stretch; }
.tel-prefix {
  display: flex; align-items: center; padding: 0 14px; font-size: 17px; font-weight: 700; color: var(--navy);
  background: var(--soft); border: 1.5px solid var(--border-strong); border-right: 0; border-radius: 12px 0 0 12px;
}
.field .tel input { border-radius: 0 12px 12px 0; min-width: 0; }
.err { color: var(--danger); font-size: 14px; margin-top: 6px; }
.err:empty { display: none; }

/* Consent: full size, dark, readable */
.consent {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin: 6px 0 4px;
}
.consent input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--primary); }
.consent label { font-size: 15px; line-height: 1.55; color: var(--text); }
.consent.invalid { border-color: var(--danger); }

/* Buttons: one primary blue everywhere */
.btn {
  appearance: none; width: 100%; min-height: 58px; margin-top: 14px; padding: 12px 18px;
  font: inherit; font-size: 17px; font-weight: 700; color: #fff;
  background: var(--primary); border: 0; border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}
@media (hover: hover) { .btn:hover { background: var(--primary-hover); } }
.btn[disabled] { opacity: 0.75; cursor: progress; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { background: #fef3f2; color: var(--danger); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 15px; }
.form-error:empty { display: none; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 12px 0 0; }

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

/* Cards (result and legal pages) */
.card { background: #fff; border: 1.5px solid var(--border); border-radius: 18px; padding: 22px 18px; }
@media (min-width: 480px) { .card { padding: 28px; } }

/* Result pages */
.result { text-align: center; padding: 30px 18px; margin-top: 12px; }
.result .icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--soft); color: var(--primary); }
.result h1 { font-size: 24px; line-height: 1.3; font-weight: 700; color: var(--navy); margin: 0 0 10px; letter-spacing: -0.01em; }
.result p { color: var(--muted); margin: 0 0 10px; }
.steps-list { text-align: left; margin: 20px auto 0; padding: 0; list-style: none; max-width: 400px; }
.steps-list li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.steps-list b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-size: 14px; }

/* Legal pages */
.legal { line-height: 1.65; margin-top: 12px; }
@media (max-width: 479px) { .card.legal { border: 0; border-radius: 0; padding: 8px 0 0; } }
.legal h1 { font-size: 26px; line-height: 1.25; color: var(--navy); margin: 0 0 12px; letter-spacing: -0.01em; }
.legal h2 { font-size: 19px; color: var(--navy); margin: 26px 0 8px; }
.legal h3 { font-size: 17px; color: var(--navy); margin: 18px 0 6px; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 15px; line-height: 1.45; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px; border: 1px solid var(--border); }
.legal th { background: var(--soft); }
/* Phone: each table row becomes a small card with labels */
@media (max-width: 640px) {
  .legal thead { position: absolute; left: -9999px; }
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 4px 12px; }
  .legal td { border: 0; padding: 6px 0; }
  .legal td + td { border-top: 1px solid var(--border); }
  .legal td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
  .legal td:first-child { font-weight: 700; }
  .legal td:first-child::before { display: none; }
}
.legal .placeholder { background: #fff7e6; border: 1px solid #f5d38a; border-radius: 12px; padding: 10px 12px; font-size: 14px; }

/* Footer: small disclaimer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .inner { max-width: 520px; margin: 0 auto; padding: 18px 16px 24px; font-size: 13px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 16px; margin-bottom: 8px; }
.site-footer nav a { display: inline-block; padding: 6px 0; color: var(--muted); }
.site-footer p { margin: 0 0 10px; line-height: 1.55; }

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

/* Temporary one screen page */
.home-card { margin-top: 14px; line-height: 1.6; }
.home-card p { margin: 0 0 12px; }
.home-card p:last-child { margin-bottom: 0; }
.home-card h2 { font-size: 17px; color: var(--navy); margin: 18px 0 6px; }
.home-card h2.first { margin-top: 0; }
.home-card .steps-list { margin: 8px 0 0; max-width: none; }
