/*
 * GartenBerg Sommerfest – gemeinsames Stylesheet
 * Farbpalette abgeleitet vom Logo-Grün (#9ac23d), passend zur Gartenbaugenossenschaft.
 */

:root {
    --color-primary: #6b9a2f;
    --color-primary-dark: #4f7422;
    --color-primary-light: #eaf3dd;
    --color-accent: #9ac23d;
    --color-danger: #b3392c;
    --color-danger-dark: #8f2d22;
    --color-danger-light: #fbeceb;
    --color-info: #2b5876;
    --color-info-light: #e8f1f7;
    --color-text: #2f3630;
    --color-text-muted: #6b7268;
    --color-bg: #f4f7f1;
    --color-surface: #ffffff;
    --color-border: #dde5d5;
    --radius: 8px;
    --shadow: 0 2px 6px rgba(46, 74, 26, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary-dark);
}

.page {
    flex: 1;
}

/* Header */

.site-header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-header__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-header__logo {
    height: 40px;
    display: block;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-header__link {
    display: inline-flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: background-color 0.15s, color 0.15s;
}

.site-header__link:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.site-header__link--button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.site-header__logout-form {
    margin: 0;
}

/* Footer */

.site-footer {
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.site-footer__inner {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Card / Container */

.container {
    width: 90%;
    min-width: 320px;
    max-width: 560px;
    margin: 2rem auto;
    padding: 1.5rem;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.container--narrow {
    max-width: 400px;
}

.container--wide {
    width: 96%;
    max-width: 1600px;
}

h1 {
    text-align: center;
    color: var(--color-text);
    margin-top: 0;
}

.form-intro {
    color: var(--color-text-muted);
    text-align: center;
    margin-top: -0.5rem;
}

h2 {
    color: var(--color-text);
}

/* Forms */

.form-group {
    margin-bottom: 15px;
}

/* Spamschutz-Feld: aus dem sichtbaren Bereich geschoben statt display:none, damit auch Bots
   es ausfüllen, die auf ausgeblendete Felder verzichten. */
.honigtopf {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 5px 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}

input:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

.checkbox-group label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
}

.checkbox-group input {
    margin-right: 5px;
}

/* Stepper-Leiste (Anmeldeformular-Wizard): bleibt beim Scrollen sichtbar (sticky statt
   fixed), damit sie unmittelbar unter dem Seiten-Header andockt, ohne ihn zu überlappen
   und ohne dass eine Höhen-Variable für einen künstlichen padding-top nötig wäre. */

.wizard-stepper-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    padding: 0.85rem 1rem 0.6rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.wizard-stepper {
    list-style: none;
    display: flex;
    justify-content: center;
    min-width: min-content;
    max-width: 560px;
    margin: 0 auto;
    padding: 0;
    counter-reset: wizard-step;
}

.wizard-stepper__step {
    counter-increment: wizard-step;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 4rem;
    padding: 0 0.25rem;
    position: relative;
}

.wizard-stepper__step:not(:first-child)::before {
    content: '';
    position: absolute;
    top: calc(1rem - 1px);
    right: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--color-border);
    z-index: -1;
}

.wizard-stepper__step.ist-aktiv:not(:first-child)::before,
.wizard-stepper__step.ist-abgeschlossen:not(:first-child)::before {
    background-color: var(--color-primary);
}

.wizard-stepper__circle {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: var(--color-surface);
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.wizard-stepper__circle:disabled {
    cursor: default;
}

/* Der generische button:hover-Stil dunkelt den Hintergrund ab; ohne diese Regel
   bliebe die Ziffer in ihrer grauen Grundfarbe und wäre auf dem dunklen Grün
   praktisch unlesbar. Bei "ist-aktiv"/"ist-abgeschlossen" ändert sich der
   Hintergrund beim Hover nicht (höhere Spezifität), daher bleiben sie aussen vor. */
.wizard-stepper__step:not(.ist-aktiv):not(.ist-abgeschlossen) .wizard-stepper__circle:hover:not(:disabled) {
    color: white;
}

.wizard-stepper__haken {
    display: none;
}

.wizard-stepper__step.ist-abgeschlossen .wizard-stepper__circle {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.wizard-stepper__step.ist-abgeschlossen .wizard-stepper__nummer {
    display: none;
}

.wizard-stepper__step.ist-abgeschlossen .wizard-stepper__haken {
    display: inline;
}

.wizard-stepper__step.ist-aktiv .wizard-stepper__circle {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.wizard-stepper__nummer::before {
    content: counter(wizard-step);
}

.wizard-stepper__label {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    line-height: 1.15;
    color: var(--color-text-muted);
    text-align: center;
}

.wizard-stepper__step.ist-aktiv .wizard-stepper__label {
    color: var(--color-primary-dark);
    font-weight: 600;
}

.wizard-stepper__status {
    text-align: center;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Formular-Schritte (Anmeldeformular-Wizard): alle Schritte liegen im selben <form>,
   ohne JS bleiben sie (Progressive Enhancement) untereinander sichtbar; erst die Klasse
   .js-wizard auf <html> blendet alle ausser dem aktiven Schritt aus. */

.wizard-step {
    border: none;
    min-width: 0;
    padding: 0;
    margin: 0 0 2rem;
}

.wizard-step:last-child {
    margin-bottom: 0;
}

.wizard-step legend {
    /* verhindert, dass der Browser die Legend wie üblich in den oberen Kartenrand
       einschneidet (Default-Verhalten von <legend> in einem umrandeten <fieldset>) */
    display: block;
    width: 100%;
    font-weight: bold;
    color: var(--color-primary-dark);
    padding: 0;
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.js-wizard .wizard-step {
    display: none;
}

.js-wizard .wizard-step.ist-aktiv {
    display: block;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.wizard-nav:has(> :only-child) {
    justify-content: flex-end;
}

.btn--secondary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background-color: var(--color-bg);
}

/* Zusammenfassung (letzter Wizard-Schritt): rein lesende Übersicht, Bearbeiten erfolgt
   über den Stift-Button pro Gruppe, der zum jeweiligen Schritt zurückspringt. */

.wizard-summary-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.wizard-summary-group:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.wizard-summary-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.wizard-summary-group__header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--color-primary-dark);
}

.wizard-summary__edit {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
}

.wizard-summary__edit:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    border-radius: 4px;
}

.wizard-summary {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.75rem;
}

.wizard-summary > div {
    display: contents;
}

.wizard-summary dt {
    color: var(--color-text-muted);
    font-weight: normal;
}

.wizard-summary dd {
    margin: 0;
    font-weight: 600;
}

.wizard-summary-liste {
    margin: 0;
    padding-left: 1.1rem;
}

.wizard-summary-liste li {
    margin-bottom: 0.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 160px;
}

.form-hint {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: -0.25rem;
}

/* Empfehlung im Buffet-Schritt (BR-072 – BR-074): bewusst als eigene Fläche, damit sie sich
   von den übrigen Hinweistexten der Seite abhebt und nicht überlesen wird (NFR-052). */
.buffet-empfehlung {
    background-color: var(--color-info-light);
    border: 1px solid #bcd9ea;
    border-left: 4px solid var(--color-info);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.buffet-empfehlung__regel {
    margin: 0;
    font-weight: 600;
    color: var(--color-info);
}

.buffet-empfehlung__grund {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

.buffet-empfehlung__stand {
    margin: 0.6rem 0 0;
    padding-top: 0.6rem;
    border-top: 1px solid #bcd9ea;
    font-weight: 600;
    color: var(--color-info);
}

.buffet-empfehlung__stand.ist-erfuellt {
    color: var(--color-primary-dark);
}

/* Hinweis auf eine Unterdeckung in der Zusammenfassung: eine Notiz, keine Fehlermeldung —
   abgesendet wird die Anmeldung so oder so (BR-074). */
.wizard-summary-hinweis {
    margin: 0.6rem 0 0;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-info-light);
    border-left: 3px solid var(--color-info);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--color-info);
}

/* Echte Tabelle statt Grid/Flex: native Tabellenzeilen garantieren, dass alle Zellen
   einer Zeile exakt dieselbe Höhe haben — die Trennlinie zwischen zwei Zeilen kann damit
   nicht mehr auseinanderlaufen, unabhängig von Textumbruch oder dem <input>-Element. */
.beitrag-liste {
    width: 100%;
    border-collapse: collapse;
}

.beitrag-liste td {
    padding: 0.6rem 0;
    border: none;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    background-color: transparent;
    text-align: left;
}

.beitrag-liste td + td {
    padding-left: 0.75rem;
}

.beitrag-zeile label {
    font-weight: normal;
}

.beitrag-anzahl input[type="number"] {
    width: 4.5rem;
    margin: 0;
    transition: background-color 0.15s, border-color 0.15s;
}

.beitrag-anzahl input[type="number"].ist-ausgewaehlt {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.beitrag-anzahl input[type="number"].ist-ungueltig {
    border-color: var(--color-danger);
    background-color: var(--color-danger-light);
}

.beitrag-noch-offen {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
    text-align: right;
}

button,
.btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
}

button:hover,
.btn:hover {
    background-color: var(--color-primary-dark);
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 10px;
}

/* Buttons used outside of full-width submit forms (admin actions etc.) */

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    text-align: center;
    white-space: nowrap;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn--danger {
    background-color: var(--color-danger);
}

.btn--danger:hover {
    background-color: var(--color-danger-dark);
}

.button-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
}

.button-row--abstand {
    margin-bottom: 1rem;
}

/* Alerts */

.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    margin-bottom: 15px;
}

.alert--info {
    background-color: var(--color-info-light);
    border-color: #bcd9ea;
    color: var(--color-info);
}

.alert--success {
    background-color: var(--color-primary-light);
    border-color: #c7dfa4;
    color: var(--color-primary-dark);
}

.alert--error {
    background-color: var(--color-danger-light);
    border-color: #f1c2bd;
    color: var(--color-danger-dark);
}

.zurueck {
    display: block;
    text-align: center;
    margin-top: 15px;
}

/* Tables */

.table-scroll {
    overflow-x: auto;
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--color-border);
    vertical-align: top;
}

th {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

td {
    background-color: var(--color-surface);
}

td.actions {
    white-space: nowrap;
}

/* Datum und Uhrzeit gehören zusammen und sollen nicht auf zwei Zeilen brechen */
td.nowrap {
    white-space: nowrap;
}

/* Offene Restmenge in den Stand-Tabellen (ersetzt das frühere th:style) */

.wert-vollstaendig {
    color: var(--color-primary-dark);
}

.wert-offen {
    color: var(--color-danger);
}

td ul {
    margin: 0;
    padding-left: 1.1rem;
}

/* Status-/Hinweisseiten (404, Anmeldung geschlossen, bereits angemeldet) */

.status-page {
    text-align: center;
}

.status-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
}

.status-page p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}
