/* ============================================================
   FF Nettelrede – 100 Jahre Jubiläumsquiz
   Design: Cremeweiß · Ziegelrot · Handschrift-Akzente
   Angelehnt an foerderverein-feuerwehr-nettelrede.de
   Mobile-First · 100% responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

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

:root {
    /* ── Echte Förderverein-Farben ── */
    --red:          #C8341A;
    --red-dark:     #A62814;
    --red-hover:    #D94020;
    --red-subtle:   #F9EDE9;
    --red-border:   rgba(200,52,26,0.2);

    /* ── Cremeweiß-Töne ── */
    --cream:        #FAF7F4;
    --cream-2:      #F5F0EB;
    --cream-3:      #EDE7DF;
    --white:        #FFFFFF;

    /* ── Textfarben ── */
    --text:         #1C1209;
    --text-2:       #4A3F35;
    --text-3:       #8A7A6E;
    --text-4:       #BFB3A8;

    /* ── Borders ── */
    --border:       rgba(180,160,140,0.25);
    --border-mid:   rgba(180,160,140,0.45);

    /* ── Status ── */
    --success:      #2D7A3A;
    --success-bg:   #EDF7EF;
    --warn:         #B45309;
    --warn-bg:      #FEF9EE;
    --info:         #1D5F8A;
    --info-bg:      #EEF5FB;
    --danger:       #C8341A;

    /* ── Layout ── */
    --radius:       12px;
    --radius-sm:    8px;
    --radius-lg:    18px;
    --shadow:       0 2px 12px rgba(100,60,30,0.08);
    --shadow-md:    0 4px 20px rgba(100,60,30,0.12);
    --shadow-red:   0 4px 18px rgba(200,52,26,0.28);

    /* ── Fonts ── */
    --font-script:  'Caveat', cursive;           /* Handschrift-Akzente wie "Nettelrede" */
    --font-serif:   'Lora', Georgia, serif;      /* Überschriften */
    --font-body:    'DM Sans', system-ui, sans-serif; /* Fließtext */
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════════════════
   HEADER – roter Hintergrund, Schriftzug-Bild passt nahtlos
   ══════════════════════════════════════════════════════════ */
.site-header {
    background: linear-gradient(160deg, var(--red-dark) 0%, var(--red) 60%, var(--red-hover) 100%);
    border-bottom: none;
    padding: 28px 20px 38px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Weiche Welle zum crème Inhalt hin */
.site-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 30px;
    background: var(--cream);
    clip-path: ellipse(56% 100% at 50% 100%);
    pointer-events: none;
}

.header-logo {
    height: 68px;
    margin: 0 auto 12px;
    display: block;
    /* Logo auf rotem BG: Helligkeit leicht erhöhen */
    filter: brightness(1.1) drop-shadow(0 2px 10px rgba(0,0,0,0.25));
}

/* Schriftzug-Bild hat selbst roten BG → sitzt nahtlos im roten Header */
.header-schriftzug {
    display: block;
    max-width: 240px;
    height: auto;
    margin: 0 auto 16px;
    border-radius: 12px;
    /* Schatten damit es leicht "schwebt" */
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 16px;
    margin-bottom: 14px;
    color: rgba(255,255,255,0.92);
}

/* Überschrift und Text auf rotem BG → weiß */
.site-header h1 {
    font-family: var(--font-script);
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-header h1 .highlight { color: #FFD580; }

.site-header p {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: rgba(255,255,255,0.78);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */
.container {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 14px 80px;
}

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 22px 20px;
    margin-top: 14px;
    box-shadow: var(--shadow);
}

.card-title {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Roter Balken links – wie der Trennstrich auf der Förderverein-Seite */
.card-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--red);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   STARTSEITE – Info-Kacheln & Spendenbox
   ══════════════════════════════════════════════════════════ */
.hero-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.info-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 12px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

/* Caveat-Zahlen wie "24 €" auf der Förderverein-Seite */
.info-tile .val {
    font-family: var(--font-script);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--red);
    display: block;
    line-height: 1.1;
}

.info-tile .lbl {
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

/* Spendenbox */
.donation-note {
    background: var(--red);
    background-image: linear-gradient(135deg, var(--red-dark) 0%, var(--red-hover) 100%);
    border-radius: var(--radius);
    padding: 22px 20px;
    margin-top: 14px;
    text-align: center;
    color: #fff;
    box-shadow: var(--shadow-red);
}

.donation-note .big {
    font-family: var(--font-script);
    font-size: 2.6rem;
    font-weight: 700;
    display: block;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.1;
}

.donation-note p { color: rgba(255,255,255,0.88); font-size: 0.9rem; }
.donation-note small { color: rgba(255,255,255,0.72); font-size: 0.84rem; }

/* ══════════════════════════════════════════════════════════
   FORMULARE
   ══════════════════════════════════════════════════════════ */
label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    margin-top: 16px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--cream);
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    /* Verhindert iOS-Zoom beim Tippen */
    font-size: max(16px, 1rem);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--text-4); }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(200,52,26,0.12);
}

/* Code-Eingabe groß */
input.code-input {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    font-weight: 800;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    padding: 20px 16px;
    background: var(--cream-2);
    border: 2px solid var(--border-mid);
    color: var(--text);
}

input.code-input:focus {
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(200,52,26,0.1);
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.97rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px; /* Touch-freundlich */
    letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }

/* Roter Primary-Button – wie "Mitglied werden" */
.btn-primary {
    background: var(--red);
    color: #fff;
    box-shadow: var(--shadow-red);
    width: 100%;
}
.btn-primary:hover { background: var(--red-hover); box-shadow: 0 6px 24px rgba(200,52,26,0.38); }

