/* =========================================================================
   E-Rechnung Selbsttest
   Eigene Datei, damit style.css unberuehrt bleibt. Verwendet ausschliesslich
   die vorhandenen Tokens (--ink, --green, --rule, --edge ...), damit der Test
   nicht wie ein Fremdkoerper wirkt.
   ========================================================================= */

/* ---------- Auffaelliger Abschnitt auf der Startseite ---------- */
.st-band {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    background:
        radial-gradient(900px 320px at 88% -10%, var(--green-wash), transparent 62%),
        var(--card-2);
}

.st-band-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    align-items: center;
    gap: 44px;
}

.st-band h2 {
    margin: 16px 0 0;
    font-size: clamp(26px, 2.4vw, 38px);
    line-height: 1.12;
    letter-spacing: -.02em;
}

.st-band-lead {
    margin-top: 14px;
    max-width: 52ch;
    color: var(--ink-soft);
    font-size: clamp(15px, 1.2vw, 17px);
    line-height: 1.6;
}

.st-band-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

.st-band-points li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--card);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}

.st-band-points li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--green);
}

.st-band-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
}

.st-band-note {
    color: var(--ink-faint);
    font-size: 13px;
    font-weight: 600;
}

/* Vorschaukarte rechts: zeigt, wie der Test aussieht, ohne ihn zu oeffnen */
.st-preview {
    border: 1px solid var(--rule);
    border-radius: var(--edge);
    background: var(--card);
    box-shadow: 0 24px 60px rgba(11, 31, 25, .09);
    overflow: hidden;
}

.st-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rule);
    background: var(--card-2);
    font-size: 12px;
    font-weight: 800;
    color: var(--ink-soft);
}

.st-preview-head span:last-child { color: var(--ink-faint); font-weight: 700; }

.st-preview-body { padding: 16px; }

.st-preview-q {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -.01em;
}

.st-preview-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    margin-bottom: 7px;
    color: var(--ink-soft);
    font-size: 13.5px;
    font-weight: 600;
}

.st-preview-opt:last-child { margin-bottom: 0; }

.st-preview-opt.is-marked {
    border-color: var(--green-line);
    background: var(--green-wash);
    color: var(--green-ink);
    font-weight: 800;
}

.st-preview-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--card-2);
    font-size: 10.5px;
    font-weight: 900;
}

/* ---------- Schmaler Wiederholungsstreifen ---------- */
.st-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 auto;
    padding: 18px 22px;
    border: 1px solid var(--green-line);
    border-left: 4px solid var(--green);
    border-radius: var(--edge);
    background: var(--green-wash);
}

.st-strip-copy strong {
    display: block;
    font-size: 17px;
    letter-spacing: -.01em;
    color: var(--ink);
}

.st-strip-copy span {
    display: block;
    margin-top: 3px;
    color: var(--ink-soft);
    font-size: 13.5px;
}

/* ---------- Schwebender Aufruf ---------- */
.st-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 250;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(11, 31, 25, .28);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.st-float.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.st-float:hover { background: var(--green-ink); }

.st-float-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #6ee7a8;
}

.st-float-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.st-float-close:hover { background: rgba(255, 255, 255, .28); }

/* ---------- Dialog ---------- */
.st-modal {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px 16px;
    background: rgba(11, 31, 25, .55);
    backdrop-filter: blur(3px);
}

.st-modal.open { display: flex; }

.st-card {
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 44px);
    display: flex;
    flex-direction: column;
    border-radius: var(--edge);
    background: var(--card);
    box-shadow: 0 30px 80px rgba(11, 31, 25, .35);
    overflow: hidden;
}

.st-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--rule);
    background: var(--card-2);
}

.st-head h3 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
.st-head p { margin: 5px 0 0; color: var(--ink-soft); font-size: 13px; }

.st-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--rule-strong);
    border-radius: var(--edge-sm, 8px);
    background: none;
    color: var(--ink-soft);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.st-close:hover { border-color: var(--ink); color: var(--ink); }

