* { box-sizing: border-box; }

/* Author-CSS (z.B. "label { display: block }") gewinnt sonst gegen den
   Browser-Standard fuer [hidden], egal welche Spezifitaet die Regel hat -
   das hier stellt sicher, dass .hidden/[hidden] IMMER tatsaechlich versteckt. */
[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    background: #f5f5f2;
    color: #222;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 20px 60px;
}

/* Hintergrundfoto nur auf dem Anmeldeformular (index.php) */
body.page-register {
    background:
        linear-gradient(rgba(20, 30, 15, 0.35), rgba(20, 30, 15, 0.45)),
        url('/assets/images/bg.jpg') center 80% / cover no-repeat fixed;
    min-height: 100vh;
}

body.page-register .container {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    margin: 24px auto;
    padding: 20px 20px 40px;
}

@media (max-width: 500px) {
    body.page-register {
        /* background-attachment: fixed ist auf iOS Safari unzuverlaessig/ruckelig */
        background-attachment: scroll;
    }
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.subheading {
    margin: 0 0 16px;
    font-size: 1rem;
    color: #555;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 0 0 20px;
    padding: 16px;
}

legend {
    font-weight: bold;
    padding: 0 6px;
}

label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.companion-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: #f5f5f2;
    border-radius: 6px;
    padding: 8px 10px;
}

.companion-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    font-size: 1rem;
    border: 1px solid #bbb;
    border-radius: 6px;
}

.birthdate-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.birthdate-group .birthdate-text {
    flex: 1;
}

.birthdate-picker-wrap {
    /* bewusst klein gehalten (nur Icon-Größe) statt auf Feldhöhe gestreckt;
       align-items: center auf .birthdate-group zentriert es neben dem Textfeld. */
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
}

.birthdate-picker {
    /* rein strukturell: Position/Größe des <input type="date">. */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    /* opacity statt nur color/border/background: entfernt zuverlaessig JEDEN
       nativen Rahmen/Chrome des Browsers (auch Firefox), Element bleibt aber
       weiterhin klickbar. Nur unser eigenes Icon (.birthdate-picker-icon) ist sichtbar. */
    opacity: 0;
}

/* Eigene Klasse fuer den Kalender-Icon-Button, getrennt vom normalen Input-Styling
   (input[type="date"] in der Regel oben bei den Textfeldern bleibt unangetastet). */
.date-picker-icon-btn {
    border: none;
    background: transparent;
}

.birthdate-picker-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    pointer-events: none; /* Klicks gehen an das darunterliegende Datumsfeld durch */
}

.participant-row {
    border-top: 1px dashed #ccc;
    padding-top: 12px;
    margin-top: 12px;
}

.participant-row:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.row-price {
    display: block;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
}

button {
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #fff;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#submit-registration,
.primary {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.remove-row {
    background: #fdecea;
    border-color: #c62828;
    color: #c62828;
}

.price-summary {
    margin: 16px 0;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.price-hint {
    font-size: 0.8rem;
    color: #777;
}

.notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.notice-heading {
    margin: 0 0 8px;
    font-weight: bold;
    font-size: 1rem;
}

.notice-list {
    margin: 0 0 12px;
    padding-left: 20px;
}

.notice-list li {
    margin-bottom: 6px;
}

.notice-weather {
    margin: 0;
}

.donation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.donation-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    padding: 8px 12px;
    border: 1px solid #bbb;
    border-radius: 20px;
    cursor: pointer;
}

.donation-options input[type="number"] {
    width: 80px;
    padding: 4px 8px;
    margin-top: 0;
}

.errors {
    background: #fdecea;
    border: 1px solid #c62828;
    color: #c62828;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.qr-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

/* --- Staff-Bereich --- */

.staff-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

.staff-table th,
.staff-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.staff-table th {
    background: #eee;
    position: sticky;
    top: 0;
}

.legend {
    font-size: 0.85rem;
    color: #555;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #1565c0;
    color: #fff;
    font-weight: bold;
    font-size: 0.85rem;
    line-height: 1;
    vertical-align: middle;
}

.cat-badge-companion {
    background: #6a1b9a;
}

.icon-cell {
    text-align: center;
    font-size: 1.2rem;
}

/* Kompakte (aber weiterhin echte) Tabelle fuer schmale Screens
   (z.B. iPhone SE/12/13/14/15 Pro (Max) im Hochformat, ~360-430px) - passt bei
   normalen Namenslaengen ohne seitliches Scrollen, dank kleinerer Schrift/Polster. */
@media (max-width: 700px) and (min-width: 361px) {
    .staff-table {
        font-size: 0.7rem;
    }

    .staff-table th,
    .staff-table td {
        padding: 4px 3px;
    }

    .cat-badge {
        width: 17px;
        height: 17px;
        font-size: 0.62rem;
    }

    .icon-cell {
        font-size: 0.95rem;
    }

    .day-cell .mark-checkin {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
}

/* Auf extrem schmalen Bildschirmen: Tabelle als gestapelte Karten. */
@media (max-width: 360px) {
    .staff-table thead {
        display: none;
    }

    .staff-table, .staff-table tbody, .staff-table tr, .staff-table td {
        display: block;
        width: 100%;
    }

    .staff-table tr {
        margin-bottom: 12px;
        border: 1px solid #ccc;
        border-radius: 8px;
        overflow: hidden;
    }

    .staff-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border: none;
        border-bottom: 1px solid #eee;
    }

    /* Reine Icon-Zellen (Kategorie/Zahlstatus) haben kein Label -> zentriert statt space-between */
    .staff-table td.icon-cell {
        justify-content: center;
        font-size: 1.4rem;
    }

    .staff-table td:last-child {
        border-bottom: none;
    }

    .staff-table td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #666;
        flex-shrink: 0;
    }
}

.status-paid { color: #2e7d32; font-weight: bold; }
.status-pending { color: #c62828; font-weight: bold; }
.status-checked-in { color: #2e7d32; }
.status-warning { color: #e65100; font-weight: bold; }

.scan-result {
    padding: 20px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 1.1rem;
}

.scan-result.ok { background: #e8f5e9; border: 2px solid #2e7d32; }
.scan-result.repeat { background: #e3f2fd; border: 2px solid #1565c0; }
.scan-result.warning { background: #fff3e0; border: 2px solid #e65100; }
.scan-result.error { background: #fdecea; border: 2px solid #c62828; }

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filters input, .filters select {
    padding: 8px;
    font-size: 1rem;
}

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .staff-table th { position: static; }
}
