/*
 * vmcv-visitenkarte — eine einzige, handgeschriebene Stildatei.
 *
 * Kein Vite, kein Tailwind, kein Framework: die Karte wird vom QR-Code aus
 * geoeffnet, oft im ueberlasteten Mobilfunknetz einer Messehalle. Ein
 * Stylesheet, ein Request, keine Webfonts — das ist der ganze Trick.
 * Schriftgroesse nie unter 16 px, Fokus immer sichtbar, beide Farbschemata.
 */

:root {
    color-scheme: light dark;

    --grund: #f4f3ef;
    --flaeche: #ffffff;
    --flaeche-leise: #f0efea;
    --text: #17191c;
    --text-leise: #53585e;
    --linie: #ddded9;
    --akzent: #123a63;
    --akzent-text: #ffffff;
    --akzent-leise: #e6edf5;
    --fokus: #0b62c4;
    --warn-grund: #fdf3d8;
    --warn-linie: #d9b755;
    --warn-text: #4a3806;
    --gut-grund: #e2f3e5;
    --gut-linie: #64ab72;
    --gut-text: #17441f;
    --fehler: #a11a1a;
    --radius: 14px;
    --schatten: 0 1px 2px rgba(15, 20, 30, .06), 0 8px 24px rgba(15, 20, 30, .07);
}

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #101215;
        --flaeche: #1a1d21;
        --flaeche-leise: #23272c;
        --text: #eceef0;
        --text-leise: #b0b6bd;
        --linie: #32373d;
        --akzent: #9cc4ee;
        --akzent-text: #0d1117;
        --akzent-leise: #1e2a38;
        --fokus: #7ab2f5;
        --warn-grund: #3a2f10;
        --warn-linie: #8a7226;
        --warn-text: #f3e3b4;
        --gut-grund: #16301c;
        --gut-linie: #3f7c4d;
        --gut-text: #cde9d3;
        --fehler: #ff9b9b;
        --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    }
}

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

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

body {
    margin: 0;
    padding: 0;
    background: var(--grund);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--akzent);
}

@media (prefers-color-scheme: dark) {
    a {
        color: var(--akzent);
    }
}

:focus-visible {
    outline: 3px solid var(--fokus);
    outline-offset: 2px;
    border-radius: 4px;
}

.nur-fuer-screenreader {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.zum-inhalt {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--flaeche);
    color: var(--text);
    padding: .75rem 1rem;
    z-index: 10;
}

.zum-inhalt:focus {
    left: .5rem;
    top: .5rem;
}

/* --- Geruest ---------------------------------------------------------- */

.huelle {
    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}

.blatt {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    overflow: hidden;
}

.blatt__inhalt {
    padding: 1.5rem 1.25rem 1.75rem;
}

/* Farbbalken der Ur-Verbindung als Akzent ueber der Karte. */
.farbbalken {
    height: 10px;
    background: var(--akzent);
}

/* --- Kopf der Karte --------------------------------------------------- */

.kopf {
    text-align: center;
}

.avatar,
.avatar-bild {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: block;
    margin: 0 auto .9rem;
}

.avatar-bild {
    object-fit: cover;
    background: var(--flaeche-leise);
    border: 3px solid var(--flaeche);
    box-shadow: 0 0 0 1px var(--linie);
}

/*
 * Fallback-Avatar: Initialen auf den Verbindungsfarben. Die Farben sind
 * beliebig hell oder dunkel, darum liegt hinter den Buchstaben eine dunkle
 * Scheibe — sonst ist der Kontrast bei Weiss-Silber-Verbindungen nicht lesbar.
 */
.avatar {
    position: relative;
    background: var(--akzent);
    box-shadow: 0 0 0 1px var(--linie);
}

.avatar__initialen {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: rgba(12, 16, 22, .68);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.name {
    font-size: 1.6rem;
    line-height: 1.25;
    margin: 0 0 .35rem;
    letter-spacing: -.01em;
}

.aemter {
    list-style: none;
    margin: 0 0 .35rem;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}

.aemter li + li {
    margin-top: .1rem;
}

.beiwerk {
    margin: 0;
    color: var(--text-leise);
    font-size: 1rem;
}

.beiwerk + .beiwerk {
    margin-top: .15rem;
}

/* --- Knoepfe ---------------------------------------------------------- */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    min-height: 52px;
    padding: .8rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--linie);
    background: var(--flaeche-leise);
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.knopf:hover {
    border-color: var(--text-leise);
}

.knopf--primaer {
    background: var(--akzent);
    border-color: var(--akzent);
    color: var(--akzent-text);
    font-size: 1.15rem;
    min-height: 58px;
}

.knopf--primaer:hover {
    filter: brightness(1.08);
}

.knopf-reihe {
    display: flex;
    gap: .6rem;
    margin-top: .6rem;
}

.knopf-reihe .knopf {
    flex: 1 1 0;
}

.knopf-block {
    margin-top: 1.4rem;
}

/* --- Kontaktdaten ----------------------------------------------------- */

/*
 * Telefon und Mail stehen hier zusaetzlich als markierbarer Klartext und sind
 * gleichzeitig Links. Wer nur kurz anrufen will, soll nicht durch einen
 * Download-Dialog muessen — und wenn der .vcf-Download scheitert, ist die
 * Seite dadurch keine Sackgasse.
 */
.kontakt {
    margin: 1.5rem 0 0;
    border-top: 1px solid var(--linie);
}

