/* Design angelehnt an bedarf-management.de */
:root {
  --brand: #57a2a6;
  --brand-hover: #4b9296;
  --brand-dark: #234142;
  --brand-darker: #1a3132;
  --brand-light: #ddeced;
  --brand-soft: #eef6f6;
  --accent-light: #9ad0d2;
  --ink: #1c2222;
  --muted: #5c6a6b;
  --line: #e4eaea;
  --bg-alt: #f6fafa;
  --success: #2e7d4f;
  --success-bg: #e3f4e9;
  --error: #b3261e;
  --error-bg: #fdecea;
  --warn: #8a6d00;
  --warn-bg: #fdf4d8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 40, .06), 0 2px 8px rgba(16, 40, 40, .05);
  --shadow-md: 0 10px 30px rgba(16, 40, 40, .10);
  --maxw: 1160px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; scroll-padding-top: 16px; }
body {
  margin: 0;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-alt);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; font-weight: 800; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 460px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  height: var(--header-h);
  background: rgba(26, 49, 50, .94);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; height: 100%; }
.brand-logo { height: 44px; width: auto; }

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; padding: 56px 0 140px; isolation: isolate; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(87, 162, 166, .55), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(87, 162, 166, .30), transparent 55%),
    linear-gradient(160deg, #1e3738 0%, #234142 45%, #1a3132 100%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5;
}
.hero-inner { max-width: 720px; }
.hero-logo { height: clamp(48px, 7vw, 72px); width: auto; margin-bottom: 28px; }
.hero-date { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; color: var(--accent-light); margin: -6px 0 14px; }
.eyebrow { display: inline-block; font-weight: 700; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-light); margin-bottom: 18px; }
.hero-title { font-size: clamp(2rem, 5.4vw, 3.6rem); font-weight: 800; margin-bottom: 18px; overflow-wrap: break-word; }
.hero-sub { font-size: clamp(1.05rem, 1.8vw, 1.2rem); color: rgba(255, 255, 255, .85); max-width: 660px; margin: 0; }

/* Karten & Formular */
.form-section { max-width: 720px; margin-bottom: 72px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: clamp(24px, 4vw, 40px); margin-bottom: 24px;
}
.form { display: grid; gap: 18px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { font-weight: 600; font-size: .95rem; }
.optional { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(87, 162, 166, .18); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
/* Rechnungsadresse nur zeigen, wenn "Du brauchst eine Rechnung?" angehakt ist */
.billing { display: grid; gap: 12px; }
.billing-address { display: grid; gap: 12px; }
.billing:not(:has(input[name="needs_invoice"]:checked)) .billing-address { display: none; }
.field-row.zip-row { grid-template-columns: 1fr 2fr; }
.has-photo textarea { background: rgba(255, 255, 255, .92); }
.billing-info { margin: 8px 0 0; color: var(--muted); }
.error { color: var(--error); font-size: .88rem; margin: 0; }
.hint { color: var(--muted); font-size: .88rem; margin: 0; }
.checkbox label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; }
.checkbox input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; margin: 18px 0 0; display: grid; gap: 14px; }
legend { font-weight: 700; padding: 0 6px; color: var(--brand-dark); }
code { background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; font-size: .88em; }

/* Unkostenbeitrag */
.fee-box {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  background: var(--brand-soft); border: 1px solid var(--brand-light); border-radius: var(--radius-sm);
  padding: 14px 18px; margin: 16px 0 8px;
}
.fee-box > span:first-child { font-weight: 700; color: var(--brand-dark); }
.fee-box strong { font-size: 1.4rem; font-weight: 800; color: var(--brand-dark); }
.fee-box .hint { flex-basis: 100%; }
.voucher-row { display: flex; gap: 10px; }
.voucher-row input { flex: 1; min-width: 0; }
.hint.success { color: var(--success); font-weight: 600; }