/* Outline-Button – wie "Jetzt spenden" */
.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border-mid);
    width: 100%;
}
.btn-secondary:hover { background: var(--cream); border-color: var(--text-3); }

.btn-sm { padding: 9px 16px; font-size: 0.85rem; width: auto; min-height: 40px; }

/* ══════════════════════════════════════════════════════════
   FORTSCHRITTSBALKEN (sticky)
   ══════════════════════════════════════════════════════════ */
.progress-bar-wrap {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250,247,244,0.93);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-mid);
    padding: 10px 16px;
    box-shadow: 0 2px 10px rgba(100,60,30,0.06);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 7px;
}

.progress-info #progress-pct {
    color: var(--red);
    font-family: var(--font-script);
    font-size: 0.9rem;
}

.progress-track {
    background: var(--cream-3);
    border-radius: 10px;
    height: 5px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--red-dark), var(--red-hover));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════
   KATEGORIE-HEADER
   ══════════════════════════════════════════════════════════ */
.cat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 14px;
    margin-top: 28px;
    margin-bottom: 4px;
    background: var(--red-subtle);
    border-left: 3px solid var(--red);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--red-dark);
}

.cat-header .cat-num {
    margin-left: auto;
    background: rgba(200,52,26,0.12);
    color: var(--red);
    border-radius: 4px;
    font-size: 0.66rem;
    padding: 2px 9px;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   FRAGEN-KARTEN
   ══════════════════════════════════════════════════════════ */
.question-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 18px 16px;
    margin-top: 8px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;
}

/* Karte leuchtet auf, wenn beantwortet */
.question-card:has(input:checked),
.question-card:has(.quiz-estimate:not(:placeholder-shown)) {
    border-color: rgba(200,52,26,0.3);
}

.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.question-num {
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--text-4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.question-pts {
    background: var(--red-subtle);
    border: 1px solid var(--red-border);
    border-radius: 30px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--red);
    padding: 3px 11px;
}

.question-text {
    font-family: var(--font-serif);
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 14px;
    color: var(--text);
}

.question-hint {
    background: var(--warn-bg);
    border-left: 3px solid var(--warn);
    border-radius: 0 6px 6px 0;
    padding: 9px 12px;
    font-size: 0.82rem;
    color: var(--warn);
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   ANTWORT-OPTIONEN
   ══════════════════════════════════════════════════════════ */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.93rem;
    color: var(--text-2);
    background: var(--cream);
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 50px; /* Touch-freundlich */
}

.option-label:hover {
    border-color: var(--red-border);
    background: var(--red-subtle);
    color: var(--text);
}

.option-label input[type="radio"] { display: none; }

.option-label:has(input:checked) {
    border-color: var(--red);
    background: var(--red-subtle);
    color: var(--red-dark);
}

.option-key {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--white);
    border: 1.5px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--text-3);
    transition: all 0.15s;
}

.option-label:has(input:checked) .option-key {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   SCHÄTZFRAGE
   ══════════════════════════════════════════════════════════ */
.estimate-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.estimate-wrap input { flex: 1; }

.estimate-unit {
    font-weight: 600;
    color: var(--text-2);
    font-size: 0.93rem;
    white-space: nowrap;
    background: var(--cream-2);
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════ */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-top: 12px;
    line-height: 1.6;
    border: 1.5px solid;
}

.alert-error   { background: var(--red-subtle);   border-color: rgba(200,52,26,0.28); color: var(--red-dark); }
.alert-success { background: var(--success-bg);   border-color: rgba(45,122,58,0.28); color: var(--success); }
.alert-info    { background: var(--info-bg);      border-color: rgba(29,95,138,0.28); color: var(--info); }
.alert-warn    { background: var(--warn-bg);      border-color: rgba(180,83,9,0.28);  color: var(--warn); }

/* ══════════════════════════════════════════════════════════
   SCORE-KREIS (Danke-Seite)
   ══════════════════════════════════════════════════════════ */
.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--red-subtle);
    border: 3px solid var(--red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 0 8px rgba(200,52,26,0.07), var(--shadow-red);
}

.score-num {
    font-family: var(--font-script);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--red);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 4px;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════════════════════ */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 22px 0;
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 0.76rem;
    color: var(--text-3);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: var(--cream-2);
}

.site-footer a {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   ADMIN-NAVIGATION
   ══════════════════════════════════════════════════════════ */
.admin-nav {
    background: var(--red);
    background-image: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 100%);
    padding: 10px 16px;
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: 0 2px 12px rgba(200,52,26,0.3);
}

.admin-nav::-webkit-scrollbar { display: none; }

.admin-nav a {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 7px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
}

.admin-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,0.22); color: #fff; }
.admin-nav .logo {
    font-family: var(--font-script);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-right: 8px;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════ */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-3); font-size: 0.9rem; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.required { color: var(--red); }
.hidden   { display: none !important; }
.btn-submit.loading { opacity: 0.65; pointer-events: none; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE MOBILE-FIRST
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .card            { padding: 16px 14px; }
    .question-card   { padding: 16px 13px; }
    .site-header     { padding: 22px 16px 28px; }
    .option-label    { font-size: 0.9rem; }
    .hero-info       { gap: 8px; }
    .info-tile       { padding: 14px 10px; }
    .info-tile .val  { font-size: 1.5rem; }
}

/* ══════════════════════════════════════════════════════════
   SAFE AREA – iPhone Notch / Home Bar
   ══════════════════════════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body { padding-bottom: env(safe-area-inset-bottom); }
    .progress-bar-wrap {
        padding-left:  max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}
