/*
 * Leben in Deutschland - Prüfungsvorbereitung.
 *
 * Das einzige Stylesheet der Seite. Keine Abhängigkeiten: kein CDN, keine
 * Webfonts, kein Build-Schritt. Ausgeliefert werden genau eine CSS- und eine
 * JS-Datei aus eigener Quelle.
 *
 * Aufbau: zuerst fürs Handy, größere Bildschirme kommen über Media Queries
 * dazu. Bedienelemente sind mindestens 44 Pixel hoch - das ist die Größe, die
 * sich mit dem Daumen sicher treffen lässt.
 */

:root {
    /* Farben der Wortmarke: Petrol (EZ) und Blau (plus). Träger der
       Interaktion ist das dunklere Petrol; das hellere Blau erreicht auf
       Weiß keine 4,5:1 und bleibt deshalb Fläche, nie Text. */
    --petrol: #1f6180;
    --petrol-dunkel: #16495f;
    --petrol-tief: #0f3547;
    --blau: #0982ad;
    --blau-dunkel: #076a8d;
    --text: #1f2933;
    --text-leise: #52606d;
    --linie: #d7e2e8;
    --linie-kraeftig: #b7c9d3;
    --flaeche: #ffffff;
    --flaeche-leise: #f3f7f9;
    --hintergrund: #f7fafb;
    --ok: #22884c;
    --ok-bg: #e8f6ef;
    --fehler: #cf1124;
    --fehler-bg: #fdecec;
    --warn: #b06a00;
    --warn-bg: #fff8e6;
    --akzent: #e8710a;
    --akzent-dunkel: #c25c00;
    --radius: 10px;
    --radius-gross: 16px;
    --schatten: 0 1px 2px rgba(15, 53, 71, .06), 0 8px 24px rgba(15, 53, 71, .06);
    --schatten-klein: 0 1px 2px rgba(15, 53, 71, .08);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
    margin: 0;
    background: var(--hintergrund);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

a { color: var(--petrol-dunkel); }
a:hover { color: var(--petrol); }

:focus-visible {
    outline: 3px solid var(--blau);
    outline-offset: 2px;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 18px;
}
.container--schmal { max-width: 760px; }

.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;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--petrol);
    color: #fff;
    padding: 10px 16px;
    z-index: 60;
}
.skip-link:focus { left: 0; }

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

.kopf {
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
    position: sticky;
    top: 0;
    z-index: 40;
}

.kopf__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.kopf__marke {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    margin-right: auto;
    min-width: 0;
}
.kopf__logo { height: 40px; width: auto; display: block; }
.kopf__wortmarke {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--petrol);
    white-space: nowrap;
}
/* Auf schmalen Geräten haben Wortmarke und Zusatz nebeneinander keinen
   Platz - dort trägt die Kopfzeile nur die Marke. */
.kopf__zusatz { display: none; }

@media (min-width: 560px) {
    .kopf__zusatz {
        display: block;
        margin: 0;
        font-size: .82rem;
        font-weight: 600;
        color: var(--text-leise);
        padding-left: 12px;
        border-left: 2px solid var(--linie);
        line-height: 1.25;
    }
}

/* Der Buchungsknopf steht auf dem Handy in der festen Leiste am unteren
   Rand; in der Kopfzeile wäre er ein zweites Mal derselbe Weg und würde die
   Marke verdrängen. */
.kopf .knopf--buchen { display: none; }

@media (min-width: 860px) {
    .kopf .knopf--buchen { display: inline-flex; }
}

/* Hauptnavigation: auf dem Handy eine waagerechte Leiste zum Wischen,
   ab Tablet in der Kopfzeile. Kein Aufklappmenü - vier Punkte brauchen
   keinen Umweg über einen Knopf. */
.nav {
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
    position: sticky;
    top: 64px;
    z-index: 39;
}
.nav__liste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav__liste::-webkit-scrollbar { display: none; }
.nav__link {
    display: block;
    padding: 12px 12px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-leise);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}
.nav__link:hover { color: var(--petrol); }
.nav__link.ist-aktiv {
    color: var(--petrol-dunkel);
    border-bottom-color: var(--petrol);
}

@media (min-width: 860px) {
    .nav { position: static; border-bottom: 1px solid var(--linie); }
    .kopf { position: static; }
}

/* --- Knöpfe ------------------------------------------------------------ */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid var(--linie-kraeftig);
    border-radius: var(--radius);
    background: var(--flaeche);
    color: var(--petrol-dunkel);
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.knopf:hover { background: var(--flaeche-leise); color: var(--petrol-dunkel); }
.knopf:active { transform: translateY(1px); }

