/* Narrenzunft „Moorochs“ – Mitgliederdaten
   Mobile-first, ohne externe Abhängigkeiten. */

:root {
    --moos: #2f5d3a;
    --moos-dunkel: #234a2c;
    --moos-hell: #e3ece4;
    --creme: #f5f1e8;
    --weiss: #ffffff;
    --text: #1f2a22;
    --text-gedaempft: #5b665d;
    --rand: #cfd6cf;
    --rot: #b3261e;
    --rot-hell: #fdecea;
    --gelb: #f6d365;
    --gelb-text: #5c4500;
    --gruen-ok: #2e7d32;
    --radius: 12px;
    --schatten: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .04);
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--creme);
    overflow-x: hidden;
}

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
h1:focus, h2:focus { outline: none; }

code { font-family: var(--mono); font-size: .9em; background: var(--moos-hell); padding: 0 .25em; border-radius: 4px; word-break: break-all; }

.mono { font-family: var(--mono); letter-spacing: .02em; }
.klein { font-size: .875rem; }
.gedaempft { color: var(--text-gedaempft); }
.hinweis { color: var(--text-gedaempft); font-size: .9rem; font-weight: normal; }
.pflicht { color: var(--rot); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Honeypot – für Menschen unsichtbar */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------- Seitenrahmen */

.seite { min-height: 100vh; display: flex; flex-direction: column; }

.kopf {
    background: var(--moos);
    color: var(--weiss);
    padding: 1.25rem 1rem 1.5rem;
}

.kopf-innen { max-width: 760px; margin: 0 auto; position: relative; }
.kopf-verein { margin: 0 0 .35rem; font-size: .9rem; opacity: .9; }
.kopf h1 { color: var(--weiss); margin: 0; }
.kopf-text { margin: .6rem 0 0; opacity: .95; }
.kopf-aktion { margin-top: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.kopf-benutzer { font-size: .9rem; opacity: .9; }

.inhalt {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem .75rem 2rem;
    flex: 1;
}

.inhalt.schmal { max-width: 460px; }
.inhalt.breit { max-width: 1200px; }

.fusszeile {
    text-align: center;
    color: var(--text-gedaempft);
    font-size: .85rem;
    padding: 1.25rem 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    justify-content: center;
}

.fuss-links { display: inline-flex; gap: .5rem; }
.fuss-links::before { content: "·"; }

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

.karte {
    background: var(--weiss);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: 1rem;
    margin-bottom: 1rem;
}

.person-karte { border-left: 6px solid var(--moos); }

.karte-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.karte-kopf h2 { margin: 0; }

.text-seite ul { padding-left: 1.2rem; margin: .25rem 0; }
.text-seite li { margin-bottom: .25rem; }

/* ---------------------------------------------------------- Formularfelder */

.abschnitt {
    border: 0;
    border-top: 1px solid var(--rand);
    margin: 1rem 0 0;
    padding: .9rem 0 0;
    min-width: 0;
}

.abschnitt legend {
    font-weight: 700;
    color: var(--moos);
    padding: 0 .4rem 0 0;
}

.felder {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .75rem;
}

.feld { display: flex; flex-direction: column; gap: .25rem; grid-column: span 6; min-width: 0; margin: 0; }
.karte > .feld { margin-top: .75rem; }
.feld-hinweis { margin: 0; }

/* Mobil: Straße + Nr. und PLZ + Ort nebeneinander, alles andere volle Breite */
.felder .spalte-4 { grid-column: span 4; }
.felder .spalte-2 { grid-column: span 2; }
.felder .spalte-3 { grid-column: span 6; }
.felder .spalte-6 { grid-column: span 6; }

@media (min-width: 600px) {
    .felder .spalte-3 { grid-column: span 3; }
    .karte { padding: 1.25rem 1.5rem; }
    .inhalt { padding: 1.5rem 1rem 2.5rem; }
    h1 { font-size: 1.9rem; }
}

label { font-weight: 600; font-size: .95rem; }

input[type="text"], input:not([type]), input[type="email"], input[type="tel"], input[type="date"],
input[type="password"], input[type="search"], textarea, select {
    width: 100%;
    min-height: 44px;
    padding: .55rem .7rem;
    font: inherit;
    font-size: 16px; /* verhindert Zoom auf iOS */
    color: var(--text);
    background: var(--weiss);
    border: 1px solid var(--rand);
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
}

input[type="date"] { min-width: 0; display: block; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }

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

input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid rgba(47, 93, 58, .35);
    outline-offset: 1px;
    border-color: var(--moos);
}

input.mono { font-family: var(--mono); text-transform: uppercase; }

/* Rot markierte, ungültige Felder (Klasse kommt von Blazor) */
input.invalid, textarea.invalid {
    border-color: var(--rot);
    background: var(--rot-hell);
}

input[type="checkbox"].invalid { outline: 2px solid var(--rot); outline-offset: 2px; }

.validation-message { color: var(--rot); font-size: .875rem; }

/* Checkboxen mit großer Touch-Fläche */
.check {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    min-height: 44px;
    padding: .5rem 0;
    font-weight: normal;
    cursor: pointer;
}

.check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0;
    accent-color: var(--moos);
    cursor: pointer;
}

.uebernahme {
    margin-top: .75rem;
    padding: .25rem .75rem;
    background: var(--moos-hell);
    border-radius: 8px;
}

.uebernahme .check { font-weight: 600; }

/* SEPA-Mandat */
.mandat {
    margin-top: 1rem;
    padding: .9rem 1rem;
    background: var(--creme);
    border: 1px solid var(--rand);
    border-radius: 8px;
    font-size: .9rem;
}

