/* PageRenk Creator: Oberflaeche fuer Anmeldung und Konto. Handy zuerst, ohne Frameworks, ohne Fremd-CDNs.
   Alle Farbpaare erreichen mindestens 4,5:1 (tests/Feature/Identity/AccessibilityTest.php). */
:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #16202b;
    --muted: #455261;
    --primary: #1d4ed8;
    --primary-text: #ffffff;
    --link: #1e40af;
    --error: #b42318;
    --success: #146c43;
    --border: #6b7785;
    --radius: 12px;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.5;
}

.skip {
    position: absolute;
    left: 16px;
    top: -100px;
    background: var(--surface);
    color: var(--link);
    padding: 12px 16px;
    border-radius: var(--radius);
}
.skip:focus { top: 8px; }

.top { padding: 16px; }
.brand { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; display: inline-block; padding: 8px 0; }
.menu ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.menu a { display: inline-block; padding: 12px 0; min-height: 48px; box-sizing: border-box; font-weight: 600; }
.menu a[aria-current="page"] { color: var(--text); text-decoration-thickness: 3px; }
.notice.calm { border-color: var(--border); color: var(--text); font-weight: 400; }
span.btn[aria-disabled="true"], .locked li[aria-disabled="true"] { opacity: .7; cursor: not-allowed; }
span.btn[aria-disabled="true"] { display: block; text-align: center; background: var(--surface); color: var(--muted); border: 2px dashed var(--border); }
.locked li { padding: 12px 0; min-height: 48px; box-sizing: border-box; color: var(--muted); }
progress { width: 100%; height: 16px; }

.page { max-width: 32rem; margin: 0 auto; padding: 8px 16px 48px; }

h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 16px; }
.lead { font-size: 19px; color: var(--text); margin: 0 0 20px; }
.hint { font-size: 16px; color: var(--muted); margin: 6px 0 0; }

a { color: var(--link); text-underline-offset: 3px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    margin: 0 0 20px;
}

.field { margin: 0 0 20px; }

label { display: block; font-weight: 600; margin: 0 0 6px; }

input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    font: inherit;
    font-size: 18px;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
}

input[aria-invalid="true"] { border-color: var(--error); }

.btn {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;
    font: inherit;
    font-weight: 700;
    color: var(--primary-text);
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-quiet {
    color: var(--link);
    background: var(--surface);
    border-color: var(--border);
    margin-top: 12px;
}

:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

.error { color: var(--error); font-weight: 600; margin: 8px 0 0; }

.notice { padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--success); color: var(--success); font-weight: 600; }
.notice.success { border-color: var(--success); }

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

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.support-banner { background: var(--error); color: var(--primary-text); padding: 12px 16px; font-weight: 600; }
.support-banner .btn-quiet { color: var(--primary-text); border-color: var(--primary-text); }
.inline { display: inline; }
.error-box { border-color: var(--error); color: var(--error); }
dl.card dt { font-weight: 600; margin-top: 8px; }
dl.card dd { margin: 0; }
code { word-break: break-all; }

/* Gefuehrter Aufbau (B2.2): Fortschritt und Auswahlkacheln. Tippflaechen mindestens 48 Pixel hoch. */
select, textarea { display: block; width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 18px; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-radius: 8px; }
select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }

.progress-label { margin: 8px 0 6px; color: var(--muted); font-weight: 600; }
.progress { display: flex; gap: 6px; margin: 0 0 20px; }
.progress span { flex: 1; height: 8px; border-radius: 4px; background: var(--border); }
.progress span.on { background: var(--primary); }

.btn-primary { margin-top: 8px; }
.address { display: flex; align-items: center; gap: 8px; }
.address input { flex: 1; min-width: 0; }
.address span { flex: none; color: var(--muted); }
/* Postfach der Anfragen (B5.3): grosse Tippflaechen fuer den Daumen. */
.inbox { list-style: none; margin: 0 0 20px; padding: 0; }
.inbox li { margin: 0 0 10px; }
.inbox-item { display: block; min-height: 72px; padding: 12px 16px; color: var(--text); text-decoration: none; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); }
.inbox-item:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.inbox-item strong, .inbox-excerpt, .inbox-meta { display: block; }
.inbox-excerpt { color: var(--text); overflow-wrap: anywhere; }
.inbox-meta { color: var(--muted); font-size: 16px; margin-top: 4px; }
.mail-failed { color: var(--error); font-weight: 600; }
.badge { display: inline-block; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-weight: 600; color: var(--text); }
.badge-new { border-color: var(--primary); color: var(--link); }
ul.plain { list-style: none; margin: 0 0 12px; padding: 0; }
ul.plain a { display: inline-block; padding: 12px 0; min-height: 48px; box-sizing: border-box; }
a.btn { text-align: center; text-decoration: none; }

.choices { border: 0; margin: 0 0 20px; padding: 0; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px; margin: 0 0 10px; font-weight: 400; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--bg); }
.choice:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 3px; }
.choice input { flex: none; width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--primary); }
.choice-icon { flex: none; color: var(--primary); }
.choice-text { display: block; }
.choice-text strong, .choice-text small { display: block; }
.choice-text small { color: var(--muted); font-size: 16px; }
.choice.is-off { cursor: not-allowed; color: var(--muted); border-style: dashed; }

@media (min-width: 40rem) {
    .btn { display: inline-block; width: auto; min-width: 12rem; }
    h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
.media-item img { display: block; max-width: 100%; height: auto; border-radius: 6px; margin-bottom: 12px; }
input[type="file"] { width: 100%; min-height: 48px; font-size: 18px; }
.block-card h3 { margin: 0 0 6px; font-size: 20px; }
.block-summary { color: var(--muted); overflow-wrap: anywhere; margin: 0 0 12px; }
.block-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.block-actions form { margin: 0; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset.field { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
fieldset.field legend { font-weight: 600; padding: 0 6px; }
.list-item { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.choice img { flex: none; border-radius: 4px; }
textarea { width: 100%; font: inherit; font-size: 18px; min-height: 120px; box-sizing: border-box; }
.page-title { margin: 0 0 4px; font-size: 20px; }
.media-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin: 0 0 16px; }
.media-grid .media-item { margin: 0; }
.media-toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.media-toolbar .field { margin: 0; }
.view-switch ul { list-style: none; display: flex; gap: 16px; margin: 0 0 12px; padding: 0; }
.view-switch a[aria-current="page"] { font-weight: 700; text-decoration: none; color: inherit; }
.table-scroll { overflow-x: auto; margin: 0 0 16px; }
.media-table { width: 100%; border-collapse: collapse; }
.media-table th, .media-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.media-table img { display: block; border-radius: 4px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0 0 16px; }