.knopf--haupt {
    background: var(--petrol);
    border-color: var(--petrol);
    color: #fff;
}
.knopf--haupt:hover { background: var(--petrol-dunkel); border-color: var(--petrol-dunkel); color: #fff; }

/* Der Buchungsknopf ist das Ziel der Seite - er bekommt als einziger die
   Signalfarbe und hebt sich damit von allem anderen ab. */
.knopf--buchen {
    background: var(--akzent);
    border-color: var(--akzent);
    color: #fff;
}
.knopf--buchen:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }

.knopf--breit { width: 100%; }
.knopf--klein { min-height: 40px; padding: 8px 14px; font-size: .92rem; }

.knopf[disabled] { opacity: .55; cursor: not-allowed; }

.knopfreihe {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.knopfreihe .knopf { flex: 1 1 240px; }

/* --- Abschnitte und Karten -------------------------------------------- */

main { flex: 1 0 auto; padding-bottom: 40px; }

.abschnitt { padding: 34px 0; }
.abschnitt--leise { background: var(--flaeche-leise); }
.abschnitt--rand { border-top: 1px solid var(--linie); }

h1, h2, h3 { line-height: 1.25; color: var(--petrol-tief); }
h1 { font-size: 1.85rem; margin: 0 0 14px; letter-spacing: -.015em; }
h2 { font-size: 1.35rem; margin: 0 0 14px; }
h3 { font-size: 1.08rem; margin: 22px 0 8px; }

@media (min-width: 700px) {
    h1 { font-size: 2.4rem; }
    h2 { font-size: 1.6rem; }
}

.vorspann {
    font-size: 1.06rem;
    color: var(--text-leise);
    margin: 0 0 20px;
}

.karte {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
    padding: 20px;
    box-shadow: var(--schatten-klein);
}

.karten {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .karten--zwei { grid-template-columns: 1fr 1fr; }
    .karten--drei { grid-template-columns: repeat(3, 1fr); }
}

.karte__titel { margin: 0 0 6px; font-size: 1.1rem; }
.karte__text { margin: 0; color: var(--text-leise); }

/* --- Hero -------------------------------------------------------------- */

.hero {
    background: linear-gradient(160deg, var(--petrol-tief) 0%, var(--petrol) 62%, var(--blau) 100%);
    color: #fff;
    padding: 40px 0 34px;
}
.hero h1 { color: #fff; }
.hero__text {
    font-size: 1.08rem;
    margin: 0 0 22px;
    color: rgba(255, 255, 255, .92);
    max-width: 46em;
}
.hero .knopf--haupt {
    background: #fff;
    border-color: #fff;
    color: var(--petrol-tief);
}
.hero .knopf--haupt:hover { background: #eef5f8; color: var(--petrol-tief); }
.hero .knopf:not(.knopf--haupt):not(.knopf--buchen) {
    background: transparent;
    border-color: rgba(255, 255, 255, .6);
    color: #fff;
}
.hero .knopf:not(.knopf--haupt):not(.knopf--buchen):hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.hero__zahlen {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    margin: 26px 0 0;
    padding: 0;
}
.hero__zahl { font-size: .92rem; color: rgba(255, 255, 255, .85); }
.hero__zahl b { display: block; font-size: 1.5rem; color: #fff; line-height: 1.2; }

/* --- Hinweise, Notizen ------------------------------------------------- */

.hinweis {
    border-left: 4px solid var(--linie-kraeftig);
    background: var(--flaeche-leise);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 16px;
    margin: 18px 0;
    font-size: .95rem;
}
.hinweis p { margin: 0; }
.hinweis p + p { margin-top: 8px; }
.hinweis--warnung { border-left-color: var(--warn); background: var(--warn-bg); }
.hinweis--ok { border-left-color: var(--ok); background: var(--ok-bg); }
.hinweis--fehler { border-left-color: var(--fehler); background: var(--fehler-bg); }

/* --- Fragenkatalog ----------------------------------------------------- */

.frage {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
    padding: 18px;
    margin: 0 0 14px;
    box-shadow: var(--schatten-klein);
}

.frage__kopf {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}
.frage__nummer {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--flaeche-leise);
    border: 1px solid var(--linie);
    color: var(--text-leise);
    font-size: .8rem;
    font-weight: 700;
}
.frage__text { margin: 0; font-weight: 600; }

.antworten {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* minmax(0, …) statt 1fr: Ein Rasterfeld schrumpft sonst nicht unter die
       Breite seines Inhalts, und eine Bildantwort schöbe die Seite auf. */
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}
.antwort {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: var(--flaeche);
}
.antwort__marke {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--linie-kraeftig);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-leise);
    background: var(--flaeche-leise);
}
.antwort--muster {
    border-color: var(--ok);
    background: var(--ok-bg);
}
.antwort--muster .antwort__marke {
    background: var(--ok);
    border-color: var(--ok);
    color: #fff;
}
.antwort--muster .antwort__text { font-weight: 600; }

/* Bildantworten (Wappen, Flaggen). `min-width: 0` an der Zelle daneben ist
   nötig, weil ein Flex-Element sonst nicht unter seine Inhaltsbreite
   schrumpft - auf schmalen Geräten schöbe das Bild sonst die ganze Seite
   zur Seite. */
.antwort__text, .wahl__text { min-width: 0; }

.antwort__bild {
    display: block;
    max-height: 130px;
    max-width: 100%;
    width: auto;
    background: #fff;
    border-radius: 6px;
}

.frage__bild {
    margin: 12px 0;
    text-align: center;
}
.frage__bild img {
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: #fff;
}
.frage__quelle {
    display: block;
    margin-top: 6px;
    font-size: .78rem;
    color: var(--text-leise);
}

/* --- Listen und Navigation im Katalog ---------------------------------- */

.kachelliste {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.kachel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 62px;
    padding: 12px 14px;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--petrol-tief);
    font-weight: 600;
    box-shadow: var(--schatten-klein);
    transition: border-color .15s ease, transform .1s ease;
}
.kachel:hover { border-color: var(--petrol); transform: translateY(-1px); color: var(--petrol-dunkel); }
.kachel small { display: block; font-weight: 400; color: var(--text-leise); font-size: .82rem; }

