/* ============================================================
   MailTester - eigenes Stylesheet (kein Framework)
   Farbschema: Dunkelblau #1a2332, Weiss, Cyan #00b4d8
   Mobile-first, keine externen Ressourcen
   ============================================================ */

:root {
    --dunkel:        #1a2332;
    --dunkel-2:      #223046;
    --dunkel-3:      #2c3d57;
    --cyan:          #00b4d8;
    --cyan-hell:     #48cae4;
    --cyan-dunkel:   #0096b7;
    --weiss:         #ffffff;
    --text:          #e8edf4;
    --text-leise:    #a3b1c6;
    --gruen:         #2ec27e;
    --gelb:          #f0c419;
    --orange:        #f4801a;
    --rot:           #e63946;
    --rand:          rgba(255, 255, 255, 0.10);
    --schatten:      0 4px 20px rgba(0, 0, 0, 0.35);
    --radius:        10px;
    --schrift:       system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono:          ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

/* --- Grundlagen ------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--dunkel);
    color: var(--text);
    font-family: var(--schrift);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    line-height: 1.25;
    margin: 0 0 0.6rem;
    color: var(--weiss);
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }

p { margin: 0 0 0.9rem; }

a {
    color: var(--cyan);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

code, pre {
    font-family: var(--mono);
}

.behaelter {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1rem;
}

.klein {
    font-size: 0.85rem;
    color: var(--text-leise);
}

.warnung {
    color: var(--gelb);
}

.sr-nur {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

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

.kopf {
    background: linear-gradient(180deg, #16202e 0%, var(--dunkel) 100%);
    border-bottom: 1px solid var(--rand);
    padding: 0.9rem 0;
}

.kopf-inhalt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.marke {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--weiss);
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.marke:hover { text-decoration: none; }

.marke strong { color: var(--cyan); font-weight: 700; }

.marke-symbol { color: var(--cyan); display: inline-flex; }

.kopf-hinweis {
    font-size: 0.8rem;
    color: var(--text-leise);
    font-family: var(--mono);
}

/* --- Hauptbereich ----------------------------------------- */

main {
    flex: 1 0 auto;
    padding: 1.6rem 0 3rem;
}

.einleitung {
    text-align: center;
    margin-bottom: 1.6rem;
}

.einleitung h1 {
    font-size: 1.75rem;
    margin-bottom: 0.7rem;
}

.einleitung p {
    color: var(--text-leise);
    max-width: 620px;
    margin: 0 auto;
}

/* --- Karten ----------------------------------------------- */

.karte {
    background: var(--dunkel-2);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.1rem;
    box-shadow: var(--schatten);
}

.karte-fehler {
    border-left: 4px solid var(--rot);
}

.schritt {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--cyan);
    background: rgba(0, 180, 216, 0.12);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    margin: 0 0 0.6rem;
    font-weight: 600;
}

/* --- Testadresse ------------------------------------------ */

.adress-zeile {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.6rem;
    margin: 1rem 0 0.8rem;
}

.testadresse {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    align-items: center;
    background: var(--dunkel);
    border: 1px dashed var(--cyan);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    font-size: 1.02rem;
    color: var(--cyan-hell);
    word-break: break-all;
    user-select: all;
}

.ablauf-hinweis {
    font-size: 0.85rem;
    color: var(--text-leise);
    margin: 0;
}

.ablauf-hinweis strong { color: var(--text); }

/* --- Schaltflaechen --------------------------------------- */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--cyan);
    color: #04202b;
    border: 1px solid var(--cyan);
    border-radius: var(--radius);
    padding: 0.75rem 1.15rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.knopf:hover {
    background: var(--cyan-hell);
    text-decoration: none;
}

.knopf:active { transform: translateY(1px); }

.knopf:focus-visible {
    outline: 2px solid var(--weiss);
    outline-offset: 2px;
}

.knopf-rand {
    background: transparent;
    color: var(--cyan);
}