.kontakt dt,
.kontakt dd {
    margin: 0;
}

.kontakt__zeile {
    display: block;
    padding: .8rem .1rem;
    border-bottom: 1px solid var(--linie);
}

.kontakt__titel {
    display: block;
    font-size: .95rem;
    color: var(--text-leise);
    margin-bottom: .1rem;
}

.kontakt__wert {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
}

.kontakt__wert--klartext {
    font-weight: 500;
}

/* --- Hinweise --------------------------------------------------------- */

.hinweis {
    margin: 1.4rem 0 0;
    padding: .85rem 1rem;
    border: 1px solid var(--warn-linie);
    border-radius: 10px;
    background: var(--warn-grund);
    color: var(--warn-text);
    font-size: 1rem;
}

.meldung-gut {
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid var(--gut-linie);
    border-radius: 10px;
    background: var(--gut-grund);
    color: var(--gut-text);
}

.status {
    margin: .6rem 0 0;
    min-height: 1.5rem;
    font-size: .95rem;
    color: var(--text-leise);
    text-align: center;
}

/* --- QR auf dem Bildschirm -------------------------------------------- */

.qr-feld {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--linie);
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
}

.qr-feld img {
    width: 100%;
    max-width: 260px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qr-feld p {
    margin: .6rem 0 0;
    color: #444;
    font-size: .95rem;
}

/* --- Einordnung und Fuss ---------------------------------------------- */

.verband {
    margin: 1.6rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--linie);
    color: var(--text-leise);
    font-size: .98rem;
}

.verband p {
    margin: 0 0 .4rem;
}

.fuss {
    margin: 1.5rem auto 0;
    max-width: 34rem;
    text-align: center;
    color: var(--text-leise);
    font-size: .95rem;
}

.fuss a {
    color: var(--text-leise);
    margin: 0 .45rem;
}

/* --- Formular --------------------------------------------------------- */

.feld {
    margin-bottom: 1.15rem;
}

.feld label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
}

.feld input[type="text"],
.feld input[type="email"],
.feld input[type="tel"],
.feld input[type="url"],
.feld input[type="password"],
.feld input[type="file"],
.feld textarea {
    width: 100%;
    font: inherit;
    font-size: 1.05rem;
    padding: .7rem .75rem;
    border: 1px solid var(--linie);
    border-radius: 9px;
    background: var(--flaeche);
    color: var(--text);
}

.feld textarea {
    min-height: 6rem;
    resize: vertical;
}

.feld--schmal {
    display: flex;
    gap: .7rem;
}

.feld--schmal > div:first-child {
    flex: 0 0 8rem;
}

.feld--schmal > div:last-child {
    flex: 1 1 auto;
}

.hilfe {
    display: block;
    margin-top: .25rem;
    color: var(--text-leise);
    font-size: .93rem;
}

.fehler {
    display: block;
    margin-top: .3rem;
    color: var(--fehler);
    font-weight: 600;
    font-size: .95rem;
}

.einwilligung {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin: 1.5rem 0 .9rem;
    padding: .9rem 1rem;
    border: 1px solid var(--linie);
    border-radius: 10px;
    background: var(--flaeche-leise);
}

.einwilligung input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    margin: .15rem 0 0;
    flex: 0 0 auto;
}

.einwilligung label {
    font-size: 1rem;
}

.signatur {
    margin: 1.25rem 0 0;
    padding: .9rem 1rem;
    border: 1px solid var(--linie);
    border-radius: 10px;
    background: var(--flaeche-leise);
}

.signatur pre {
    margin: .5rem 0 .7rem;
    padding: .7rem .8rem;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .95rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.abschnitt-titel {
    margin: 2rem 0 .8rem;
    font-size: 1.15rem;
    border-bottom: 1px solid var(--linie);
    padding-bottom: .35rem;
}

.vorschau {
    display: flex;
    gap: .9rem;
    align-items: center;
    padding: .9rem 1rem;
    border: 1px solid var(--linie);
    border-radius: 10px;
    background: var(--flaeche-leise);
}

.vorschau .avatar,
.vorschau .avatar-bild {
    width: 72px;
    height: 72px;
    margin: 0;
    flex: 0 0 auto;
}

.vorschau .avatar__initialen {
    inset: 8px;
    font-size: 1.3rem;
}

.vorschau__text {
    min-width: 0;
}

.vorschau__name {
    font-weight: 700;
    font-size: 1.05rem;
}

.vorschau__zeile {
    color: var(--text-leise);
    font-size: .95rem;
    overflow-wrap: anywhere;
}

/* --- Textseiten ------------------------------------------------------- */

.text h1 {
    font-size: 1.5rem;
    margin-top: 0;
}

.text h2 {
    font-size: 1.15rem;
    margin: 1.6rem 0 .4rem;
}

.text p,
.text li {
    font-size: 1rem;
}

.text ul {
    padding-left: 1.2rem;
}

@media (max-width: 26rem) {
    .huelle {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .blatt__inhalt {
        padding: 1.25rem 1rem 1.5rem;
    }

    .feld--schmal {
        display: block;
    }

    .feld--schmal > div:first-child {
        margin-bottom: 1.15rem;
    }
}

@media print {
    .knopf,
    .knopf-reihe,
    .hinweis,
    .status {
        display: none !important;
    }
}

.abstand-oben {
    margin-top: .8rem;
}
