/*
 * Führerschein-Berater – Seitenstil (nur auf fuehrerschein-berater.php geladen).
 * Optik an Startseite/Bußgeldrechner angelehnt: weiche Karten-Schatten,
 * gelbe CTA (#FFF200). Responsiv bis 320 px (rules.md § 9).
 */

.fsb_wrap { max-width: 760px; margin: 0 auto; padding: 0 4px; text-align: center; }

.fsb_label {
    display: inline-block; font-size: 0.75em; font-weight: 700;
    text-transform: uppercase; letter-spacing: 2px; color: #999; margin: 0 0 10px;
}
.fsb_intro { font-size: 0.98em; color: #555; line-height: 1.7; margin: 0 0 10px; }
.fsb_lang_note { font-size: 0.85em; color: #8a8a8a; margin: 0 0 22px; }

#fsb { margin: 0 auto; min-height: 160px; }

.fsb_card {
    background: linear-gradient(135deg, #ffffff 0%, #fdfdfc 100%);
    border: 1px solid rgba(0,0,0,0.06); border-radius: 20px;
    box-shadow: 8px 8px 20px rgba(190,185,175,0.35), -8px -8px 20px rgba(255,255,255,0.9);
    padding: 28px 26px; text-align: left;
}

.fsb_frage_text { font-size: 1.2em; font-weight: 700; color: #1a1a1a; line-height: 1.35; margin: 0 0 6px; }
.fsb_frage_hinweis { font-size: 0.9em; color: #666; line-height: 1.6; margin: 0 0 18px; }

/* ---- Auswahl-Optionen ---- */
.fsb_optionen { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.fsb_option {
    display: flex; align-items: center; gap: 14px;
    width: 100%; box-sizing: border-box; text-align: left;
    min-height: 48px; padding: 13px 18px; border: 2px solid #ececec; border-radius: 12px;
    background: #fafafa; color: #1a1a1a; font-size: 1em; font-weight: 600; cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.fsb_option_text { flex: 1 1 auto; min-width: 0; }

/* ---- Icon vor der Antwort ----
   Das SVG aus img/icons/ wird als MASKE gezeichnet; die Farbe kommt aus
   background-color. Dadurch lassen sich die einfarbigen Pictogramme umfärben:
   normal grau, beim Überfahren bzw. bei der gewählten Antwort gelb.
   Beide Farben stehen unten als Variablen – hier ändern, sonst nirgends. */
.fsb_optionen {
    --fsb-icon-farbe: #8a8a8a;         /* Ruhezustand: neutrales Grau */
    --fsb-icon-farbe-aktiv: #C9A200;   /* Hover/Auswahl: kräftiges Gelbgold.
                                          Für reines Fahrschul-Gelb hier #FFF200
                                          eintragen – das ist auf dem hellen
                                          Knopf allerdings kaum noch zu erkennen. */
}
.fsb_option_icon {
    flex: 0 0 auto; width: 48px; height: 34px; display: block;
    background-color: var(--fsb-icon-farbe);
    -webkit-mask-image: var(--fsb-icon-url); mask-image: var(--fsb-icon-url);
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    transition: background-color 0.2s ease;
}
/* Antworten ohne passendes Icon: unsichtbarer Platzhalter, damit die Texte
   einer Frage bündig untereinander stehen. */
.fsb_option_icon_leer { background-color: transparent; }
/* WICHTIG: Der Platzhalter (.fsb_option_icon_leer) ist hier ausdrücklich
   ausgenommen. Ohne das :not(...) würde er beim Überfahren bzw. bei der
   gewählten Antwort mit eingefärbt – und da er keine Maske hat, erschiene
   statt eines Icons ein volles gelbes Rechteck. */
.fsb_option:hover .fsb_option_icon:not(.fsb_option_icon_leer),
.fsb_option_active .fsb_option_icon:not(.fsb_option_icon_leer) { background-color: var(--fsb-icon-farbe-aktiv); }
/* Sehr alte Browser ohne Masken-Unterstützung: lieber gar kein Icon als ein Kasten. */
@supports not ((-webkit-mask-image: url("i.svg")) or (mask-image: url("i.svg"))) {
    .fsb_option_icon { display: none; }
}
.fsb_option:hover { border-color: #FFF200; background: #fffde6; transform: translateY(-1px); }
.fsb_option:active { transform: translateY(0); }
.fsb_option:focus-visible { outline: 3px solid #ffe000; outline-offset: 2px; }
.fsb_option_active { border-color: #FFF200; background: #fffde6; }
.fsb_option_gruppe { display: flex; flex-direction: column; }
.fsb_option_hinweis { font-size: 0.85em; color: #777; line-height: 1.5; margin: 4px 4px 2px; }

/* ---- Zahl-Eingabe ---- */
.fsb_eingabe_row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fsb_input {
    box-sizing: border-box; min-height: 48px; width: 100%;
    padding: 12px 14px; border: 2px solid #ececec; border-radius: 12px;
    font-size: 1.05em; background: #fff; color: #1a1a1a;
}
/* Nur in der waagerechten Zahlen-Eingabezeile soll das Feld mitwachsen. */
.fsb_eingabe_row .fsb_input { flex: 1 1 160px; min-width: 0; width: auto; }
.fsb_input:focus { outline: none; border-color: #FFF200; }
.fsb_input_fehler { border-color: #DB4437; background: #fdf0ef; }
.fsb_einheit { color: #555; font-weight: 600; }

/* ---- Land-Eingabe mit Vorschlagsliste (Umschreibung) ----
   Der Besucher tippt sein Land selbst; die Treffer hängen unter dem Feld.
   Die Liste ist absolut positioniert, damit beim Tippen nichts springt. */
.fsb_land_feld { position: relative; flex: 1 1 220px; min-width: 0; }
.fsb_land_feld .fsb_input { width: 100%; }
.fsb_land_liste {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
    margin: 0; padding: 6px; list-style: none; max-height: 292px; overflow-y: auto;
    background: #fff; border: 2px solid #ececec; border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.14);
}
.fsb_land_treffer {
    display: flex; align-items: center; min-height: 44px;   /* gut antippbar (§ 9) */
    padding: 8px 12px; border-radius: 9px; cursor: pointer;
    font-size: 1em; color: #1a1a1a;
}
.fsb_land_treffer:hover,
.fsb_land_treffer_aktiv { background: #fffde6; font-weight: 700; }
.fsb_land_tipp { font-size: 0.85em; color: #777; line-height: 1.5; margin: 10px 2px 0; }
.fsb_land_ohne { margin-top: 14px; }
/* Knopf unter den Antworten für Fragen, die man auslassen darf */
.fsb_skip { margin-top: 14px; }

/* ---- Knöpfe ---- */
.fsb_btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
    box-sizing: border-box; padding: 12px 26px; border: none; border-radius: 999px;
    background: #FFF200; color: #1a1a1a; font-size: 1em; font-weight: 800;
    letter-spacing: 0.3px; text-transform: uppercase; cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.5);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.fsb_btn:hover { transform: translateY(-2px); background: #ffe000; }
.fsb_btn:active { transform: translateY(0); }
.fsb_btn:focus-visible { outline: 3px solid #ffe000; outline-offset: 2px; }
.fsb_btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.fsb_btn_gross { width: 100%; }
.fsb_btn_secondary {
    background: #f0f0f0; color: #333; text-transform: none; font-weight: 700;
    box-shadow: none; border: 1px solid #e0e0e0;
}
.fsb_btn_secondary:hover { background: #e8e8e8; }
.fsb_restart_row { margin-top: 20px; text-align: center; }
.fsb_nav_row { margin-top: 16px; }
.fsb_link_btn {
    display: inline-block; margin: 14px auto 0; background: none; border: none;
    color: #7a5b00; text-decoration: underline; font-size: 0.9em; cursor: pointer;
}

/* ---- Fortschritt + Übersicht ---- */
.fsb_progress { margin: 0 0 18px; text-align: left; }
.fsb_progress_label { font-size: 0.8em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #7a5b00; margin-bottom: 6px; }
.fsb_progress_track { height: 8px; background: #ececec; border-radius: 999px; overflow: hidden; }
.fsb_progress_fill { height: 100%; width: 0; background: #FFF200; border-radius: 999px; transition: width 0.35s ease; }

.fsb_summary { margin: 0 0 18px; background: #faf9f5; border: 1px solid #ececec; border-radius: 14px; padding: 12px 16px; text-align: left; }
.fsb_summary_title { font-size: 0.75em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #999; margin-bottom: 6px; }
.fsb_summary_row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #efeee9; }
.fsb_summary_row:first-of-type { border-top: none; }
.fsb_summary_text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fsb_summary_frage { font-size: 0.8em; color: #888; line-height: 1.35; }
.fsb_summary_antwort { font-weight: 700; color: #222; line-height: 1.35; overflow-wrap: anywhere; }
.fsb_summary_edit { flex: 0 0 auto; min-height: 36px; background: #fff; border: 1px solid #e0d9b0; color: #7a5b00; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 0.85em; cursor: pointer; transition: background 0.2s ease; }
.fsb_summary_edit:hover { background: #fffde6; }
.fsb_summary_edit:focus-visible { outline: 3px solid #ffe000; outline-offset: 2px; }

/* ---- Ergebnis ---- */
.fsb_ergebnis { border-top: 4px solid #FFF200; }
.fsb_res_label { font-size: 0.75em; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #999; margin: 0 0 6px; }
.fsb_res_titel { font-size: 1.35em; font-weight: 800; color: #111; line-height: 1.3; margin: 0 0 12px; }
.fsb_badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.fsb_badge { display: inline-block; background: #1a1a1a; color: #FFF200; font-weight: 800; font-size: 0.85em; letter-spacing: 0.5px; padding: 5px 12px; border-radius: 999px; }
.fsb_res_sub { font-weight: 700; color: #333; margin: 16px 0 6px; }
.fsb_res_liste { margin: 0 0 8px; padding-left: 20px; color: #444; line-height: 1.6; }
.fsb_res_liste li { margin-bottom: 5px; }
.fsb_res_kosten {
    margin: 16px 0 0; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
    padding: 14px 18px; font-size: 0.92em; color: #7a5b00; line-height: 1.6;
}
.fsb_api_hinweis { margin: 16px 0 0; font-size: 0.82em; color: #8a8a8a; line-height: 1.6; text-align: center; }

/* ---- Dauerhafter Rechtshinweis (statisch) ---- */
.fsb_pflicht {
    margin: 26px 0 0; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
    padding: 14px 18px; font-size: 0.85em; color: #7a5b00; line-height: 1.6; text-align: left;
}

/* ---- Phase 2: Formular ---- */
.fsb_form { margin-top: 20px; }
.fsb_form_titel { font-size: 1.2em; font-weight: 800; color: #1a1a1a; margin: 0 0 6px; }
.fsb_form_intro { font-size: 0.95em; color: #555; line-height: 1.6; margin: 0 0 18px; }
.fsb_form_group { display: flex; flex-direction: column; margin-bottom: 14px; }
.fsb_form_group label { font-size: 0.9em; font-weight: 600; color: #333; margin-bottom: 6px; }
.fsb_form textarea.fsb_input { min-height: 80px; resize: vertical; }
.fsb_form select.fsb_input { background: #fff; }
.fsb_form_grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fsb_form_grid_plz { grid-template-columns: 120px 1fr; }
.fsb_form_grid_str { grid-template-columns: 1fr 110px; }
.fsb_check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 4px; font-size: 0.9em; color: #444; line-height: 1.5; cursor: pointer; }
.fsb_check input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
/* ---- Bereits vorhandene Klassen (Ankreuzfelder) ---- */
/* Die Kaestchen liegen in einem umbrechenden Raster: eine Spalte ab 320 px,
   zwei ab 420 px, drei ab 620 px. Jede Zeile ist mindestens 44 px hoch (rules.md § 9). */
.fsb_klassen_titel { font-size: 0.9em; font-weight: 600; color: #333; margin-bottom: 4px; }
.fsb_klassen_hint { margin: 0 0 10px; font-size: 0.85em; color: #666; line-height: 1.5; }
.fsb_klassen_liste { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 12px; }
/* zwei Klassen im Selektor, damit die allgemeine Regel ".fsb_form_group label"
   (Fettschrift + Abstand) hier nicht durchschlaegt */
.fsb_klassen .fsb_klassen_opt {
    display: flex; align-items: center; gap: 10px; min-height: 44px;
    padding: 6px 10px; border: 1px solid #e3e3e3; border-radius: 10px;
    background: #fff; cursor: pointer; margin: 0; font-weight: 400; font-size: 1em;
}
.fsb_klassen .fsb_klassen_opt:hover { border-color: #bdbdbd; }
.fsb_klassen_opt input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.fsb_klassen_txt { display: flex; flex-direction: column; min-width: 0; }
.fsb_klassen_k { font-size: 0.95em; font-weight: 700; color: #222; line-height: 1.3; }
.fsb_klassen_l { font-size: 0.78em; color: #6b6b6b; line-height: 1.3; }
.fsb_klassen .fsb_klassen_opt.is-keine { grid-column: 1 / -1; background: #fafafa; }
.fsb_klassen_liste.is-gesperrt .fsb_klassen_opt:not(.is-keine) { opacity: 0.45; cursor: default; }
.fsb_klassen_sonst_lab { font-size: 0.9em; font-weight: 600; color: #333; margin-bottom: 6px; }
.fsb_klassen .fsb_input:disabled { background: #f4f4f4; color: #999; }
@media (min-width: 420px) { .fsb_klassen_liste { grid-template-columns: 1fr 1fr; } }
@media (min-width: 620px) { .fsb_klassen_liste { grid-template-columns: repeat(3, 1fr); } }

.fsb_form_fehler { color: #a3271e; background: #fdf0ef; border: 1px solid #f3c9c5; border-radius: 10px; padding: 10px 14px; margin: 10px 0 0; font-size: 0.9em; }
.fsb_form_ok { color: #256029; background: #eef7ee; border: 1px solid #cfe6cf; border-radius: 10px; padding: 10px 14px; margin: 10px 0 0; font-size: 0.9em; }

/* ---- Phase 3: PIN / Verifizierung ---- */
.fsb_pin {
    letter-spacing: 0.5em; text-align: center; font-size: 1.6em; font-weight: 800;
    max-width: 260px; margin: 6px auto 0; display: block;
}
.fsb_verify { text-align: center; }
.fsb_verify .fsb_form_intro { text-align: center; }

/* ---- Danke-Card ---- */
.fsb_danke { text-align: center; border-top: 4px solid #4caf50; }
.fsb_danke_icon {
    width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%;
    background: #eef7ee; color: #2e7d32; font-size: 2em; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
}
.fsb_danke_titel { font-size: 1.35em; font-weight: 800; color: #1a1a1a; margin: 0 0 8px; }
.fsb_danke_text { font-size: 1em; color: #555; line-height: 1.6; margin: 0; }

/* ---- Laden/Fehler ---- */
.fsb_loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: #666; padding: 40px 10px; }
.fsb_spinner { width: 22px; height: 22px; border: 3px solid #eee; border-top-color: #FFF200; border-radius: 50%; animation: fsb_spin 0.8s linear infinite; }
@keyframes fsb_spin { to { transform: rotate(360deg); } }

/* ---- Responsiv (rules.md § 9) ---- */
@media screen and (max-width: 650px) {
    /* Handy: Rand zum Bildschirm klein halten, damit die Karte die Breite ausnutzt
       (wie im Bremsweg-Abschnitt der Theorie-Merkhilfe, 25.07.2026). */
    #berater.article_wrapper_1_row { padding-left: 10px; padding-right: 10px; }
    .fsb_wrap { padding: 0 2px; }
    .fsb_card { padding: 22px 14px; border-radius: 16px; }
    .fsb_frage_text { font-size: 1.1em; }
    .fsb_res_titel { font-size: 1.18em; }
}
@media screen and (max-width: 360px) {
    #berater.article_wrapper_1_row { padding-left: 8px; padding-right: 8px; }
    .fsb_wrap { padding: 0; }
    .fsb_card { padding: 18px 11px; }
    /* Icon und Abstand etwas kleiner: dadurch bleibt lange Antworttext-Zeilen
       (z. B. "Ich habe einen ausländischen Führerschein") zweizeilig statt dreizeilig,
       ohne die Schrift zu verkleinern. */
    .fsb_option { gap: 7px; padding: 13px 11px; }
    .fsb_option_icon { width: 28px; height: 24px; }
    .fsb_eingabe_row { flex-direction: column; align-items: stretch; }
    .fsb_eingabe_row .fsb_btn { width: 100%; }
    /* Land-Eingabe: Feld und Knopf untereinander, Vorschläge über dem Knopf */
    .fsb_land_feld { flex: 1 1 auto; width: 100%; }
    .fsb_land_liste { max-height: 240px; }
    .fsb_land_ohne, .fsb_skip { width: 100%; }
    .fsb_form_grid, .fsb_form_grid_plz { grid-template-columns: 1fr; }
    .fsb_summary_row { flex-wrap: wrap; }
    .fsb_summary_edit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .fsb_option, .fsb_btn, .fsb_option_icon { transition: none; }
    .fsb_spinner { animation-duration: 1.6s; }
}

/* ---- RTL (Arabisch) ---- */
html[lang="ar"] .fsb_card, html[lang="ar"] .fsb_summary, html[lang="ar"] .fsb_progress { text-align: right; }
html[lang="ar"] .fsb_option { text-align: right; flex-direction: row-reverse; }
html[lang="ar"] .fsb_res_liste { padding-left: 0; padding-right: 20px; }