.knopf-rand:hover {
    background: rgba(0, 180, 216, 0.12);
}

.knopf-klein {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
}

.knopf-kopieren.erfolg {
    background: var(--gruen);
    border-color: var(--gruen);
    color: #04240f;
}

/* --- Wartebereich ----------------------------------------- */

.warte-anzeige {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 0.9rem 0;
}

.warte-anzeige p { margin: 0; }

.spinner {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(0, 180, 216, 0.22);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: drehen 0.9s linear infinite;
}

.warte-karte.empfangen .spinner {
    border-color: rgba(46, 194, 126, 0.25);
    border-top-color: var(--gruen);
}

@keyframes drehen {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 3s; }
}

/* --- Infoliste -------------------------------------------- */

.pruef-liste {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-leise);
}

.pruef-liste li { margin-bottom: 0.35rem; }

.pruef-liste strong { color: var(--text); }

/* --- Ergebnisseite: Score --------------------------------- */

.score-karte {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
}

.score-kreis {
    width: 190px;
    height: 190px;
}

.score-spur {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 14;
}

.score-fortschritt {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 100px 100px;
    animation: kreis-fuellen 1.2s ease-out forwards;
}

@keyframes kreis-fuellen {
    to { stroke-dashoffset: var(--ziel-offset); }
}

@media (prefers-reduced-motion: reduce) {
    .score-fortschritt {
        animation: none;
        stroke-dashoffset: var(--ziel-offset);
    }
}

.score-zahl {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--schrift);
}

.score-max {
    font-size: 0.95rem;
    fill: var(--text-leise);
}

.score-text { width: 100%; }

.bewertung {
    font-size: 1.02rem;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    background: var(--dunkel);
}

.bewertung-kritisch  { color: var(--rot);    border-left: 4px solid var(--rot); }
.bewertung-schlecht  { color: var(--orange); border-left: 4px solid var(--orange); }
.bewertung-gut       { color: var(--gelb);   border-left: 4px solid var(--gelb); }
.bewertung-sehr-gut  { color: var(--gruen);  border-left: 4px solid var(--gruen); }

.score-fakten {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem 1rem;
    text-align: left;
    margin: 1.1rem 0;
    font-size: 0.9rem;
}

.score-fakten dt {
    color: var(--text-leise);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-fakten dd {
    margin: 0 0 0.6rem;
    word-break: break-all;
}

.score-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

/* --- Ergebnisseite: Einzelpruefungen ---------------------- */

.abschnitt-titel {
    margin: 1.8rem 0 0.9rem;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-leise);
}

.pruefung {
    background: var(--dunkel-2);
    border: 1px solid var(--rand);
    border-left-width: 4px;
    border-radius: var(--radius);
    margin-bottom: 0.7rem;
    overflow: hidden;
}

.pruefung-pass { border-left-color: var(--gruen); }
.pruefung-warn { border-left-color: var(--gelb); }
.pruefung-fail { border-left-color: var(--rot); }

.pruefung > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.pruefung > summary::-webkit-details-marker { display: none; }

.pruefung > summary:hover { background: rgba(255, 255, 255, 0.03); }

.pruefung > summary:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}

.pruef-symbol {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.pruefung-pass .pruef-symbol { background: rgba(46, 194, 126, 0.18); color: var(--gruen); }
.pruefung-warn .pruef-symbol { background: rgba(240, 196, 25, 0.18);  color: var(--gelb); }
.pruefung-fail .pruef-symbol { background: rgba(230, 57, 70, 0.18);   color: var(--rot); }

.pruef-name {
    flex: 1 1 auto;
    font-weight: 600;
    color: var(--weiss);
}

.pruef-punkte {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-leise);
    white-space: nowrap;
}

.pruefung > summary::after {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-leise);
    border-bottom: 2px solid var(--text-leise);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-left: 0.2rem;
}

