/*
 * Grundstil der öffentlichen Formulare (Projekt-Check, Störung).
 *
 * Nur das Gerüst: Farben, Typografie, Karten, Kacheln, Schaltflächen, Fortschritt
 * und die fünf Zustände einer Datei. Das Aussehen einzelner Schritte bringt das
 * jeweilige Formular mit.
 *
 * Schriften kommen vom Gerät – keine fremden Hosts (Inhalts-Sicherheitsregel,
 * und eine öffentliche Seite soll nicht verraten, wer sie öffnet).
 */

:root {
    --pf-blue: #224989;
    --pf-cyan: #0682C5;
    --pf-text: #2C3A57;
    --pf-text-soft: #64748B;
    --pf-bg: #EFF3F8;
    --pf-card: #FFFFFF;
    --pf-border: #D3D6E0;
    --pf-green: #15803D;
    --pf-green-bg: #ECFDF3;
    --pf-amber: #B45309;
    --pf-amber-bg: #FEF6E7;
    --pf-red: #B91C1C;
    --pf-red-bg: #FEF2F2;
    --pf-radius: 14px;
    --pf-shadow: 0 4px 12px rgba(44, 58, 87, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

.pf-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--pf-bg);
    color: var(--pf-text);
    font-size: 16px;               /* nie kleiner: iOS zoomt sonst beim Tippen */
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    padding-bottom: env(safe-area-inset-bottom);
}

.pf-shell {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 16px 120px;      /* Platz für die feste Schaltfläche unten */
}

/* --- Kopf mit Fortschritt --- */

.pf-head {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--pf-bg);
    padding: 12px 0 10px;
}

.pf-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--pf-text-soft);
}

.pf-progress {
    height: 6px;
    background: #DCE3ED;
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 6px;
}

.pf-progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pf-blue), var(--pf-cyan));
    transition: width 0.25s ease;
}

.pf-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 4px 0 0;
}

/* --- Karten, Texte --- */

.pf-card {
    background: var(--pf-card);
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
    padding: 18px 16px;
    margin: 0 0 14px;
}

.pf-lead { color: var(--pf-text-soft); margin: 0 0 14px; }
.pf-label { font-weight: 600; font-size: 0.95rem; margin: 0 0 8px; display: block; }
.pf-hint { color: var(--pf-text-soft); font-size: 0.85rem; margin: 6px 0 0; }
.pf-optional { color: var(--pf-text-soft); font-weight: 400; }

/* --- Kacheln (Einfach- und Mehrfachauswahl) --- */

.pf-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.pf-tile {
    border: 1px solid var(--pf-border);
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    min-height: 48px;              /* gut treffbar mit dem Daumen */
}

.pf-tile[aria-pressed="true"],
.pf-tile.is-active {
    border-color: var(--pf-cyan);
    box-shadow: inset 0 0 0 1px var(--pf-cyan);
    background: #F2F9FE;
}

.pf-tile small { display: block; color: var(--pf-text-soft); font-size: 0.8rem; }

/* --- Eingaben --- */

.pf-input,
.pf-textarea,
.pf-select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    font: inherit;
    color: inherit;
    background: #fff;
}

.pf-input:focus,
.pf-textarea:focus,
.pf-select:focus {
    outline: none;
    border-color: var(--pf-cyan);
    box-shadow: 0 0 0 3px rgba(6, 130, 197, 0.14);
}

.pf-counter { display: flex; align-items: center; gap: 12px; }
.pf-counter button {
    width: 44px; height: 44px; border-radius: 10px;
    border: 1px solid var(--pf-border); background: #fff; font-size: 1.3rem; cursor: pointer;
}

/* --- Schaltflächen --- */

.pf-actions {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(239, 243, 248, 0), var(--pf-bg) 35%);
}

.pf-actions-inner { max-width: 560px; margin: 0 auto; display: grid; gap: 8px; }

.pf-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--pf-blue);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.pf-btn:disabled { opacity: 0.5; cursor: default; }
.pf-btn-secondary { background: #fff; color: var(--pf-text); border: 1px solid var(--pf-border); }
.pf-btn-ghost { background: transparent; color: var(--pf-text-soft); border: 0; padding: 8px; }

/* --- Medien: Aufnahme, Vorschau, Pinnadel --- */

.pf-slot { border: 1px dashed var(--pf-border); border-radius: 12px; padding: 16px; text-align: center; background: #FAFCFE; }
.pf-slot-title { font-weight: 600; }
.pf-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pf-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--pf-border); background: #fff; }
.pf-thumb img, .pf-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

.pf-pinwrap { position: relative; display: block; }
.pf-pinwrap img { width: 100%; height: auto; display: block; border-radius: 10px; }
.pf-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    background: var(--pf-blue);
    color: #fff;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pf-pin-alt { background: var(--pf-cyan); }

/* --- Zustände einer Datei --- */

.pf-file { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #EEF1F6; }
.pf-file:first-child { border-top: 0; }
.pf-file-name { flex: 1; min-width: 0; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-file-state { font-size: 0.8rem; color: var(--pf-text-soft); }

.pf-bar { height: 4px; background: #E6EBF2; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.pf-bar > span { display: block; height: 100%; background: var(--pf-cyan); }

.pf-note { border-radius: 10px; padding: 12px 14px; font-size: 0.9rem; margin: 10px 0; }
.pf-note-ok { background: var(--pf-green-bg); color: var(--pf-green); }
.pf-note-warn { background: var(--pf-amber-bg); color: var(--pf-amber); }
.pf-note-error { background: var(--pf-red-bg); color: var(--pf-red); }

/* --- Offline-Hinweis --- */

.pf-offline {
    position: sticky;
    top: 0;
    z-index: 9;
    background: var(--pf-amber-bg);
    color: var(--pf-amber);
    padding: 10px 14px;
    font-size: 0.88rem;
    border-radius: 0 0 10px 10px;
}

[hidden] { display: none !important; }