.mandat p { margin: 0 0 .6rem; }
.mandat-meta { color: var(--text-gedaempft); }

/* Datei-Upload */
input[type="file"] {
    width: 100%;
    min-height: 44px;
    font: inherit;
    padding: .4rem 0;
}

input[type="file"]::file-selector-button {
    min-height: 44px;
    margin-right: .75rem;
    padding: .5rem 1rem;
    font: inherit;
    font-weight: 600;
    color: var(--moos);
    background: var(--moos-hell);
    border: 1px solid var(--moos);
    border-radius: 8px;
    cursor: pointer;
}

.dateiliste { list-style: none; padding: 0; margin: .5rem 0; }

.dateiliste li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--rand);
}

.dateiname { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
.dateigroesse { color: var(--text-gedaempft); font-size: .875rem; }

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

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .55rem 1.1rem;
    font: inherit;
    font-weight: 600;
    color: var(--moos);
    background: var(--weiss);
    border: 1px solid var(--moos);
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}

.knopf:hover { background: var(--moos-hell); }
.knopf:disabled, .knopf[disabled] { opacity: .55; cursor: not-allowed; }

.knopf-primaer { color: var(--weiss); background: var(--moos); }
.knopf-primaer:hover { color: var(--weiss); background: var(--moos-dunkel); }

.knopf-hell { color: var(--moos); background: var(--weiss); border-color: var(--weiss); }

.knopf-gross { width: 100%; font-size: 1.1rem; min-height: 52px; }

.knopf-klein { min-height: 44px; padding: .4rem .8rem; font-size: .9rem; }

.knopf-gefahr { color: var(--rot); border-color: var(--rot); background: var(--weiss); }
.knopf-gefahr:hover { background: var(--rot-hell); }
.knopf-gefahr-voll { color: var(--weiss); border-color: var(--rot); background: var(--rot); }
.knopf-gefahr-voll:hover { background: #8e1d17; }

.knopf-gestrichelt {
    width: 100%;
    min-height: 56px;
    border: 2px dashed var(--moos);
    background: transparent;
    font-size: 1.05rem;
}

.knopf-reihe { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }

.person-hinzu { margin: 0 0 1.25rem; text-align: center; }
.person-hinzu .hinweis { margin: .4rem 0 0; }

/* ---------------------------------------------------------- Meldungen */

.fehler-box {
    background: var(--rot-hell);
    border: 2px solid var(--rot);
    color: var(--rot);
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}

.fehler-box:focus { outline: 3px solid rgba(179, 38, 30, .35); }
.fehler-box ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.fehler-box p { margin: .25rem 0; }

.fehler-text { color: var(--rot); margin: .35rem 0; font-size: .9rem; }
.erfolg-text { color: var(--gruen-ok); font-weight: 600; }
.warn-text { color: var(--gelb-text); background: #fff6d8; border-radius: 6px; padding: .4rem .6rem; font-size: .9rem; }

.absenden { margin-top: 1.25rem; }
.absenden .hinweis { text-align: center; margin-top: .5rem; }

.bestaetigung { border-left: 6px solid var(--moos); padding: 1.5rem; }
.bestaetigung h2 { color: var(--moos); font-size: 1.5rem; }
.referenz { font-size: 1.25rem; background: var(--moos-hell); padding: .1rem .5rem; border-radius: 6px; }

/* ---------------------------------------------------------- Admin */

.qr-karte { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.qr-vorschau img { display: block; width: 160px; height: 160px; background: var(--weiss); border: 1px solid var(--rand); border-radius: 8px; }
.qr-text { flex: 1 1 16rem; min-width: 0; }
.qr-text p { overflow-wrap: anywhere; }

.werkzeuge {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.suche { flex: 1 1 16rem; }
.statistik { margin: 0; color: var(--text-gedaempft); font-weight: 600; }

.einsendung { border-left: 6px solid var(--gelb); }
.einsendung.ist-uebernommen { border-left-color: var(--gruen-ok); }

.einsendung-kopf {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.einsendung-kopf h2 { margin: 0; }
.plus { color: var(--text-gedaempft); font-weight: normal; }
.einsendung-meta { margin: .2rem 0 0; color: var(--text-gedaempft); font-size: .9rem; }
.einsendung-dateien strong { margin-right: .35rem; }
.einsendung-dateien a { margin-right: .25rem; }
.einsendung-bemerkung { white-space: pre-wrap; background: var(--creme); border-radius: 6px; padding: .5rem .75rem; }

.badge {
    display: inline-block;
    padding: .05rem .5rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    vertical-align: middle;
}

.badge-neu { background: var(--gelb); color: var(--gelb-text); }
.badge-ok { background: var(--gruen-ok); color: var(--weiss); }

.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 760px; }
.tabelle th, .tabelle td { text-align: left; vertical-align: top; padding: .5rem; border-bottom: 1px solid var(--rand); }
.tabelle th { background: var(--moos-hell); color: var(--moos-dunkel); font-weight: 700; white-space: nowrap; }

/* Bestätigungsdialog */
.dialog-hintergrund {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

.dialog {
    background: var(--weiss);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.dialog .knopf-reihe { justify-content: flex-end; margin-top: 1rem; }

/* ---------------------------------------------------------- Blazor */

#blazor-error-ui {
    background: #fff6d8;
    color: var(--text);
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .75rem 3rem .75rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: .5rem;
    top: .25rem;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.4rem;
    background: transparent;
    border: 0;
    cursor: pointer;
}
