/* ==========================================================================
 * Preisrechner Fahrschule Hochtaunus
 * Datei: preisrechner.css
 * --------------------------------------------------------------------------
 * Alle Klassen tragen das Präfix "fsht-", damit der Rechner später ohne
 * Kollisionen in eine bestehende Contao-Seite eingebunden werden kann.
 * Farben zentral über CSS-Variablen im Block .fsht-rechner.
 * ========================================================================== */

/* --- Nur für die Standalone-Testseite (fällt in Contao weg) -------------- */
.fsht-demo {
  margin: 0;
  padding: 0 0 3rem;
  background: #f2f2f2;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.fsht-demo__leiste {
  padding: 0.6rem 1rem;
  background: #000;
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

/* ==========================================================================
   Baustein
   ========================================================================== */

.fsht-rechner {
  --fsht-rot: #e2001a;
  --fsht-rot-dunkel: #b30015;
  --fsht-schwarz: #000000;
  --fsht-gelb: #ffcc00;
  --fsht-text: #1a1a1a;
  --fsht-text-leise: #5c5c5c;
  --fsht-linie: #dcdcdc;
  --fsht-flaeche: #ffffff;
  --fsht-flaeche-leise: #f5f5f5;
  --fsht-radius: 10px;

  box-sizing: border-box;
  padding: 2.5rem 1rem;
  color: var(--fsht-text);
  font-family: inherit;
  line-height: 1.55;
}

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

.fsht-rechner__inner {
  max-width: 1080px;
  margin: 0 auto;
}

/* --- Kopfbereich --------------------------------------------------------- */

.fsht-kicker {
  margin: 0 0 0.4rem;
  color: var(--fsht-rot);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fsht-kopf__titel {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--fsht-schwarz);
}

.fsht-kopf__text {
  margin: 0 0 2rem;
  max-width: 46rem;
  color: var(--fsht-text-leise);
}

.fsht-noscript {
  margin: 0 0 2rem;
  padding: 1rem 1.2rem;
  border-left: 5px solid var(--fsht-rot);
  background: var(--fsht-flaeche-leise);
}

/* --- Raster -------------------------------------------------------------- */

/* Die Aufteilung richtet sich nach der Breite des Rechners selbst, nicht nach
   der Fensterbreite. Wichtig, weil der Rechner in der Website in einer
   schmalen Inhaltsspalte neben der Navigation steht: Eine Media Query würde
   dort zweispaltig schalten, obwohl gar kein Platz dafür ist.

   Aufbau ab 680 px Containerbreite: links Führerscheinklassen und
   Fahrstunden untereinander, rechts die Kostenschätzung – beide Spalten
   gleich breit. Darunter läuft alles untereinander. */

.fsht-rechner__inner {
  container-type: inline-size;
}

.fsht-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@container (min-width: 680px) {
  .fsht-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Rückfalllösung für Browser ohne Container Queries (vor 2022):
   dort entscheidet die Fensterbreite. */
@supports not (container-type: inline-size) {
  @media (min-width: 1200px) {
    .fsht-grid {
      grid-template-columns: 1fr 1fr;
      align-items: start;
    }
  }
}

/* --- Blöcke ---------------------------------------------------------------- */

.fsht-grid > * {
  min-width: 0;
}

/* Linke Spalte: die beiden Blöcke untereinander, gleicher Abstand wie im
   Raster selbst. */
.fsht-spalte {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.fsht-block {
  margin: 0;
  padding: 1.4rem;
  border: 1px solid var(--fsht-linie);
  border-radius: var(--fsht-radius);
  background: var(--fsht-flaeche);
}

.fsht-block__titel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fsht-schwarz);
}

.fsht-schritt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--fsht-rot);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- Klassenauswahl ------------------------------------------------------ */

.fsht-klassen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
}

.fsht-klasse {
  display: block;
  position: relative;
}

.fsht-klasse__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.fsht-klasse__box {
  display: block;
  height: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--fsht-linie);
  border-radius: var(--fsht-radius);
  background: var(--fsht-flaeche);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.fsht-klasse__label {
  display: block;
  font-weight: 700;
  color: var(--fsht-schwarz);
}

