/* Aldanma — interface styles.
   Design brief: readable for older people first. Large type (20px base, user-adjustable),
   high contrast (body text >= 7:1), large touch targets (>= 56px), meaning never carried by colour alone.
   Visual motif: road signs. Everyone already knows a red triangle means "danger" and a yellow diamond
   means "caution", so verdicts are shown as sign shapes with a word inside. */

@font-face { font-family: "Atkinson Next"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Next"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Next"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Next"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Mono"; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Mono"; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-mono-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #f6f3ea;
  --surface: #ffffff;
  --surface-sunk: #ede8da;
  --ink: #17181a;
  --ink-soft: #45474c;
  --line: #c9c2ae;
  --line-strong: #17181a;
  --blue: #0a4a9e;          /* road-sign blue: actions, links, "no signs" */
  --blue-ink: #ffffff;
  --blue-soft: #e3ecf8;
  --red: #b3141f;           /* danger triangle */
  --red-soft: #fbe7e6;
  --amber: #f2b705;         /* caution diamond, always with dark text */
  --amber-ink: #17181a;
  --amber-soft: #fdf3d2;
  --focus: #0a4a9e;
  --shadow: 0 1px 0 rgba(23, 24, 26, 0.06), 0 6px 18px rgba(23, 24, 26, 0.06);
  --radius: 14px;
  --text-scale: 1;
  font-size: calc(125% * var(--text-scale)); /* 20px at 100% */
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121315;
  --surface: #1c1e21;
  --surface-sunk: #26292d;
  --ink: #f3f1ea;
  --ink-soft: #c4c2bb;
  --line: #42454b;
  --line-strong: #f3f1ea;
  --blue: #8fb6ff;
  --blue-ink: #0b1220;
  --blue-soft: #1b2a44;
  --red: #ff8f87;
  --red-soft: #3a1d1c;
  --amber: #ffcc33;
  --amber-ink: #17181a;
  --amber-soft: #3a3016;
  --focus: #ffcc33;
  --shadow: none;
}

:root[data-size="large"] { --text-scale: 1.15; }
:root[data-size="xlarge"] { --text-scale: 1.32; }

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Next", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }

:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: 0.6rem 1rem; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.1rem; }

