/* ==========================================================================
   Yelllow Check – Branding (Briefing Abschnitt 9)
   Soft-Gelb #FDECA0 Hintergrund, vivid Brand-Gelb #FFDC00 (Logo) als Akzent,
   Schwarz + viel Weissraum. Grosse, klare Typo.
   ========================================================================== */

:root {
  --bg: #fdeca0; /* Seitenhintergrund, soft */
  --gelb: #ffdc00; /* Brand-Gelb (Logo), Akzente */
  --schwarz: #111111;
  --weiss: #ffffff;
  --grau: #4d4d4d; /* AA-tauglich auf bg & weiss */
  --grau-soft: #767676;
  --karte: #ffffff;
  --linie: #ececec;
  --radius: 20px;
  --maxw: 460px;
  --schatten: 0 8px 30px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Globale Schutzregel: das HTML-[hidden]-Attribut MUSS gegen jede display-
   Regel gewinnen (sonst bleiben .ergebnis-spar / .sheet / .geraet-cta trotz
   hidden=true sichtbar). Eine Quelle statt Einzelregeln pro Element. */
[hidden] {
  display: none !important;
}

/* Auto-Fokus beim Screen-Wechsel (nicht-interaktive Headings) ohne Rahmen. */
[tabindex="-1"]:focus {
  outline: none;
}

/* Nur fuer Screenreader sichtbar. */
.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;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--schwarz);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Body-Scroll sperren, solange das Datenschutz-Sheet offen ist */
body.is-locked {
  overflow: hidden;
}

#app {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(64px, calc(env(safe-area-inset-top) + 52px)) 24px
    max(28px, env(safe-area-inset-bottom));
}
.screen.is-active {
  display: flex;
  animation: fade 0.45s ease both;
}
.screen__inner {
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.screen__inner--center {
  text-align: center;
  align-items: center;
  justify-content: center;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Logo (Original-Asset, unveraendert) ---------- */
.brand {
  display: block;
  width: auto;
  height: 56px;
  margin-bottom: 6px;
}
.brand--klein {
  height: 40px;
  margin: 0 auto 4px;
}

/* ---------- Typo ---------- */
.huge {
  font-size: clamp(46px, 14vw, 66px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -2px;
  margin: 0;
}
.title {
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -1px;
  margin: 0;
}
.lead {
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
  max-width: 38ch;
  color: #2a2a2a;
}
.lead--big {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--schwarz);
}
.muted {
  color: var(--grau);
  font-size: 14px;
  margin: 0;
}

/* ---------- Consent-Karte ---------- */
.consent {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  font-size: 15.5px;
  line-height: 1.45;
  cursor: pointer;
  background: var(--karte);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--schatten);
}
.consent input {
  width: 26px;
  height: 26px;
  flex: none;
  accent-color: var(--schwarz);
  margin-top: 1px;
}
.consent a {
  color: var(--schwarz);
  font-weight: 700;
}
/* Datenangst sofort entkräften – sichtbar, nicht nur im Sheet versteckt. */
.consent__beruhigung {
  display: block;
  margin-top: 6px;
  font-weight: 800;
  color: var(--schwarz);
}

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:focus-visible {
  outline: 3px solid var(--schwarz);
  outline-offset: 3px;
}
.btn--primary {
  background: var(--schwarz);
  color: var(--gelb);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.btn--primary:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  box-shadow: none;
}
.btn--ghost {
  background: transparent;
  color: var(--schwarz);
  border: 2px solid var(--schwarz);
}
.btn--text {
  background: transparent;
  color: var(--grau);
  font-weight: 600;
  font-size: 15px;
  padding: 10px;
}

/* ---------- Speed-Gauge ---------- */
.gauge {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
  margin: 8px 0;
}
.gauge__value {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
}
.gauge__unit {
  position: absolute;
  bottom: 50px;
  font-weight: 700;
  color: var(--grau);
}
.gauge__ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.gauge__bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.12);
  stroke-width: 9;
}
.gauge__fg {
  fill: none;
  stroke: var(--schwarz);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.35s ease;
}
/* Waehrend der Messung: rotierender Teilbogen statt eingefrorenem 0er-Ring. */
.gauge.is-messing .gauge__fg {
  stroke-dasharray: 80 247 !important;
  stroke-dashoffset: 0 !important;
  transform-box: fill-box;
  transform-origin: center;
  animation: gaugeSpin 1.1s linear infinite;
}
@keyframes gaugeSpin {
  to {
    transform: rotate(360deg);
  }
}
.speed-status {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  min-height: 26px;
}