.fsht-klasse__text {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--fsht-text-leise);
}

.fsht-klasse__box:hover {
  border-color: var(--fsht-gelb);
  background: #fffdf2;
}

.fsht-klasse__input:checked + .fsht-klasse__box {
  border-color: var(--fsht-rot);
  background: #fff5f6;
}

.fsht-klasse__input:focus-visible + .fsht-klasse__box {
  outline: 3px solid var(--fsht-schwarz);
  outline-offset: 2px;
}

/* Fallback für Browser ohne :focus-visible */
.fsht-klasse__input:focus + .fsht-klasse__box {
  outline: 3px solid var(--fsht-schwarz);
  outline-offset: 2px;
}
.fsht-klasse__input:focus:not(:focus-visible) + .fsht-klasse__box {
  outline: none;
}

.fsht-klassen__info {
  margin: 1rem 0 0;
  padding-left: 0.9rem;
  border-left: 4px solid var(--fsht-gelb);
  font-size: 0.85rem;
  color: var(--fsht-text-leise);
}

.fsht-klassen__info:empty {
  display: none;
}

/* --- Schieberegler ------------------------------------------------------- */

.fsht-slider + .fsht-slider {
  margin-top: 1.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--fsht-linie);
}

.fsht-slider__kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.fsht-slider__label {
  font-weight: 700;
  color: var(--fsht-schwarz);
  cursor: pointer;
}

.fsht-slider__zusatz {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--fsht-text-leise);
}

.fsht-slider__wert {
  flex: 0 0 auto;
  min-width: 3.2rem;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  background: var(--fsht-schwarz);
  color: var(--fsht-gelb);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.fsht-slider__zeile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Plus und Minus werden gezeichnet statt geschrieben – so sitzen sie
   unabhängig von der Schriftart der Seite immer exakt in der Mitte.
   Der zugängliche Name kommt aus dem aria-label des Buttons. */
.fsht-step {
  position: relative;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 2px solid var(--fsht-linie);
  border-radius: 50%;
  background: var(--fsht-flaeche);
  color: var(--fsht-schwarz);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.fsht-step::before,
.fsht-step::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: currentColor;
  border-radius: 1px;
}

/* waagerechter Balken – bei beiden Buttons */
.fsht-step::before {
  width: 16px;
  height: 2px;
}

/* senkrechter Balken – nur beim Plus */
.fsht-step--plus::after {
  width: 2px;
  height: 16px;
}

.fsht-step:hover {
  border-color: var(--fsht-rot);
  background: var(--fsht-rot);
  color: #fff;
}

.fsht-step:focus-visible {
  outline: 3px solid var(--fsht-schwarz);
  outline-offset: 2px;
}

/* Range-Input: eigene Optik, in allen gängigen Browsern gleich */
.fsht-range {
  --fsht-fuellung: 50%;
  flex: 1 1 auto;
  width: 100%;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.fsht-range:focus {
  outline: none;
}

.fsht-range:focus-visible {
  outline: 3px solid var(--fsht-schwarz);
  outline-offset: 4px;
  border-radius: 4px;
}

/* WebKit / Blink */
.fsht-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--fsht-rot) 0%,
    var(--fsht-rot) var(--fsht-fuellung),
    #e4e4e4 var(--fsht-fuellung),
    #e4e4e4 100%
  );
}

.fsht-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 3px solid var(--fsht-rot);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.fsht-range:hover::-webkit-slider-thumb,
.fsht-range:focus::-webkit-slider-thumb {
  border-color: var(--fsht-schwarz);
  background: var(--fsht-gelb);
}

/* Firefox */
.fsht-range::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #e4e4e4;
}

.fsht-range::-moz-range-progress {
  height: 8px;
  border-radius: 4px;
  background: var(--fsht-rot);
}

.fsht-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--fsht-rot);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.fsht-range:hover::-moz-range-thumb,
.fsht-range:focus::-moz-range-thumb {
  border-color: var(--fsht-schwarz);
  background: var(--fsht-gelb);
}

/* --- Deaktivierter Regler (Klasse ohne Sonderfahrten) ------------------- */