.mono { font-family: "Atkinson Mono", ui-monospace, monospace; letter-spacing: 0.02em; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header ------------------------------------------------------------------ */

.topbar { border-bottom: 2px solid var(--line); background: var(--surface); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; min-height: 4.2rem; flex-wrap: wrap; padding-block: 0.4rem; }

.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand svg { width: 2rem; height: 2rem; flex: none; }

.controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.control {
  min-height: 2.8rem; padding: 0.3rem 0.9rem; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.control:hover { border-color: var(--ink); }
.control[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Intro ------------------------------------------------------------------- */

.intro { padding: 2.4rem 0 1.2rem; }
.intro h1 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 0.7rem; letter-spacing: -0.02em; }
.intro p { margin: 0; font-size: 1.1rem; color: var(--ink-soft); max-width: 34rem; }

/* Illustrations (generated, no text in them; webp with intrinsic size so nothing jumps while loading).
   Their background was lifted to white, so in light mode they sit on a white card like the form panel, apart from the page. */
.hero, .figure img { border: 2px solid var(--line); border-radius: var(--radius); background: #ffffff; box-shadow: var(--shadow); }
.hero-img, .figure img { display: block; width: 100%; height: auto; }
/* Narrow screens: the illustration sits centred in a short white strip, so the form is not pushed far down. */
.hero { margin-top: 1.2rem; overflow: hidden; }
.hero .hero-img { width: auto; height: 12rem; aspect-ratio: 680 / 700; margin: 0 auto; }
:root[data-theme="dark"] .hero, :root[data-theme="dark"] .figure img { filter: brightness(0.9); }
/* Wide screens: text left, a tighter crop of the illustration right, so the check form stays in the first screen. */
@media (min-width: 52rem) {
  .intro { display: grid; grid-template-columns: minmax(0, 1fr) 9rem; grid-template-areas: "title hero" "text hero"; column-gap: 2rem; align-items: center; padding: 1rem 0 0.9rem; }
  .intro h1 { grid-area: title; align-self: end; }
  .intro p { grid-area: text; align-self: start; }
  .hero { grid-area: hero; margin-top: 0; }
  .hero .hero-img { width: 100%; height: auto; }
  /* About three lines, so the Kontrol et button stays visible on short laptop screens; the user can still drag it taller. */
  #input { min-height: 5.6rem; height: 5.6rem; }
}
.figure { margin: 0.4rem 0 1.2rem; }
.figure figcaption { margin-top: 0.6rem; color: var(--ink-soft); font-size: 0.95rem; }
.figure figcaption strong { color: var(--ink); }

/* Check form -------------------------------------------------------------- */

.panel { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }

label.big { display: block; font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; }
.hint { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 0.7rem; }

textarea, input[type="text"], input[type="email"], input[type="month"], select {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: 10px; padding: 0.8rem 0.9rem;
}
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
textarea::placeholder { color: var(--ink-soft); opacity: 1; }

.row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.5rem; padding: 0.6rem 1.4rem; border-radius: 12px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn svg { width: 1.3em; height: 1.3em; flex: none; }
.btn-primary { background: var(--blue); color: var(--blue-ink); flex: 1 1 14rem; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-sunk); }
.btn-danger { background: var(--red); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1c0b0a; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

.examples { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.examples span { color: var(--ink-soft); font-size: 0.9rem; margin-right: 0.2rem; }
.chip {
  min-height: 2.75rem; padding: 0.35rem 0.95rem; border-radius: 999px; border: 2px dashed var(--line);
  background: transparent; color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer;
}
.chip:hover { border-style: solid; border-color: var(--ink); }

fieldset { border: 0; padding: 0; margin: 1.1rem 0 0; }
legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.5rem; }
.choice {
  display: flex; align-items: center; gap: 0.65rem; min-height: 3.3rem; padding: 0.5rem 0.85rem;
  border: 2px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface);
}
.choice:hover { border-color: var(--ink); }
.choice input { width: 1.35rem; height: 1.35rem; accent-color: var(--blue); flex: none; margin: 0; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }

.error { margin-top: 0.9rem; padding: 0.8rem 1rem; border-radius: 10px; background: var(--red-soft); border-left: 6px solid var(--red); font-weight: 700; }
.status { margin-top: 0.9rem; color: var(--ink-soft); }

/* Verdict ----------------------------------------------------------------- */

.result { margin-top: 1.6rem; display: grid; gap: 1.1rem; }

.verdict {
  display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: center;
  padding: 1.3rem; border-radius: var(--radius); border: 3px solid var(--line-strong); background: var(--surface);
}
.verdict.high { background: var(--red-soft); border-color: var(--red); }
.verdict.suspicious { background: var(--amber-soft); border-color: var(--amber); }
.verdict.no-signs { background: var(--blue-soft); border-color: var(--blue); }
.verdict h2 { margin: 0; font-size: 1.7rem; line-height: 1.2; }
.verdict p { margin: 0.35rem 0 0; font-size: 1.08rem; }
.verdict .meter { margin-top: 0.6rem; font-size: 0.9rem; color: var(--ink-soft); }

/* Road-sign shapes. The word inside keeps the meaning without colour. */
.sign { width: 5.4rem; height: 5.4rem; flex: none; }
.sign text { font-family: "Atkinson Next", sans-serif; font-weight: 700; }

.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.card h3 { margin: 0 0 0.6rem; font-size: 1.25rem; line-height: 1.3; }
.card > p { margin: 0.3rem 0; }

ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 0.7rem; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.7rem; align-items: start; }
ol.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 700;
}

