/* =====================================================================
   Abfrage Fahrzeuge & Konzepte – LFV Saarland
   Farben aus dem LFV-Logo, Schrift Barlow (lokal eingebunden, kein CDN)
   ===================================================================== */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* LFV-Farben (aus dem Wappen-Logo) */
  --lfv-red: #C33429;        /* Flammen / Kreuz – Akzent, Buttons (Kontrast zu Weiß 5,5:1) */
  --lfv-red-dark: #A3281F;
  --lfv-red-soft: #FBECEA;
  --lfv-blue: #2A5F9E;       /* Wappen blau */
  --lfv-gold: #EFB13F;       /* Wappen gold */
  --lfv-black: #1A1718;      /* Schrift / Löwenfeld */

  --ink: var(--lfv-black);
  --ink-2: #3D4249;
  --muted: #5B5F66;
  --line: #DEE1E5;
  --line-2: #ECEEF1;
  --ground: #F3F4F5;
  --surface: #FFFFFF;
  --warn-ink: #8A4400;
  --warn-bg: #FFF4E5;
  --ok: #1F7A3E;

  --radius: 14px;
  --radius-s: 10px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --wrap: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--lfv-red); }
a:hover { color: var(--lfv-red-dark); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lfv-blue); outline-offset: 2px; }

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

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