.fsht-slider--aus .fsht-slider__label,
.fsht-slider--aus .fsht-slider__zusatz {
  color: #8a8a8a;
}

.fsht-slider--aus .fsht-slider__wert {
  background: #ededed;
  color: #8a8a8a;
}

.fsht-step:disabled {
  border-color: #ededed;
  color: #b0b0b0;
  cursor: not-allowed;
}

.fsht-step:disabled:hover {
  border-color: #ededed;
  background: var(--fsht-flaeche);
  color: #b0b0b0;
}

.fsht-range:disabled {
  cursor: not-allowed;
}

.fsht-range:disabled::-webkit-slider-runnable-track {
  background: #ededed;
}

.fsht-range:disabled::-webkit-slider-thumb {
  border-color: #cfcfcf;
  background: #f7f7f7;
  box-shadow: none;
}

.fsht-range:disabled::-moz-range-track {
  background: #ededed;
}

.fsht-range:disabled::-moz-range-thumb {
  border-color: #cfcfcf;
  background: #f7f7f7;
  box-shadow: none;
}

.fsht-slider__gesperrt {
  font-style: italic;
}

.fsht-slider__skala {
  display: flex;
  justify-content: space-between;
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--fsht-text-leise);
}

/* --- Ergebnisbereich ----------------------------------------------------- */

.fsht-ergebnis {
  padding: 1.4rem;
  border-radius: var(--fsht-radius);
  background: var(--fsht-schwarz);
  color: #fff;
}

.fsht-ergebnis__titel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.fsht-liste {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fsht-liste__zeile[hidden] {
  display: none;
}

.fsht-liste__zeile {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #333;
}

.fsht-liste__text {
  display: block;
}

.fsht-liste__label {
  display: block;
  font-weight: 700;
}

.fsht-liste__rechnung {
  display: block;
  font-size: 0.8rem;
  color: var(--fsht-gelb);
  font-variant-numeric: tabular-nums;
}

.fsht-liste__rechnung--fix {
  color: #9a9a9a;
}

.fsht-liste__info {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  color: #b5b5b5;
}

.fsht-liste__zeile--aus .fsht-liste__label,
.fsht-liste__zeile--aus .fsht-liste__info {
  color: #8a8a8a;
}

.fsht-liste__zeile--aus .fsht-liste__betrag {
  color: #8a8a8a;
  font-weight: 400;
  font-style: italic;
}

.fsht-liste__betrag {
  flex: 0 0 auto;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fsht-summe {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 0.3rem;
  padding-top: 0.9rem;
  border-top: 3px solid var(--fsht-rot);
}

.fsht-summe__label {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fsht-summe__wert {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 800;
  color: var(--fsht-gelb);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fsht-stand {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  color: #b5b5b5;
}

.fsht-disclaimer {
  margin: 0 0 1.2rem;
  padding: 0.8rem 0.9rem;
  border-left: 4px solid var(--fsht-gelb);
  background: #1c1c1c;
  font-size: 0.85rem;
  color: #ececec;
}

.fsht-cta {
  display: block;
  padding: 0.95rem 1.2rem;
  border-radius: var(--fsht-radius);
  background: var(--fsht-rot);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.fsht-cta:hover,
.fsht-cta:focus {
  background: var(--fsht-rot-dunkel);
  color: #fff;
}

.fsht-cta:focus-visible {
  outline: 3px solid var(--fsht-gelb);
  outline-offset: 3px;
}

.fsht-meta {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: #b5b5b5;
}

.fsht-meta__link {
  color: var(--fsht-gelb);
  text-decoration: underline;
}

.fsht-meta__link:hover {
  color: #fff;
}

/* --- Kleine Bildschirme -------------------------------------------------- */

@media (max-width: 480px) {
  .fsht-rechner {
    padding: 1.75rem 0.9rem;
  }
  .fsht-block,
  .fsht-ergebnis {
    padding: 1.1rem;
  }
  .fsht-liste__info {
    display: none;
  }
}

/* --- Bewegung reduzieren ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .fsht-rechner * {
    transition: none !important;
  }
}
