/* Sichtbarkeits-Check — ergänzt styles.css und nutzt dessen Variablen. */

:root {
    --chk-gruen: #1c7c3f;
    --chk-gelb: #9a6b00;
    --chk-rot: #b3261e;
    --chk-fehler-rand: #f0c0ba;
    --chk-fehler-text: #90261c;
}
@media (prefers-color-scheme: dark) {
    :root {
        --chk-gruen: #5fd68d;
        --chk-gelb: #f0bf4c;
        --chk-rot: #ff8a7f;
        --chk-fehler-rand: rgba(231, 76, 60, 0.45);
        --chk-fehler-text: #ffb4aa;
    }
}

.chk { max-width: 780px; margin: 0 auto; }

/* Die Navigation ist fixiert. Ohne diesen Abstand springt das Ergebnis so weit
   nach oben, dass der Firmenname unter der Leiste verschwindet — genau das
   passierte beim ersten Durchlauf im Browser. */
#chkErgebnis, #chkAngebot, #chkDanke {
    scroll-margin-top: calc(var(--nav-height, 72px) + 20px);
}

/* ----- Suchfeld ----- */

.chk-suche { position: relative; }
.chk-suche__feld {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    font-size: 1.05rem;
    padding: 18px 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition-fast);
}
.chk-suche__feld:focus {
    outline: none;
    border-color: var(--color-primary);
}
.chk-suche__hinweis {
    margin: 10px 2px 0;
    font-size: .88rem;
    color: var(--color-text-muted);
}

.chk-liste {
    position: absolute;
    z-index: 30;
    left: 0; right: 0; top: calc(100% + 6px);
    margin: 0; padding: 6px;
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
}
.chk-liste[hidden] { display: none; }
.chk-liste__eintrag {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.4;
}
.chk-liste__eintrag:hover,
.chk-liste__eintrag[aria-selected="true"] { background: var(--color-primary-soft); }
.chk-liste__name { font-weight: 600; display: block; }
.chk-liste__ort  { font-size: .85rem; color: var(--color-text-muted); }

/* ----- Analysephase ----- */

.chk-lauf { display: grid; gap: 14px; margin-top: 8px; }
.chk-schritt {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    color: var(--color-text-soft);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.chk-schritt.ist-aktiv { background: var(--color-primary-soft); color: var(--color-text); }
.chk-schritt.ist-fertig { background: var(--color-success-soft); color: var(--color-text); }
.chk-schritt__icon {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid var(--color-border);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 700; color: #fff;
}
.chk-schritt.ist-aktiv .chk-schritt__icon {
    border-color: var(--color-primary);
    border-top-color: transparent;
    animation: chk-dreh .8s linear infinite;
}
.chk-schritt.ist-fertig .chk-schritt__icon {
    border-color: var(--color-success); background: var(--color-success);
    animation: none;
}
.chk-schritt.ist-fertig .chk-schritt__icon::after { content: "✓"; }
@keyframes chk-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .chk-schritt.ist-aktiv .chk-schritt__icon { animation: none; border-top-color: var(--color-primary); }
}

/* ----- Scorecard ----- */