/* ---------- Kopf ---------- */
.site-header { background: var(--surface); border-bottom: 4px solid var(--lfv-red); }
.site-header__inner { display: flex; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.site-header__logo { width: 64px; height: 64px; flex: none; }
.site-header__org { font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.site-header__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1; }

/* ---------- App-Rahmen ---------- */
.app { flex: 1; outline: none; }
.app__root { display: flex; flex-direction: column; min-height: 100%; }

.progress { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.progress__inner { padding-top: 10px; padding-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.progress__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.progress__count { color: var(--muted); white-space: nowrap; }
.progress__bars { display: flex; gap: 4px; }
.progress__bar { flex: 1; height: 4px; border-radius: 2px; background: #D3D7DC; }
.progress__bar.is-done { background: var(--ink); }
.progress__bar.is-current { background: var(--lfv-red); }

.step { padding-top: 20px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.step__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.08; outline: none; }
.step__intro { margin: 0 0 4px; color: var(--ink-2); font-size: 15.5px; }

.grp { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.grp__title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.grp__hint { margin: -2px 0 2px; font-size: 14px; color: var(--muted); }

/* ---------- Hinweise ---------- */
.notice { margin: 16px 0; padding: 12px 14px; border-radius: var(--radius-s); font-size: 15px; background: var(--surface); border: 1px solid var(--line); }
.notice--error { background: var(--lfv-red-soft); border-color: #F0C3BF; color: #7E1F18; }
.notice--warn { background: var(--warn-bg); border-color: #F3D6AE; color: var(--warn-ink); }
.notice--info { display: flex; gap: 10px; align-items: flex-start; }
.notice__actions { display: flex; gap: 16px; margin-top: 4px; }

/* ---------- Formularfelder ---------- */
.fields { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 15px; font-weight: 600; }
.field__opt { font-weight: 400; color: var(--muted); }
.field__err { font-size: 14px; color: #9B2219; font-weight: 600; }
.input {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1.5px solid #C9CED4; border-radius: 12px; background: var(--surface);
  font-size: 16px;
}
.input:focus { outline: none; border-color: var(--lfv-blue); box-shadow: 0 0 0 3px rgba(42, 95, 158, .18); }
.input[aria-invalid="true"] { border-color: var(--lfv-red); }
.select { position: relative; }
.select .input { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; }
.select svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Infobox Kategorie/Klasse ---------- */
.info { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.info summary { min-height: 48px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; color: var(--lfv-blue); }
.info summary::-webkit-details-marker { display: none; }
.info__grid { display: grid; grid-template-columns: 34px 1fr; gap: 4px 8px; font-size: 14.5px; color: var(--ink-2); padding: 0 0 14px; margin: 0; }
.info__grid dt { font-weight: 700; color: var(--ink); }
.info__grid dd { margin: 0; }

/* ---------- Positionskarte ---------- */
.card { background: var(--surface); border: 1.5px solid #E0E3E7; border-radius: var(--radius); padding: 10px 10px 10px 14px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 90px; }
.card.is-on { border-color: var(--lfv-red); }
.card.is-invalid { border-color: var(--warn-ink); box-shadow: 0 0 0 3px rgba(138, 68, 0, .15); }
.card__head { display: flex; align-items: center; gap: 10px; }
.card__text { flex: 1; min-width: 0; }
.card__name { font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.card__nr { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card__detail { display: flex; flex-direction: column; gap: 7px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.card__sub { display: flex; align-items: center; gap: 10px; }
.card__msg { font-size: 14px; font-weight: 600; color: var(--warn-ink); }
.lbl { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.lbl + .segs { margin-top: -1px; }
.segs + .lbl { margin-top: 4px; }

.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.iconbtn {
  appearance: none; width: 44px; height: 44px; padding: 0; border-radius: 12px;
  border: 1.5px solid #C9CED4; background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconbtn:hover { border-color: var(--ink); }
.iconbtn:disabled { opacity: .35; cursor: default; border-color: #C9CED4; }
.iconbtn--plus { background: var(--ink); border-color: var(--ink); color: #fff; }
.iconbtn--plus:hover { background: #000; }
.num {
  width: 52px; height: 44px; border: 0; border-radius: 8px; background: transparent;
  text-align: center; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.num:focus { outline: none; background: var(--ground); box-shadow: inset 0 0 0 1.5px var(--lfv-blue); }

.vol { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.vol .input { min-height: 44px; padding: 0 10px; }

.segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg {
  appearance: none; min-height: 54px; padding: 6px 4px; border-radius: var(--radius-s);
  border: 1.5px solid #C9CED4; background: var(--surface); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.seg:hover { border-color: var(--ink); }
.seg__code { font-size: 18px; font-weight: 700; line-height: 1; }
.seg__text { font-size: 12.5px; color: var(--muted); line-height: 1.1; text-align: center; }
.seg[aria-pressed="true"] { background: var(--lfv-red); border-color: var(--lfv-red); color: #fff; }
.seg[aria-pressed="true"] .seg__text { color: #fff; }

.linkbtn { appearance: none; background: none; border: 0; padding: 0; min-height: 44px; font-size: 15px; font-weight: 600; color: var(--lfv-red); cursor: pointer; text-align: left; }
.linkbtn:hover { color: var(--lfv-red-dark); text-decoration: underline; }
.linkbtn--small { min-height: 32px; font-size: 14px; }

/* ---------- Zusammenfassung ---------- */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 14px 4px; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.box__head .grp__title { padding: 10px 0 2px; }
.kv { margin: 0 0 12px; font-size: 15.5px; }
.kv strong { display: block; font-size: 17px; }
.kv span { display: block; color: var(--muted); }
.sumrow { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); align-items: flex-start; }
.sumrow__qty { min-width: 72px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sumrow__name { font-weight: 600; }
.sumrow__detail { font-size: 14px; color: var(--muted); margin-top: 1px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--lfv-red); cursor: pointer; }

/* ---------- Navigation unten ---------- */
.nav { position: sticky; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav__inner { padding-top: 10px; padding-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.nav__row { display: flex; gap: 10px; }
.btn {
  appearance: none; min-height: 52px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  font-size: 16.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--primary { flex: 1; background: var(--lfv-red); color: #fff; border: 0; }
.btn--primary:hover { background: var(--lfv-red-dark); }
.btn--primary:disabled { opacity: .6; cursor: progress; }
.btn--secondary { background: var(--surface); color: var(--ink); border: 1.5px solid #C9CED4; }
.btn--secondary:hover { border-color: var(--ink); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Erfolg ---------- */
.done { padding-top: 48px; padding-bottom: 48px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.done__icon { width: 76px; height: 76px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; }
.done p { margin: 0; max-width: 34em; color: var(--ink-2); }
.done__actions { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 12px; }

/* ---------- Fuß ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 14px; padding-bottom: 18px; }
.site-footer a { color: var(--muted); }

/* ---------- größere Bildschirme ---------- */
@media (min-width: 640px) {
  .site-header__logo { width: 76px; height: 76px; }
  .site-header__title { font-size: 26px; }
  .step__title { font-size: 32px; }
  .card { padding: 12px 12px 12px 18px; }
  .seg__text { font-size: 13px; }
}

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