/* ============================================================
   selbstanmeldung.css – Öffentliche Anmeldeseite
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4f8;
    color: #2c3e50;
    min-height: 100vh;
}

/* Header */
.sa-header {
    background: #e74c3c;
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    position: sticky; top: 0; z-index: 100;
}
.sa-header-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.sa-logo { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.sa-event-name { font-size: 14px; opacity: .9; font-weight: 500; }

/* Main */
.sa-main { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }

/* Event card */
.sa-event-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.sa-event-desc { color: #495057; font-size: 14px; margin: 0 0 12px; line-height: 1.6; }
.sa-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #6c757d;
}
.sa-event-meta span { display: flex; align-items: center; gap: 6px; }
.sa-deadline { color: #856404 !important; background: #fff3cd; padding: 3px 10px; border-radius: 10px; }

/* Form card */
.sa-form-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px 26px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.sa-form-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2c3e50;
}
.sa-form-intro { color: #6c757d; font-size: 14px; margin: 0 0 22px; }

/* Fields */
.sa-field { margin-bottom: 20px; }
.sa-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.sa-field label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #495057;
    margin-bottom: 6px;
}
.sa-field label small { font-weight: 400; color: #6c757d; margin-left: 5px; }
.sa-req { color: #e74c3c; }

.sa-field input[type="text"],
.sa-field input[type="email"],
.sa-field input[type="tel"],
.sa-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color .25s;
    font-family: inherit;
}
.sa-field input:focus,
.sa-field textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231,76,60,.12);
}
.sa-field input.sa-invalid { border-color: #dc3545 !important; }
.sa-field textarea { resize: vertical; min-height: 80px; }

/* Type grid */
.sa-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.sa-type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all .2s;
    background: #fff;
}
.sa-type-option input { display: none; }
.sa-type-option:hover { border-color: #c3cdd5; }
.sa-type-option.selected { border-color: #e74c3c; background: #fff5f5; }
.sa-type-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

/* Category grid */
.sa-cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sa-cat-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all .2s;
    background: #fff;
}
.sa-cat-option input { display: none; }
.sa-cat-option:hover { border-color: #c3cdd5; }
.sa-cat-option.selected { border-color: #e74c3c; background: #fff5f5; color: #c0392b; font-weight: 500; }

/* Map */
#sa-map {
    height: 320px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    margin-bottom: 8px;
    transition: border-color .25s;
}
#sa-map.sa-map-has-pin { border-color: #28a745; }
.sa-map-hint { font-size: 13px; color: #6c757d; margin: 0 0 10px; }
.sa-coords {
    font-size: 12px;
    color: #6c757d;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sa-coords.has-pin { color: #155724; background: #d4edda; }

/* Submit */
.sa-submit-row { margin-top: 24px; text-align: center; }
.sa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    text-decoration: none;
}
.sa-btn-primary { background: #e74c3c; color: #fff; }
.sa-btn-primary:hover { background: #c0392b; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(231,76,60,.35); }
.sa-btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.sa-btn-loading::after {
    content: '';
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sa-spin 1s linear infinite;
    margin-left: 8px;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* Blocked state */
.sa-blocked {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}
.sa-blocked i { font-size: 60px; margin-bottom: 20px; color: #c3cdd5; display: block; }
.sa-blocked h2 { font-size: 22px; margin: 0 0 10px; color: #495057; }

/* Success overlay */
.sa-success-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* Leaflet-Controls (Zoom-Buttons, Attribution) unter dem Overlay verbergen */
.sa-success-overlay.show ~ * .leaflet-top,
.sa-success-overlay.show ~ * .leaflet-bottom,
.sa-success-overlay.show ~ * .leaflet-control {
    z-index: 0 !important;
}

/* Sicherster Fix: Map-Container selbst beim Anzeigen des Overlays abdecken */
.sa-success-overlay.show + .sa-main #sa-map,
body.sa-overlay-active #sa-map {
    z-index: 0;
    position: relative;
}

/* Leaflet Pane z-indices reduzieren wenn Overlay aktiv */
body.sa-overlay-active .leaflet-pane,
body.sa-overlay-active .leaflet-top,
body.sa-overlay-active .leaflet-bottom {
    z-index: 0 !important;
}
.sa-success-overlay.show { display: flex; }
.sa-success-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    animation: sa-pop .3s ease;
}
@keyframes sa-pop {
    from { opacity:0; transform:scale(.9); }
    to   { opacity:1; transform:scale(1); }
}
.sa-success-box i { font-size: 56px; color: #28a745; display: block; margin-bottom: 16px; }
.sa-success-box h2 { font-size: 22px; margin: 0 0 10px; }
.sa-success-box p  { color: #6c757d; font-size: 14px; margin: 0 0 20px; line-height: 1.6; }

/* Footer */
.sa-footer { text-align: center; padding: 20px; font-size: 12px; color: #adb5bd; }

/* Responsive */
@media (max-width: 560px) {
    .sa-field-row { grid-template-columns: 1fr; gap: 0; }
    .sa-form-card { padding: 18px 16px; }
    #sa-map { height: 250px; }
}

/* ============================================================
   Adress-Block – ans Ende von selbstanmeldung.css anhängen
   ============================================================ */

/* Adress-Sektion */
.sa-address-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.sa-address-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.sa-address-header label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sa-address-header label i { color: #e74c3c; }

.sa-address-hint {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    line-height: 1.4;
}

/* Straße breit, Hausnummer schmal */
.sa-field-row .sa-field-street { flex: 3; }
.sa-field-row .sa-field-number { flex: 1; min-width: 80px; }

/* PLZ schmal, Stadt breit */
.sa-field-row .sa-field-postal { flex: 1; min-width: 90px; }
.sa-field-row .sa-field-city   { flex: 3; }

/* Lade-Animation für automatisch befüllte Felder */
.sa-address-section input[style*="background"] {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Responsive – auf kleinen Bildschirmen statt grid einfach spalten */
@media (max-width: 560px) {
    .sa-address-section { padding: 12px 14px; }
    .sa-address-header  { flex-direction: column; gap: 4px; }

    /* Straße + Hausnummer in einer Zeile bleiben, PLZ + Stadt auch */
    .sa-field-row .sa-field-street { flex: 2; }
    .sa-field-row .sa-field-number { flex: 1; min-width: 70px; }
    .sa-field-row .sa-field-postal { flex: 1; min-width: 75px; }
    .sa-field-row .sa-field-city   { flex: 2; }
}


/* ── Standort-Button ────────────────────────────────────────────────────────── */
.sa-btn-locate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    margin-bottom: 10px;
    background: #fff;
    color: #2c3e50;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
    font-family: inherit;
}
.sa-btn-locate i { color: #e74c3c; font-size: 13px; }
.sa-btn-locate:hover {
    border-color: #e74c3c;
    background: #fff5f5;
    color: #c0392b;
}
.sa-btn-locate:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.sa-btn-locate .fa-spin { color: #6c757d; }


/* ── Datenschutz-Hinweis unter Kontaktfeldern ───────────────────────────────── */
.sa-privacy-hint {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: -10px 0 20px;
    padding: 9px 13px;
    background: #f0f4f8;
    border-left: 3px solid #adb5bd;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.5;
}
.sa-privacy-hint i { color: #adb5bd; margin-top: 2px; flex-shrink: 0; }
.sa-privacy-hint strong { color: #495057; }

/* ── Teilnahmebedingungen – öffentliche Anmeldeseite ────────────────────────── */
.sa-terms-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.sa-terms-box h4 {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sa-terms-box h4 i { color: #e74c3c; }

/* Scrollbarer Text-Container */
.sa-terms-text {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #495057;
    line-height: 1.7;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 14px;
    white-space: pre-wrap;
    word-break: break-word;
    /* Scrollbar dezent stylen */
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

.sa-terms-text::-webkit-scrollbar { width: 6px; }
.sa-terms-text::-webkit-scrollbar-track { background: transparent; }
.sa-terms-text::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 3px; }

/* Akzeptanz-Checkbox-Zeile */
.sa-terms-accept {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 10px 14px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color .2s, background .2s;
}

.sa-terms-accept:hover { border-color: #e74c3c; background: #fff5f5; }
.sa-terms-accept.accepted { border-color: #28a745; background: #f0fff4; }

.sa-terms-accept input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #e74c3c;
    cursor: pointer;
}

.sa-terms-accept-label {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    user-select: none;
}

.sa-terms-accept-label strong { color: #2c3e50; }

/* Fehler-Zustand */
.sa-terms-accept.sa-invalid {
    border-color: #dc3545 !important;
    background: #fff5f5 !important;
    animation: sa-shake .3s ease;
}

@keyframes sa-shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

/* Responsive */
@media (max-width: 560px) {
    .sa-terms-box { padding: 12px 14px; }
    .sa-terms-text { max-height: 150px; font-size: 12px; }
    .sa-terms-accept { padding: 8px 12px; }
    .sa-terms-accept-label { font-size: 13px; }
}