.identity { display: grid; gap: 0.35rem; padding: 1rem 1.1rem; border: 2px solid var(--line); border-left-width: 10px; border-radius: 12px; }
.identity.high { border-left-color: var(--red); }
.identity.suspicious { border-left-color: var(--amber); }
.identity.no-signs { border-left-color: var(--blue); }
.identity .value { font-size: 1.25rem; font-weight: 700; word-break: break-all; }
.identity .kind { color: var(--ink-soft); font-size: 0.9rem; }
.tag { display: inline-block; font-weight: 700; font-size: 0.85rem; padding: 0.1rem 0.6rem; border-radius: 999px; border: 2px solid currentColor; }
.tag.high { color: var(--red); }
.tag.suspicious { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.tag.no-signs { color: var(--blue); }
.reports-line { font-weight: 700; }
.reports-none { color: var(--ink-soft); }

ul.reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.8rem; }
ul.reasons li { padding-left: 1.1rem; border-left: 4px solid var(--line); }
ul.reasons li.strong { border-left-color: var(--red); }
ul.reasons li.mild { border-left-color: var(--amber); }
ul.reasons li.good { border-left-color: var(--blue); }
ul.reasons strong { display: block; }
ul.reasons span { color: var(--ink-soft); }

.verify-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.verify-links a { display: inline-flex; align-items: center; min-height: 2.9rem; padding: 0.3rem 0.95rem; border-radius: 10px; border: 2px solid var(--blue); font-weight: 700; text-decoration: none; }
.verify-links a:hover { background: var(--blue-soft); }

details { border-top: 2px solid var(--line); padding-top: 0.8rem; margin-top: 0.8rem; }
summary { cursor: pointer; font-weight: 700; min-height: 2.75rem; display: flex; align-items: center; }

.clicked { background: var(--surface-sunk); }
.note { color: var(--ink-soft); font-size: 0.92rem; }

.selfcheck .q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.selfcheck .q:last-of-type { border-bottom: 0; }
.yesno { display: flex; gap: 0.4rem; }
.yesno button { min-width: 5rem; min-height: 2.9rem; border-radius: 10px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.yesno button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.selfcheck .verdict-line { margin-top: 0.8rem; font-weight: 700; }

/* Report and dispute ------------------------------------------------------ */

.section { padding: 2.2rem 0 0.5rem; }
.section h2 { font-size: 1.6rem; margin: 0 0 0.6rem; line-height: 1.25; }
.form-grid { display: grid; gap: 1rem; }
.check-list { display: grid; gap: 0.5rem; }
.success { padding: 1rem 1.1rem; border-radius: 12px; background: var(--blue-soft); border-left: 6px solid var(--blue); font-weight: 700; }

.how { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.how .card h3 { font-size: 1.1rem; }
.stat { font-size: 1.6rem; font-weight: 700; line-height: 1.1; display: block; }

footer { margin-top: 3rem; border-top: 2px solid var(--line); padding: 1.6rem 0 2.6rem; color: var(--ink-soft); font-size: 0.92rem; }
footer p { margin: 0.4rem 0; }

@media (max-width: 34rem) {
  .controls { width: 100%; flex-wrap: nowrap; }
  .control { flex: 1 1 0; font-size: 0.8rem; padding-inline: 0.5rem; }
  .intro { padding-top: 1.6rem; }
  .intro h1 { font-size: 1.9rem; }
  .panel { padding: 1rem; }
  .verdict { grid-template-columns: 1fr; text-align: left; }
  .sign { width: 4.4rem; height: 4.4rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .result { animation: rise 0.25s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

@media print {
  .topbar .controls, .row, .examples, #report, #dispute, footer { display: none; }
}
.result:focus { outline: none; }
@media (max-width: 34rem) { .identity .value { font-size: 1.05rem; } }

/* Small layout utilities used by the scripts and the markup (no inline styles, so the CSP can forbid them). */
.spaced { margin-top: 0.9rem; }
.row.flush { margin-top: 0; }
.stack { display: grid; gap: 0.8rem; }
.tight { margin: 0.2rem 0; }
.verify-item { margin-top: 0.6rem; }
.plain-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.identity-head { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; }

/* "Was this right?" card and the optional review form under it. */
.feedback .review { display: grid; gap: 0.7rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 2px solid var(--line); }
.feedback .review .choice { align-items: flex-start; }
/* After "yes" the share offer is optional, so it reads quieter than the "no" flow. */
.feedback .review.optional > p:first-child { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
