/* ---- Dark Mode ist Standard ---- */
:root {
    --ff-red: #ff4d63;
    --ff-red-dark: #e0344a;
    --ff-ink: #e9e9ec;
    --ff-muted: #9aa0a6;
    --ff-line: #34353b;
    --ff-bg: #141519;
    --ff-card: #1e1f24;
    --ff-field: #26272d;
    --ff-field-line: #3a3b42;
    --ff-track: #2a2b31;
    --ff-meal-sel: #2a1d21;
    --ff-row-line: #2a2b31;
    --radius: 14px;
    --shadow: 0 4px 24px rgba(0, 0, 0, .45);
}

/* ---- Hell: nur wenn der Besucher umschaltet ---- */
:root[data-theme="light"] {
    --ff-red: #c8102e;
    --ff-red-dark: #9d0c24;
    --ff-ink: #1a1a1a;
    --ff-muted: #6b7075;
    --ff-line: #e7e7ea;
    --ff-bg: #f4f4f5;
    --ff-card: #ffffff;
    --ff-field: #ffffff;
    --ff-field-line: #e7e7ea;
    --ff-track: #f0eef0;
    --ff-meal-sel: #fff5f6;
    --ff-row-line: #f1f1f3;
    --shadow: 0 4px 24px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--ff-bg);
    color: var(--ff-ink);
    line-height: 1.55;
}

.wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 18px 64px;
}

/* ---- Header ---- */
.masthead {
    position: relative;
    background: linear-gradient(135deg, #c8102e, #9d0c24);
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 28px 30px;
    box-shadow: var(--shadow);
}

/* ---- Theme-Umschalter ---- */
.theme-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, .5);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .05s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .24); }
.theme-toggle:active { transform: translateY(1px); }
/* passendes Symbol je Modus zeigen */
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: inline; }
:root[data-theme="light"] .theme-toggle .i-sun { display: inline; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.masthead .kicker {
    font-size: 12px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 800;
    color: #ffd7dd;
}
.masthead h1 {
    margin: 8px 0 4px;
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -.3px;
}
.masthead p { margin: 0; color: #ffe1e6; font-size: 15px; }

/* ---- Card ---- */
.card {
    background: var(--ff-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 24px 26px;
    margin-top: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 19px; }

/* ---- Progress / Feuerwehrauto ---- */
.gauge { margin-top: 4px; }
.track {
    position: relative;
    height: 40px;
    background: var(--ff-track);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.fill {
    position: absolute; inset: 0 auto 0 0;
    background: linear-gradient(90deg, #ff5a3c, var(--ff-red));
    border-radius: 999px;
    transition: width .9s cubic-bezier(.22,.61,.36,1);
}
.truck {
    position: absolute; top: 50%;
    transform: translate(-50%, -50%);
    transition: left .9s cubic-bezier(.22,.61,.36,1);
    width: 44px; height: 44px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
    z-index: 2;
}
.gauge-label {
    text-align: center;
    margin-top: 12px;
    font-weight: 800;
    font-size: 20px;
}
.gauge-label .num { color: var(--ff-red); }
.gauge-sub { text-align: center; color: var(--ff-muted); font-size: 13px; margin-top: 2px; }

/* ---- Form ---- */
label.field { display: block; margin-top: 16px; font-weight: 700; font-size: 14px; }
label.field .req { color: var(--ff-red); }
input[type=text], input[type=email], input[type=password] {
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1.5px solid var(--ff-field-line);
    border-radius: 10px;
    font-size: 16px;
    background: var(--ff-field);
    color: var(--ff-ink);
    transition: border-color .15s;
}
input::placeholder { color: var(--ff-muted); opacity: .8; }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus {
    outline: none;
    border-color: var(--ff-red);
}

.meals { margin-top: 8px; display: grid; gap: 10px; }
.meal {
    display: flex; align-items: center; gap: 14px;
    border: 1.5px solid var(--ff-line);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.meal:hover { border-color: #d8b3ba; }
.meal input { accent-color: var(--ff-red); width: 20px; height: 20px; flex: none; }
.meal .m-name { font-weight: 700; }
.meal .m-price { margin-left: auto; font-weight: 800; color: var(--ff-red); white-space: nowrap; }
.meal.selected { border-color: var(--ff-red); background: var(--ff-meal-sel); }

/* ---- Mehrere Personen ---- */
.person-rows { display: grid; gap: 12px; margin-top: 8px; }
.person-row {
    border: 1.5px solid var(--ff-field-line);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--ff-field);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "num remove" "fields fields";
    gap: 8px 10px;
    align-items: center;
}
.person-num { grid-area: num; font-weight: 800; font-size: 13px; color: var(--ff-muted); text-transform: uppercase; letter-spacing: .5px; }
.person-fields { grid-area: fields; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person-fields input, .person-fields select { margin-top: 0; }
.person-row select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--ff-field-line);
    border-radius: 10px;
    font-size: 16px;
    background: var(--ff-field);
    color: var(--ff-ink);
}
.person-row select:focus { outline: none; border-color: var(--ff-red); }
.row-remove {
    grid-area: remove;
    justify-self: end;
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1.5px solid var(--ff-field-line);
    background: transparent;
    color: var(--ff-muted);
    font-size: 15px;
    cursor: pointer;
    line-height: 1;
}
.row-remove:hover { border-color: var(--ff-red); color: var(--ff-red); }
.add-person {
    margin-top: 12px;
    width: 100%;
    padding: 12px;
    border: 1.5px dashed var(--ff-red);
    background: transparent;
    color: var(--ff-red);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s;
}
.add-person:hover { background: var(--ff-meal-sel); }
.add-person:disabled { border-color: var(--ff-field-line); color: var(--ff-muted); cursor: not-allowed; background: transparent; }

@media (max-width: 460px) {
    .person-fields { grid-template-columns: 1fr; }
}

.consent { display: flex; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--ff-muted); align-items: flex-start; }
.consent input { accent-color: var(--ff-red); margin-top: 3px; width: 18px; height: 18px; flex: none; }

.btn {
    width: 100%;
    margin-top: 22px;
    padding: 15px 20px;
    background: var(--ff-red);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--ff-red-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #c9c9cf; cursor: not-allowed; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Alerts ---- */
.alert { border-radius: 12px; padding: 14px 16px; margin-top: 16px; font-size: 14px; }
/* Dunkel = Basis */
.alert-error { background: #3a1c22; border: 1px solid #6e2b36; color: #ff9aa8; }
.alert-ok    { background: #16321f; border: 1px solid #2e6b45; color: #7fe0a5; }

/* Hell = umgeschaltet */
:root[data-theme="light"] .alert-error { background: #fdecee; border-color: #f5b8c0; color: #9d0c24; }
:root[data-theme="light"] .alert-ok    { background: #eafaf0; border-color: #a9e5c0; color: #14683c; }

/* ---- Success summary ---- */
.summary { border: 1px solid var(--ff-line); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.summary .row { display: flex; justify-content: space-between; padding: 12px 16px; }
.summary .row + .row { border-top: 1px solid var(--ff-row-line); }
.summary .row .k { color: var(--ff-muted); }
.summary .row .v { font-weight: 700; }

.foot { text-align: center; color: var(--ff-muted); font-size: 12px; margin-top: 26px; }
.foot a { color: var(--ff-muted); }
.full-badge {
    display: inline-block; background: var(--ff-ink); color: #fff;
    padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
    letter-spacing: .5px; text-transform: uppercase; margin-top: 6px;
}
