/* ==========================================================================
   Veranstaltungsservice – Frontend
   Gemeinsames Stylesheet für Übersicht und Anmeldung.
   Zurückhaltendes, institutionelles Erscheinungsbild:
   ruhige Flächen, klare Typografie, Grün ausschließlich als Akzent.
   ========================================================================== */

:root {
    /* Marke */
    --accent:          #2f6b43;
    --accent-strong:   #24512f;
    --accent-tint:     #eef4f0;

    /* Flächen */
    --page:            #f4f5f3;
    --surface:         #ffffff;
    --line:            #dfe2dd;
    --line-strong:     #c6ccc4;

    /* Text */
    --text:            #1b1e1c;
    --text-muted:      #5d635e;

    /* Status */
    --danger:          #9b2c2c;
    --danger-tint:     #fdf0ef;
    --success:         #1f6b3f;
    --success-tint:    #edf5ef;

    /* Maße */
    --radius:          6px;
    --radius-lg:       10px;
    --shell:           660px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Kopfbereich ------------------------------------------------------- */

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

.site-header__inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-header__logo { height: 46px; width: auto; display: block; }

.site-header__titles { min-width: 0; }

.site-header__org {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.site-header__sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Grundgerüst ------------------------------------------------------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 32px 24px 48px;
    flex: 1;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.panel--narrow { max-width: 460px; margin: 0 auto; }

.page-title {
    margin: 0 0 6px;
    font-size: 25px;
    font-weight: 650;
    letter-spacing: -0.4px;
    line-height: 1.25;
}

.page-intro {
    margin: 0 0 28px;
    color: var(--text-muted);
    font-size: 15px;
}

/* --- Reiter ------------------------------------------------------------ */

.tabs {
    display: flex;
    gap: 26px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
}

.tabs__link {
    position: relative;
    padding: 0 0 12px;
    font-size: 15px;
    font-weight: 550;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs__link:hover { color: var(--text); }

.tabs__link[aria-current="page"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* --- Veranstaltungsliste ----------------------------------------------- */

.event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.event-list__item { border-bottom: 1px solid var(--line); }

.event {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 4px;
    text-decoration: none;
    color: inherit;
}

.event:hover { background: var(--accent-tint); }

.event__date {
    flex: 0 0 auto;
    width: 52px;
    text-align: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.event__weekday {
    display: block;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 3px 0;
}

.event__day {
    display: block;
    font-size: 20px;
    font-weight: 650;
    padding: 4px 0 5px;
}

.event__body { min-width: 0; flex: 1; }

.event__name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.event__meta {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
}

.event__chevron { color: var(--line-strong); flex-shrink: 0; }
.event:hover .event__chevron { color: var(--accent); }

.empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
}

/* --- Formulare --------------------------------------------------------- */

.field { margin-bottom: 18px; }

.field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.field__hint {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.field__control {
    width: 100%;
    padding: 11px 13px;
    font: inherit;
    font-size: 16px; /* verhindert das Einzoomen auf iOS */
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    outline: none;
}

.field__control:hover { border-color: var(--text-muted); }

.field__control:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 107, 67, 0.18);
}

textarea.field__control { min-height: 130px; resize: vertical; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pin-input {
    text-align: center;
    font-size: 22px;
    letter-spacing: 8px;
    font-variant-numeric: tabular-nums;
}

/* --- Auswahlgruppe (Ja/Nein) -------------------------------------------- */

.fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px 16px;
    margin: 0 0 18px;
}

.fieldset__legend {
    padding: 0 6px;
    margin-left: -6px;
    font-size: 13px;
    font-weight: 600;
}

.choice-row {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
}

.choice input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.fieldset .field { margin: 14px 0 0; }

/* --- Schaltflächen ----------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 12px 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn + .btn { margin-top: 10px; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-strong); }

.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line-strong);
}
.btn--secondary:hover { background: var(--page); }

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Hinweise ---------------------------------------------------------- */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: 14px;
    margin-bottom: 20px;
}

.notice svg { flex-shrink: 0; margin-top: 1px; }

.notice--error   { background: var(--danger-tint);  border-color: #eccbc8; color: var(--danger); }
.notice--success { background: var(--success-tint); border-color: #c9e0d0; color: var(--success); }

/* --- Bestätigungsseite -------------------------------------------------- */

.confirm { text-align: center; }

.confirm__mark {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--accent-tint);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm__summary {
    text-align: left;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin: 24px 0;
    font-size: 15px;
}

.confirm__summary dt {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.confirm__summary dd {
    margin: 0 0 12px;
    font-weight: 600;
}

.confirm__summary dd:last-child { margin-bottom: 0; }

/* --- Fußbereich --------------------------------------------------------- */

.legal {
    margin: 24px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.site-footer__inner {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* --- Statusmeldung ------------------------------------------------------ */

.flash {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    max-width: min(440px, calc(100vw - 32px));
    width: max-content;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(27, 30, 28, 0.12);
    font-size: 14px;
}

.flash--error { border-left-color: var(--danger); }

.flash__close {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    flex-shrink: 0;
}

.flash__close:hover { color: var(--text); }

/* --- Kleine Ansichten ---------------------------------------------------- */

@media (max-width: 560px) {
    .shell  { padding: 20px 16px 36px; }
    .panel  { padding: 22px 18px; border-radius: var(--radius); }
    .site-header__inner, .site-footer__inner { padding-left: 16px; padding-right: 16px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .page-title { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
