/* Rechner (Schrittfolge) — nur auf /raschet/ und /en/calculation/. Bausteine und Tokens aus site.css (.formcard .field .input .field__err .consent .btn). */

/* Karte: 24 px Radius; Hero-Spalten oben bündig, damit die linke Spalte bei wechselnder Kartenhöhe nicht springt */
.page-hero .split { align-items: start; }
.formcard.calc { border-radius: 24px; scroll-margin-top: calc(var(--header-h) + 12px); }
.calc [hidden] { display: none !important; }

/* Fortschritt: Zurück-Pfeil, «Шаг N из 5», dünner Balken (nur transform) */
.calc__top { display: grid; gap: 8px; margin-bottom: var(--s4); }
.calc__row { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-left: -8px; }
.calc__back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-hover) var(--ease), transform var(--dur-press) var(--ease); }
.calc__back:hover { background: var(--surface-2); }
.calc__back:active { transform: scale(.94); }
.calc__back svg { width: 20px; height: 20px; transform: rotate(180deg); }
.calc__count { margin: 0; font-size: var(--fs-small); font-weight: 600; color: var(--ink-3); }
.calc__bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.calc__bar span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent-a), var(--accent-b)); transform-origin: left center; transform: scaleX(.2); transition: transform 200ms var(--ease); }

/* Startansicht */
.cstart__txt { margin: 0 0 var(--s5); color: var(--ink-2); font-size: var(--fs-body); line-height: 1.5; }
.cstart__small { margin: var(--s3) 0 0; text-align: center; font-size: var(--fs-small); color: var(--ink-3); }

/* Schritt: Titel (Gruppenname), Schrittzähler nur für Screenreader (ohne JS sichtbar, siehe noscript in calc.mjs) */
.cstep { min-width: 0; }
.cstep__t { margin: 0 0 var(--s4); font-size: 1.375rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; }
.cstep__k { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Schrittwechsel: 200 ms Gleiten + Einblenden, nur transform/opacity. Reduzierte Bewegung: nur Überblenden (site.css kürzt sonst alles auf 0,001 ms) */
.calc.calc--on .cstep.is-in-fwd { animation: calc-in-fwd 200ms var(--ease-out) both; }
.calc.calc--on .cstep.is-in-back { animation: calc-in-back 200ms var(--ease-out) both; }
@keyframes calc-in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes calc-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes calc-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .calc.calc--on .cstep.is-in-fwd, .calc.calc--on .cstep.is-in-back { animation-name: calc-fade !important; animation-duration: 200ms !important; }
  .calc__bar span { transition: none !important; }
}

/* Knopf unten: ≥ 44 px (.btn hat 52 px), volle Breite */
.calc__nav { display: flex; margin-top: var(--s5); }
.calc__nav .btn { flex: 1 1 0; min-width: 0; }
.calc .cstep .consent { margin-bottom: var(--s2); }
.cyear { max-width: 200px; }
.seg--2 { grid-template-columns: repeat(2, 1fr); }

/* Land: Auswahl-Chips */
.cchips { margin-top: var(--s5); margin-bottom: var(--s4); }
.cchips legend { padding: 0; }
.cchips__row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--bg); font-size: 1.0625rem; font-weight: 600; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), transform var(--dur-press) var(--ease); }
.chip:hover { border-color: var(--ink); }
.chip:active { transform: scale(.97); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Combobox */
.cbo { position: relative; }
.cbo__input { padding-right: 56px; }
.cbo__tog { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); cursor: pointer; }
.cbo__tog:hover { background: var(--surface); }
.cbo__tog svg { width: 20px; height: 20px; transition: transform 200ms var(--ease); }
.cbo__tog[aria-expanded="true"] svg { transform: rotate(180deg); }
.cbo__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 304px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-2); }
.cbo__brand { padding: 10px 10px 4px; font-size: var(--fs-cap); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.cbo__opt { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; border-radius: 12px; font-size: 1.0625rem; line-height: 1.3; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cbo__opt:hover { background: var(--surface); }
.cbo__opt[aria-selected="true"] { background: var(--surface); outline: 3px solid var(--focus); outline-offset: -3px; }
.cbo__opt b { font-weight: 600; }
.cbo__opt em { font-style: normal; color: var(--ink-3); }
.cbo__opt--free { margin-top: 2px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }

/* Plättchen: Foto aus eigenem Material oder ruhiges Markenkürzel */
.ctile { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; background: var(--surface-2); color: var(--ink-2); font-size: .75rem; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.ctile img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 62%; display: block; }
.ctile--lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.125rem; }

/* Gewähltes Auto */
.cpick { display: flex; align-items: center; gap: 14px; margin-top: var(--s3); padding: 12px; border-radius: 16px; background: var(--surface); }
.cpick__txt { display: grid; gap: 2px; min-width: 0; }
.cpick__brand { font-size: var(--fs-cap); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.cpick__model { font-size: 1.1875rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cpick + .field__hint { margin-top: var(--s2); }

/* Erfolgsansicht (Container nur programmatisch fokussiert, kein Bedienelement: kein Ring) */
.calc .form-ok:focus { outline: none; }
.calc .form-ok h3 { margin: 0 0 var(--s3); font-size: 1.5rem; letter-spacing: -.02em; text-wrap: balance; }
.calc .form-ok p { margin: 0 0 var(--s3); }
.calc .form-ok .calc__wait { margin: var(--s5) 0 0; font-size: var(--fs-small); font-weight: 600; color: var(--ink-3); }
.calc .form-ok .actions { margin-top: var(--s3); }

@media (max-width: 419px) {
  .cstep__t { font-size: 1.25rem; }
}