.blaettern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 22px 0 0;
}
.blaettern__stand { font-size: .9rem; color: var(--text-leise); }

/* --- Testprüfung ------------------------------------------------------- */

.pruefleiste {
    position: sticky;
    top: 0;
    z-index: 45;
    background: var(--petrol-tief);
    color: #fff;
    padding: 8px 0;
}
.pruefleiste__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pruefleiste__uhr {
    font-variant-numeric: tabular-nums;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.pruefleiste__uhr.ist-knapp { color: #ffd0d0; }
.pruefleiste__stand { font-size: .9rem; color: rgba(255, 255, 255, .85); margin-right: auto; }
.pruefleiste__balken {
    flex: 1 0 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
    overflow: hidden;
}
.pruefleiste__fortschritt {
    display: block;
    height: 100%;
    width: 0;
    background: #7fd4a3;
    transition: width .2s ease;
}

/* Der Bogen benutzt <fieldset> und <legend>, damit Vorleseprogramme Frage
   und Antworten zusammen ansagen. Ohne das Umbrechen der Beschriftung in
   einen normalen Block schneidet sie in den Rahmen der Karte. */
fieldset.frage { min-width: 0; }
fieldset.frage > legend {
    float: left;
    width: 100%;
    padding: 0;
    margin-bottom: 12px;
}
fieldset.frage > legend + * { clear: both; }

/* Antwort als Ganzes anklickbar: Das Label umschließt den Radiobutton, die
   Fläche ist also die Schaltfläche. Auf dem Handy ist das der Unterschied
   zwischen "geht" und "geht nicht". */
.wahl {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: var(--flaeche);
    cursor: pointer;
    min-height: 48px;
    transition: border-color .12s ease, background-color .12s ease;
}
.wahl:hover { border-color: var(--petrol); }
.wahl input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    accent-color: var(--petrol);
}
.wahl__text { flex: 1; }
.wahl:has(input:checked) {
    border-color: var(--petrol);
    background: #eef5f8;
    box-shadow: inset 0 0 0 1px var(--petrol);
}

.pruefung__abschluss {
    margin-top: 26px;
    padding: 20px;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
}

/* --- Auswertung -------------------------------------------------------- */

.ergebnis {
    text-align: center;
    padding: 26px 20px;
    border-radius: var(--radius-gross);
    border: 1px solid var(--linie);
    background: var(--flaeche);
}
.ergebnis--bestanden { border-color: var(--ok); background: var(--ok-bg); }
.ergebnis--durchgefallen { border-color: var(--fehler); background: var(--fehler-bg); }
.ergebnis__punkte {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--petrol-tief);
}
.ergebnis__punkte small { font-size: 1.1rem; font-weight: 600; color: var(--text-leise); }
.ergebnis__urteil { font-size: 1.15rem; font-weight: 700; margin: 6px 0 4px; }

.bilanz {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
    margin: 16px 0 0;
    padding: 0;
    font-size: .95rem;
}
.bilanz b { font-size: 1.25rem; display: block; }
.bilanz__richtig b { color: var(--ok); }
.bilanz__falsch b { color: var(--fehler); }