/* Netz-Reveal (erscheint erst im Speed-Schritt, NICHT auf Seite 1) */
.netzchip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--schwarz);
  color: var(--weiss);
  border-radius: 16px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 700;
  max-width: 100%;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.netzchip.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.netzchip b {
  color: var(--gelb);
}
.netzchip__org {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- Geraet ---------- */
.emoji {
  font-size: 72px;
  line-height: 1;
}

/* ---------- Quiz ---------- */
.frage {
  margin-top: 4px;
}
.frage__q {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
}
.frage__q small {
  font-weight: 500;
  color: var(--grau);
  font-size: 14px;
}
.frage__hint {
  font-size: 13px;
  color: var(--grau);
  margin: 2px 0 0;
}
.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.chip {
  background: var(--karte);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
  box-shadow: var(--schatten);
  transition: transform 0.08s ease, border-color 0.15s ease,
    background 0.15s ease;
}
.chip small {
  font-size: 13px;
  font-weight: 500;
  color: var(--grau);
}
.chip:active {
  transform: scale(0.96);
}
.chip:focus-visible {
  outline: 3px solid var(--schwarz);
  outline-offset: 2px;
}
.chip.is-selected {
  border-color: var(--schwarz);
  background: var(--schwarz);
  color: var(--gelb);
}
.chip.is-selected small {
  color: rgba(255, 220, 0, 0.85);
}

/* ---------- Ergebnis ---------- */
.ergebnis-spar {
  background: var(--schwarz);
  color: var(--gelb);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}
.ergebnis-spar__label {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}
.ergebnis-spar__value {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}
@keyframes pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.tarifkarte {
  background: var(--karte);
  border-radius: var(--radius);
  padding: 22px;
  border: 3px solid var(--schwarz);
  box-shadow: var(--schatten);
}
.tarifkarte__name {
  font-size: 22px;
  font-weight: 900;
}
.tarifkarte__daten {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  margin: 2px 0 12px;
}
.tarifkarte__features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tarifkarte__features li {
  font-size: 15px;
  padding-left: 26px;
  position: relative;
}
.tarifkarte__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 900;
  color: var(--schwarz);
}
.tarifkarte__preis {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-top: 2px solid var(--linie);
  padding-top: 14px;
}
.tarifkarte__preisVal {
  font-size: 34px;
  font-weight: 900;
}
.tarifkarte__preisUnit {
  color: var(--grau);
  font-weight: 600;
}

.ergebnissatz {
  font-size: 16px;
  line-height: 1.5;
  margin: 2px 0;
}
.geraet-cta {
  background: var(--karte);
  border: 2px dashed rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.45;
}
.filiale-hinweis {
  background: var(--gelb);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 600;
  margin: -6px 0 0;
  animation: pop 0.35s ease both;
}
.kleingedruckt {
  font-size: 12px;
  color: var(--grau);
  line-height: 1.5;
  margin: 8px 0 0;
}

/* ---------- Progress dots ---------- */
.progress {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 50;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  transition: width 0.3s ease, background 0.3s ease;
}
.dot.is-active {
  background: var(--schwarz);
  width: 22px;
  border-radius: 4px;
}
.dot.is-done {
  background: var(--schwarz);
}

/* ---------- Datenschutz-Sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 100;
  animation: fade 0.25s ease both;
}
/* (Sichtbarkeit ueber die globale [hidden]-Regel ganz oben.) */
.sheet__inner {
  background: var(--weiss);
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  border-radius: 22px 22px 0 0;
  padding: 26px 22px max(26px, env(safe-area-inset-bottom));
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideup 0.3s ease both;
}
@keyframes slideup {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.sheet__inner h3 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}
.sheet__inner ul {
  padding-left: 20px;
  margin: 0 0 14px;
}
.sheet__inner li {
  margin-bottom: 8px;
  line-height: 1.45;
}
.sheet__inner p {
  line-height: 1.5;
  color: #333;
}
.sheet__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--linie);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.sheet__close:focus-visible {
  outline: 3px solid var(--schwarz);
  outline-offset: 2px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
