:root {
  color-scheme: light;
  --yellow: #f3b94d;
  --mint: #6fc2ac;
  --peach: #f2a48f;
  --bg: #fdf8f0;
  --card-bg: #ffffff;
  --border: #f0e6d6;
  --text: #4a4238;
  --muted: #9c9284;
  --muted-2: #b3a996;
  --success-bg: #e7f6ee;
  --success-text: #2f9e6b;
  --warn-bg: #fdefdf;
  --warn-text: #c76a1e;
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Quicksand', system-ui, sans-serif;
}
a { color: var(--mint); }
a:hover { color: var(--peach); }
.fr-n { font-family: 'Fredoka', sans-serif; }

.page-wrap { position: relative; min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 18px 12px 24px; overflow: hidden; }
.card-wrap { position: relative; z-index: 1; width: 100%; max-width: 480px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 44px rgba(74, 66, 56, .1); }

/* Verspielter Konfetti-Hintergrund (Einhorn/Regenbogen/Bagger/Dino/...) —
   dezente Opazität, damit Formular-Text vorne klar lesbar bleibt. */
.confetti { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.confetti span {
  position: absolute; opacity: .17; filter: saturate(1.05);
  animation: confetti-float 6.5s ease-in-out infinite;
}
/* Leichte Drift-/Dreh-Bewegung, Dauer/Richtung pro Symbol variiert, damit es
   nicht wie eine einzige synchrone Herde wirkt. */
@keyframes confetti-float {
  0%, 100% { transform: translate(0, 0) rotate(var(--r, 0deg)); }
  50% { transform: translate(7px, -18px) rotate(calc(var(--r, 0deg) + 10deg)); }
}
.confetti span:nth-child(2n) { animation-duration: 8s; animation-delay: -2.5s; }
.confetti span:nth-child(3n) { animation-duration: 5.5s; animation-delay: -4s; }
.confetti span:nth-child(5n) { animation-duration: 9s; animation-direction: alternate-reverse; }
.confetti span:nth-child(7n) { animation-duration: 7s; animation-delay: -1.2s; }
@media (prefers-reduced-motion: reduce) {
  .confetti span { animation: none; }
}

.rainbow-bar {
  height: 7px;
  background: linear-gradient(90deg, #f2a48f, #f3b94d, #f6e17d, #6fc2ac, #7fb3e0, #b39ddb);
}

.hero-band {
  background: linear-gradient(120deg, var(--mint), var(--yellow), var(--peach));
  padding: 18px 22px 16px;
  text-align: center;
  color: #fff;
}
.hero-band .icon { font-size: 32px; line-height: 1; margin-bottom: 3px; }
.hero-band h1 { font-family: 'Fredoka', sans-serif; font-size: 19px; font-weight: 700; margin: 0; }
.hero-band .sub { font-size: 11.5px; opacity: .92; margin-top: 3px; }

.card-body {
  background: var(--card-bg);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px 18px 18px;
  box-shadow: 0 18px 44px rgba(74, 66, 56, .1);
}

.intro { font-size: 12.5px; line-height: 1.48; color: var(--text); margin: 0 0 10px; }
.intro strong { color: var(--peach); }
@media (max-width: 600px) {
  .intro { text-align: center; }
}
.deadline-note {
  background: var(--warn-bg); border: 1.3px dashed var(--warn-text); border-radius: var(--radius);
  padding: 8px 12px; font-size: 11.5px; color: var(--warn-text); font-weight: 600; margin-bottom: 12px;
}

form { display: grid; gap: 9px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); min-width: 0; }
.field.full { grid-column: 1/-1; }
input:not([type="checkbox"]), select, textarea {
  height: 41px; border-radius: 11px; border: 1.5px solid var(--border);
  padding: 0 13px; font-size: 13.5px; font-family: inherit; background: #fdfbf7; width: 100%; min-width: 0; color: var(--text);
}
textarea { height: auto; min-height: 60px; padding: 9px 13px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #c4baa9; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mint); background: #fff; }
.field-invalid { border-color: #e0765f !important; background: #fff3ef !important; }

.amount-chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 6px; }
.amount-chip {
  height: 38px; padding: 0 1px; border-radius: 999px; border: 1.5px solid var(--border);
  background: #fdfbf7; color: var(--text); font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.amount-chip.active, .amount-chip:hover { border-color: var(--mint); background: #eefaf6; color: #1f7a5e; }
@media (max-width: 360px) {
  .amount-chip { font-size: 10px; }
}

.section-title { font-family: 'Fredoka', sans-serif; font-size: 12.5px; font-weight: 700; color: var(--peach); margin: 3px 0 -3px; }

.submit {
  height: 46px; border-radius: var(--radius); border: none; margin-top: 3px;
  background: var(--peach); color: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; font-family: 'Fredoka', sans-serif;
}
.submit:hover { background: #ea9179; }
.stripe-note { text-align: center; font-size: 10px; color: var(--muted-2); margin: 2px 0 0; }

.error { background: #fde8e8; border: 1px solid #f3b0b0; padding: 10px 14px; border-radius: 12px; color: #a33; font-size: 12.5px; }
.success-banner { background: var(--success-bg); border: 1px solid #b9e2c9; padding: 10px 14px; border-radius: 12px; color: var(--success-text); font-size: 12.5px; }

/* Bestätigungsseite */
.confirm { text-align: center; padding: 28px 20px 22px; }
.confirm .check { width: 58px; height: 58px; border-radius: 50%; background: var(--mint); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; font-weight: 700; margin: 0 auto; }
.confirm h1 { font-family: 'Fredoka', sans-serif; font-size: 18px; color: var(--text); margin: 16px 0 6px; }
.confirm p.lede { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.confirm p.lede strong { color: var(--peach); }
.back-btn {
  display: inline-block; width: 100%; height: 44px; line-height: 44px; border-radius: var(--radius);
  border: 1.5px solid var(--mint); background: #fff; color: #1f7a5e; font-size: 13px; font-weight: 700;
  margin-top: 20px; text-align: center; text-decoration: none;
}

/* Admin */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.admin-card { width: 100%; max-width: 300px; background: #fff; border-radius: var(--radius); padding: 26px 24px; box-shadow: 0 8px 22px rgba(74,66,56,.09); }
.admin-card h1 { font-family: 'Fredoka', sans-serif; font-size: 16px; color: var(--text); text-align: center; margin: 0; }
.admin-card .sub { font-size: 11px; color: var(--muted-2); text-align: center; margin-top: 2px; }
.admin-card form { margin-top: 16px; }
.admin-card .submit { margin-top: 14px; height: 42px; font-size: 13px; }

body.admin-body { background: var(--bg); }
.admin-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: var(--mint); color: #fff;
  position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.admin-bar .title { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 15px; line-height: 1.2; }
.admin-bar .who { display: flex; align-items: center; gap: 9px; font-size: 11.5px; flex-shrink: 0; }
.admin-bar form { padding: 0; }
.admin-bar button, .admin-bar a.header-link {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 8px; padding: 6px 12px; font-size: 11px; font-weight: 700; cursor: pointer;
  text-decoration: none; white-space: nowrap; display: inline-block; font-family: inherit;
}
.admin-bar button:hover, .admin-bar a.header-link:hover { background: rgba(255,255,255,.26); }

.admin-content { max-width: 900px; margin: 0 auto; padding: 20px 20px 56px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-tile { flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.stat-tile .label { font-size: 10.5px; color: var(--muted-2); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.stat-tile .value { font-family: 'Fredoka', sans-serif; font-size: 24px; font-weight: 700; color: var(--peach); margin-top: 2px; }

.table-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 10px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
tbody td { padding: 9px 12px; font-size: 12.5px; color: var(--text); border-bottom: 1px solid #f5f1e8; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fbf8f2; }
td.amount { font-weight: 700; color: var(--peach); white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.pill { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.pill.paid { background: var(--success-bg); color: var(--success-text); }
.pill.open { background: var(--warn-bg); color: var(--warn-text); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted-2); font-size: 12.5px; }

.settings-page { max-width: 640px; margin: 0 auto; padding: 24px 20px 56px; }
.settings-page h1 { font-family: 'Fredoka', sans-serif; color: var(--text); margin-bottom: 4px; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
fieldset { border: 1.5px solid var(--border); border-radius: var(--radius); margin: 16px 0 0; padding: 16px 18px; background: #fff; }
fieldset legend { font-weight: 700; color: var(--peach); padding: 0 6px; font-family: 'Fredoka', sans-serif; font-size: 14px; }