.st-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    border-bottom: 1px solid var(--rule);
    background: var(--card-2);
}

.st-progress-track {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: rgba(11, 31, 25, .10);
    overflow: hidden;
}

.st-progress-bar {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--green);
    transition: width .25s ease;
}

.st-progress-text {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--ink-soft);
    white-space: nowrap;
}

.st-stage { padding: 22px 24px; overflow-y: auto; }

.st-step {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 9px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--card-2);
    color: var(--ink-faint);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.st-q { margin: 0 0 5px; font-size: 19px; line-height: 1.3; letter-spacing: -.015em; }
.st-note { margin: 0 0 16px; color: var(--ink-soft); font-size: 13.5px; }

.st-options { display: grid; gap: 8px; }

.st-option {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--rule);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease;
}

.st-option:hover { border-color: var(--green-line); background: var(--green-wash); }
.st-option:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.st-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--card-2);
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 900;
}

.st-option:hover .st-key { border-color: var(--green-line); background: var(--card); color: var(--green-ink); }

.st-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 24px;
    border-top: 1px solid var(--rule);
    background: var(--card-2);
}

.st-back {
    border: 0;
    background: none;
    padding: 5px 2px;
    color: #154d76;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.st-back:hover { color: #0f3a5a; }
.st-back[hidden] { display: none; }

.st-hint { color: var(--ink-faint); font-size: 12px; font-weight: 600; }

/* ---------- Ergebnis ---------- */
.st-flag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 11px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.st-flag::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

.st-flag.is-red   { background: var(--red-wash);   color: var(--red);      border: 1px solid var(--red-line); }
.st-flag.is-amber { background: var(--amber-wash); color: var(--amber);    border: 1px solid rgba(168, 115, 10, .4); }
.st-flag.is-green { background: var(--green-wash); color: var(--green-ink); border: 1px solid var(--green-line); }

.st-result h4 { margin: 0 0 7px; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; }
.st-result-lead { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }

.st-todo { display: grid; gap: 9px; margin: 0 0 18px; padding: 0; list-style: none; }

.st-todo li {
    padding: 13px 15px;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--green);
    border-radius: 10px;
    background: var(--card-2);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-soft);
}

.st-todo li.is-crit { border-left-color: var(--red); }
.st-todo li.is-warn { border-left-color: var(--amber); }
.st-todo li.is-ok   { border-left-color: var(--green); }

.st-todo strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 14px; font-weight: 800; }

.st-law {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--rule);
    color: var(--ink-faint);
    font-size: 11.5px;
    line-height: 1.5;
}

.st-cta {
    padding: 16px 17px;
    border: 1px solid var(--green-line);
    border-left: 3px solid var(--green);
    border-radius: 10px;
    background: var(--green-wash);
}

.st-cta strong { display: block; margin-bottom: 4px; color: var(--green-ink); font-size: 14.5px; }
.st-cta p { margin: 0 0 13px; color: var(--ink-soft); font-size: 13.5px; }

.st-cta-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.st-cta-note { margin: 11px 0 0 !important; color: var(--ink-faint) !important; font-size: 11.5px !important; }

.st-restart {
    margin-top: 14px;
    border: 0;
    background: none;
    padding: 4px 2px;
    color: var(--ink-faint);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.st-restart:hover { color: var(--ink); }

.st-legal { margin: 16px 0 0; color: var(--ink-faint); font-size: 11.5px; line-height: 1.55; }

/* ---------- Schmale Fenster ---------- */
@media (max-width: 900px) {
    .st-band-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .st-preview { display: none; }
}

@media (max-width: 620px) {
    .st-float { right: 12px; bottom: 12px; padding: 11px 15px; font-size: 13px; }
    .st-head, .st-stage, .st-foot, .st-progress { padding-left: 17px; padding-right: 17px; }
    .st-strip { flex-direction: column; align-items: flex-start; }
}