/* Veranstaltungsort */
.venue-section { max-width: 720px; margin-top: -96px; position: relative; }
.venue { display: grid; grid-template-columns: auto auto 1fr; gap: 16px 28px; }
.venue-emoji { font-size: 4rem; line-height: 1; }
.venue h2 { font-size: 1.3rem; }
.eyebrow-dark { color: var(--brand); margin-bottom: 8px; }
address { font-style: normal; color: var(--muted); margin-bottom: 12px; }
.venue-time { font-weight: 700; color: var(--brand-dark); margin: -6px 0 12px; }
.venue-note { grid-column: 1 / -1; font-size: .92rem; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.map-link { display: inline-block; font-size: .88rem; font-weight: 600; }

/* Foto vollflächig im Hintergrund, Inhalte halbtransparent darüber */
.page-bg { position: fixed; inset: 0; z-index: -1; background: center / cover no-repeat; }
.page-bg-karneval { background-image: url(karneval.jpg); }
.page-bg-location { background-image: url(location.jpg); }
/* Oberes Bild blendet regelmäßig aus und wieder ein: je ca. 8 s sichtbar, 2 s Überblendung */
.page-bg-fade { animation: bg-crossfade 20s ease-in-out infinite; }
@keyframes bg-crossfade {
  0%, 40%   { opacity: 1; }
  50%, 90%  { opacity: 0; }
  100%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .page-bg-fade { animation: none; }
}
.page-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26, 49, 50, .88) 0%, rgba(26, 49, 50, .72) 35%, rgba(26, 49, 50, .55) 60%, rgba(26, 49, 50, .65) 100%);
}
.has-photo .hero-bg { display: none; }
.has-photo .hero-title, .has-photo .hero-sub, .has-photo .hero-date { text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.has-photo .card {
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-color: rgba(255, 255, 255, .6);
  box-shadow: 0 24px 60px rgba(16, 40, 40, .25);
}
.has-photo .fee-box { background: rgba(238, 246, 246, .75); }
.has-photo input, .has-photo select { background: rgba(255, 255, 255, .92); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1;
  padding: 13px 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1.5px solid transparent; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(87, 162, 166, .35); }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 10px 26px rgba(87, 162, 166, .45); }
.btn-outline { background: transparent; color: var(--brand-dark); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-lg { padding: 16px 28px; font-size: 1rem; justify-self: start; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* Hinweise */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 16px 0; font-weight: 600; }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* Admin */
.admin-main { padding: 40px 0 72px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a { padding: 10px 16px; font-weight: 600; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm); display: grid; }
.stat strong { font-size: 1.8rem; font-weight: 800; color: var(--brand-dark); }
.stat-label { font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat-sub { font-size: .88rem; color: var(--muted); }
.stat-accepted { border-top: 4px solid var(--brand); }
.stat-pending { border-top: 4px solid #e0a80d; }
.stat-rejected { border-top: 4px solid #c2cccc; }
.list-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--muted); }
.chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.reg-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.reg-table th { text-align: left; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg-alt); padding: 12px 14px; white-space: nowrap; }
.reg-table td { padding: 14px; border-top: 1px solid var(--line); vertical-align: top; }
.actions form { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-accepted { background: var(--brand-light); color: var(--brand-dark); }
.badge-rejected { background: #eceff0; color: var(--muted); }
.badge-neutral { background: #eceff0; color: var(--muted); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.badge-paid { background: var(--success-bg); color: var(--success); }
.paid form { margin-top: 6px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--ink); }
.badge-voucher { background: var(--success-bg); color: var(--success); border: 1px solid #9fd8b3; }
.settings .card:last-of-type { margin-bottom: 24px; }

/* Footer */
.site-footer { background: var(--brand-darker); color: rgba(255, 255, 255, .6); padding: 24px 0; font-size: .88rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.site-footer a:hover { color: #fff; }

@media (max-width: 640px) {
  .container { padding-inline: 16px; }
  .field-row, .stats, .venue { grid-template-columns: 1fr; }
  .venue-emoji { font-size: 3rem; }
  .hero { padding: 40px 0 120px; }
  .btn-lg { justify-self: stretch; }
}