.frage--richtig { border-left: 5px solid var(--ok); }
.frage--falsch { border-left: 5px solid var(--fehler); }

.marke {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.marke--richtig { background: var(--ok-bg); color: #14663a; border: 1px solid var(--ok); }
.marke--falsch { background: var(--fehler-bg); color: #8f0b19; border: 1px solid var(--fehler); }
.marke--offen { background: var(--warn-bg); color: #7a4a00; border: 1px solid var(--warn); }

.antwort--gewaehlt-falsch {
    border-color: var(--fehler);
    background: var(--fehler-bg);
}
.antwort--gewaehlt-falsch .antwort__marke {
    background: var(--fehler);
    border-color: var(--fehler);
    color: #fff;
}

/* --- Empfehlen --------------------------------------------------------- */

.teilen__knoepfe {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.teilen__knopf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--linie-kraeftig);
    background: var(--flaeche);
    color: var(--petrol-dunkel);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.teilen__knopf:hover { background: var(--flaeche-leise); }
.teilen__knopf svg { width: 20px; height: 20px; flex: none; }
.teilen__knopf--whatsapp {
    background: #25d366;
    border-color: #1eb457;
    color: #06331a;
}
.teilen__knopf--whatsapp:hover { background: #1eb457; color: #06331a; }
.teilen__rueckmeldung {
    margin: 10px 0 0;
    font-size: .9rem;
    color: var(--ok);
    font-weight: 600;
}

/* --- Fußzeile ---------------------------------------------------------- */

.fuss {
    background: var(--petrol-tief);
    color: rgba(255, 255, 255, .84);
    padding: 28px 0 90px;
    font-size: .92rem;
}
.fuss a { color: #fff; }
.fuss__reihe {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}
.fuss__klein { font-size: .84rem; color: rgba(255, 255, 255, .68); margin: 12px 0 0; }

@media (min-width: 860px) {
    .fuss { padding-bottom: 34px; }
}

/* --- Feste Leiste am unteren Rand (nur Handy) -------------------------- */

.cta-leiste {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--linie);
    box-shadow: 0 -4px 18px rgba(15, 53, 71, .08);
}
.cta-leiste .knopf { flex: 1; min-height: 46px; padding: 10px 12px; font-size: .95rem; }

@media (min-width: 860px) {
    .cta-leiste { display: none; }
}

/* Auf der laufenden Testprüfung stört die Leiste - dort zählt der Bogen. */
.ist-pruefung .cta-leiste { display: none; }
.ist-pruefung .fuss { padding-bottom: 34px; }

/* Während der Prüfung klebt die Prüfleiste mit Uhr und Fortschritt oben.
   Zwei klebende Leisten übereinander fräßen den halben Bildschirm - deshalb
   scrollen Kopfzeile und Navigation dort mit weg. */
.ist-pruefung .kopf,
.ist-pruefung .nav { position: static; }

/* --- Tabellen und Aufzählungen ----------------------------------------- */

.liste-haken {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}
.liste-haken li {
    position: relative;
    padding: 0 0 0 30px;
    margin-bottom: 10px;
}
.liste-haken li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: .55em;
    width: 8px;
    height: 14px;
    border: solid var(--petrol);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) translateY(-50%);
}

details.klapp {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 10px;
}
details.klapp > summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 700;
    color: var(--petrol-tief);
    min-height: 48px;
    display: flex;
    align-items: center;
}
details.klapp > .klapp__inhalt { padding: 0 16px 14px; }

/* --- Kleine Abstandsklassen -------------------------------------------- */

/* Sie ersetzen style-Attribute im Markup: Die Content-Security-Policy
   erlaubt kein "style=", ein Inline-Stil würde also stillschweigend
   verworfen und der Abstand fehlte - ohne dass es jemandem auffiele. */
.abstand-oben { margin-top: 34px; }
.abstand-oben-klein { margin-top: 24px; }
.karte__aktion { margin: 14px 0 0; }
.knopfreihe--abstand { margin: 20px 0 10px; }

.ergebnis__zeile { margin: 0; color: var(--text-leise); }

.pruefung__abschluss > p:first-child { margin-top: 0; }
.pruefung__fussnote {
    margin: 14px 0 0;
    font-size: .9rem;
    color: var(--text-leise);
}

/* Ohne JavaScript bleibt die Uhr aus - dann soll sie auch nicht als
   stehengebliebene Anzeige irritieren. */
.nur-mit-js { display: none; }
.hat-js .nur-mit-js { display: initial; }
.hat-js .ohne-js { display: none; }