.pruefung[open] > summary::after {
    transform: rotate(-135deg);
}

.pruef-inhalt {
    padding: 0 1.1rem 1.1rem;
    border-top: 1px solid var(--rand);
    padding-top: 1rem;
}

.pruef-zusammenfassung {
    font-size: 0.98rem;
    color: var(--text);
}

/* --- Infobox mit Behebungshinweis ------------------------- */

.infobox {
    background: rgba(0, 180, 216, 0.10);
    border: 1px solid rgba(0, 180, 216, 0.35);
    border-left: 4px solid var(--cyan);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin: 0.9rem 0;
    font-size: 0.92rem;
}

.infobox strong {
    display: block;
    color: var(--cyan-hell);
    margin-bottom: 0.3rem;
}

.infobox p { margin: 0; }

/* --- Detaildarstellung ------------------------------------ */

.pruef-details { margin-top: 0.9rem; }

.detail-tabelle {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    font-size: 0.88rem;
}

.detail-tabelle dt {
    color: var(--text-leise);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 0.55rem;
}

.detail-tabelle dd {
    margin: 0 0 0.25rem;
    word-break: break-word;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-tabelle.verschachtelt {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    padding: 0.3rem 0.75rem 0.5rem;
    margin-top: 0.25rem;
}

.detail-liste {
    margin: 0;
    padding-left: 1.1rem;
}

.detail-liste li { margin-bottom: 0.2rem; }

.wert { color: var(--text); }
.wert-ja   { color: var(--gruen); font-weight: 600; }
.wert-nein { color: var(--rot);   font-weight: 600; }
.wert-leer { color: var(--text-leise); font-style: italic; }

/* --- Codebloecke ------------------------------------------ */

.codeblock {
    background: #0f1620;
    border: 1px solid var(--rand);
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    margin: 0.4rem 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #cbd6e6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.codeblock-gross {
    max-height: 480px;
    overflow-y: auto;
    white-space: pre;
    word-break: normal;
}

/* --- Rohdaten-Aufklapper ---------------------------------- */

.rohdaten { margin-bottom: 0.6rem; }

.rohdaten > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.4rem 0;
}

.rohdaten > summary::-webkit-details-marker { display: none; }

.rohdaten > summary h2 {
    display: inline;
    font-size: 1rem;
}

.rohdaten > summary::before {
    content: "\25B8";
    color: var(--cyan);
    margin-right: 0.5rem;
}

.rohdaten[open] > summary::before {
    content: "\25BE";
}

/* --- Fussbereich ------------------------------------------ */

.fuss {
    flex: 0 0 auto;
    border-top: 1px solid var(--rand);
    padding: 1.2rem 0;
    background: #16202e;
}

.fuss p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-leise);
    text-align: center;
}

/* --- Hinweisfenster (Kopieren) ---------------------------- */

.hinweis-blase {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    background: var(--gruen);
    color: #04240f;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--schatten);
    z-index: 50;
    animation: einblenden 0.25s ease-out;
}

@keyframes einblenden {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Ab Tablet-Breite ------------------------------------- */

@media (min-width: 640px) {
    h1 { font-size: 1.9rem; }

    .einleitung h1 { font-size: 2.1rem; }

    .karte { padding: 1.7rem; }

    .score-karte {
        flex-direction: row;
        text-align: left;
        align-items: center;
        gap: 2rem;
    }

    .score-kreis {
        width: 210px;
        height: 210px;
        flex: 0 0 auto;
    }

    .score-aktionen { justify-content: flex-start; }

    .score-fakten {
        grid-template-columns: auto 1fr;
        align-items: baseline;
    }

    .score-fakten dt { padding-top: 0; }

    .detail-tabelle {
        grid-template-columns: minmax(140px, 220px) 1fr;
        column-gap: 1rem;
    }

    .detail-tabelle dt {
        padding-top: 0.35rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 0.35rem;
    }
}