.chk-karte {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.chk-kopf { padding: 28px 28px 24px; border-bottom: 1px solid var(--color-border-soft); }
.chk-kopf__firma { font-size: 1.15rem; font-weight: 700; }
.chk-kopf__adresse { color: var(--color-text-muted); font-size: .9rem; margin-top: 2px; }

.chk-score { display: flex; align-items: center; gap: 22px; margin-top: 20px; flex-wrap: wrap; }
.chk-score__zahl { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.chk-score__von  { font-size: 1.1rem; color: var(--color-text-muted); font-weight: 600; }
.chk-score__text { flex: 1 1 260px; color: var(--color-text-soft); line-height: 1.55; }

.chk-balken { height: 10px; border-radius: 999px; background: var(--color-border-soft); margin-top: 18px; overflow: hidden; }
.chk-balken__fuellung { height: 100%; border-radius: 999px; transition: width var(--transition-slow); }

.ist-gruen .chk-score__zahl, .chk-punkt.ist-gruen .chk-punkt__wert { color: var(--chk-gruen); }
.ist-gelb  .chk-score__zahl, .chk-punkt.ist-gelb  .chk-punkt__wert { color: var(--chk-gelb); }
.ist-rot   .chk-score__zahl, .chk-punkt.ist-rot   .chk-punkt__wert { color: var(--chk-rot); }
.ist-gruen .chk-balken__fuellung { background: var(--color-success); }
.ist-gelb  .chk-balken__fuellung { background: #e0a020; }
.ist-rot   .chk-balken__fuellung { background: var(--color-danger); }

.chk-punkte { list-style: none; margin: 0; padding: 0; }
.chk-punkt {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 18px 28px;
    border-bottom: 1px solid var(--color-border-soft);
}
.chk-punkt:last-child { border-bottom: 0; }
.chk-punkt__ampel { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.chk-punkt.ist-gruen .chk-punkt__ampel { background: var(--color-success); }
.chk-punkt.ist-gelb  .chk-punkt__ampel { background: #e0a020; }
.chk-punkt.ist-rot   .chk-punkt__ampel { background: var(--color-danger); }
.chk-punkt__titel { font-weight: 600; }
.chk-punkt__befund { color: var(--color-text-soft); font-size: .92rem; line-height: 1.55; margin-top: 4px; }
.chk-punkt__wert { font-weight: 700; font-size: .92rem; text-align: right; white-space: nowrap; }

.chk-vergleich {
    margin: 0; padding: 22px 28px;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-soft);
}
.chk-vergleich__titel { font-weight: 700; margin-bottom: 6px; }
.chk-vergleich__text { color: var(--color-text-soft); line-height: 1.6; }
.chk-vergleich.ist-rot  { background: var(--color-danger-soft); }
.chk-vergleich.ist-gruen { background: var(--color-success-soft); }

.chk-quelle { font-size: .78rem; color: var(--color-text-muted); margin-top: 14px; line-height: 1.5; }

/* ----- Übergang und Formular ----- */

.chk-angebot {
    margin-top: 28px;
    padding: 28px;
    background: var(--color-primary-soft);
    border-radius: var(--radius-lg);
}
.chk-angebot h3 { margin: 0 0 8px; font-size: 1.25rem; }
.chk-angebot p  { margin: 0 0 20px; color: var(--color-text-soft); line-height: 1.6; }

.chk-form { display: grid; gap: 18px; }

/* ⚠ Grid- und Flex-Elemente haben min-width: auto und wachsen deshalb auf die
   Breite ihres Inhalts. Die Tagesleiste unten scrollt waagerecht und ist rund
   690 px breit — ohne diese Zeile zieht sie die ganze Seite auf 690 px auf und
   das Telefon scrollt quer. Gemessen am 17.09.2026 im Handy-Browser. */
.chk-form > * { min-width: 0; }
.chk-feld label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.chk-feld input[type="tel"],
.chk-feld input[type="email"] {
    width: 100%; box-sizing: border-box; font: inherit;
    padding: 13px 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}
.chk-feld input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: transparent; }

/* Honigtopf — für Menschen unsichtbar, für Bots verlockend.
   Nicht display:none: manche Bots überspringen genau das. */
.chk-falle {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px; overflow: hidden;
}

/* .chk-tage, .chk-tag, .chk-zeiten, .chk-zeit: seit 15.10.2026 in termin-wahl.css
   (gemeinsam mit der persönlichen Seite zum Werbebrief). */

.chk-einwilligung {
    display: grid; grid-template-columns: 22px 1fr; gap: 12px;
    align-items: start;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); padding: 16px;
}
.chk-einwilligung input { width: 20px; height: 20px; margin: 2px 0 0; }
.chk-einwilligung span { font-size: .9rem; line-height: 1.6; color: var(--color-text-soft); }

.chk-datenschutz { font-size: .82rem; color: var(--color-text-muted); line-height: 1.6; }

.chk-fehler {
    background: var(--color-danger-soft);
    border: 1px solid var(--chk-fehler-rand);
    color: var(--chk-fehler-text);
    padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: .92rem; line-height: 1.55;
}

.chk-danke {
    background: var(--color-success-soft);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
}
.chk-danke h3 { margin: 0 0 10px; font-size: 1.3rem; }
.chk-danke p  { margin: 0 auto; max-width: 46ch; color: var(--color-text-soft); line-height: 1.65; }

[hidden] { display: none !important; }

/* ----- Einbettung auf anderen Seiten ----- */

.chk-teaser {
    background: linear-gradient(135deg, #221c4a 0%, #2c2170 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
}
.chk-teaser h2 { color: #fff; margin: 0 0 12px; }
.chk-teaser p  { color: rgba(255,255,255,.82); max-width: 52ch; margin: 0 auto 24px; line-height: 1.65; }
.chk-teaser .btn { background: #fff; color: #221c4a; }
.chk-teaser .btn:hover { background: #f0eeff; color: #221c4a; }

@media (max-width: 640px) {
    .chk-punkt { grid-template-columns: 12px 1fr; }
    .chk-punkt__wert { grid-column: 2; text-align: left; margin-top: 2px; }
    .chk-kopf, .chk-punkt, .chk-vergleich { padding-left: 20px; padding-right: 20px; }
    .chk-angebot { padding: 22px 20px; }
}

/* Nur für Screenreader. In styles.css gibt es dafür noch keine Klasse. */
.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;
}

/* ----- Unterpunkte der Website-Prüfung ----- */

.chk-unter {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 9px;
    align-items: start;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--color-border-soft);
    font-size: .9rem;
    line-height: 1.5;
}
.chk-unter:first-of-type { margin-top: 14px; }
.chk-unter__zeichen { font-weight: 700; line-height: 1.45; }
.chk-unter.ist-ok    .chk-unter__zeichen { color: var(--color-success); }
.chk-unter.ist-fehlt .chk-unter__zeichen { color: var(--color-danger); }
.chk-unter.ist-fehlt strong { color: var(--color-text); }
.chk-unter.ist-ok    strong { color: var(--color-text-soft); font-weight: 600; }
.chk-unter__befund { color: var(--color-text-soft); margin-top: 2px; }
/* Erfüllte Punkte treten zurück — das Auge soll an den Lücken hängenbleiben. */
.chk-unter.ist-ok .chk-unter__befund { color: var(--color-text-muted); }

.chk-hinweise {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
}
.chk-hinweise__kopf {
    font-size: .76rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--color-text-muted); margin-bottom: 8px;
}
.chk-hinweise ul { margin: 0; padding-left: 18px; }
.chk-hinweise li { color: var(--color-text-soft); font-size: .88rem; line-height: 1.55; margin-bottom: 6px; }
.chk-hinweise li:last-child { margin-bottom: 0; }

/* Reine Anzeige ohne Punkte (seit 07.10.2026: Angaben des Google-Profils
   gehen nicht mehr in die Punktzahl ein). */
.chk-punkt.ist-info .chk-punkt__ampel { background: #b8bec6; }
.chk-punkt.ist-info .chk-punkt__wert  { color: inherit; opacity: .8; }
.chk-score__art { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: 2px; }

/* Website-Eingabe statt Firmensuche (seit 07.10.2026) */
.chk-suche--url { display: flex; gap: 10px; flex-wrap: wrap; }
.chk-suche--url .chk-suche__feld { flex: 1 1 260px; min-width: 0; }
.chk-suche--url .chk-suche__knopf { flex: 0 0 auto; }
