/* Wabe – modernes, helles/dunkles Design. Systemschrift bzw. Inter (OFL), keine externen Ressourcen. */
:root {
  --bg: #f5f4ff; --bg2: #e9fbf7; --card: #ffffffcc; --card-solid: #fff; --text: #1d1b3a; --muted: #6a6890;
  --line: #e3e1f5; --primary: #6c5ce7; --primary-d: #5444d6; --primary-soft: #ece9ff;
  --accent: #14b8a6; --good: #15a36b; --maybe: #f59e0b; --bad: #e5484d;
  --shadow: 0 10px 30px -12px rgba(76, 58, 190, .25); --radius: 18px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d1f; --bg2: #0b1d22; --card: #181735cc; --card-solid: #181735; --text: #efeefc; --muted: #a09ec8;
    --line: #2a2852; --primary: #8b7dff; --primary-d: #a094ff; --primary-soft: #26234f;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); line-height: 1.55; min-height: 100vh;
  display: flex; flex-direction: column;
  background: radial-gradient(900px 500px at 10% -10%, #c9c2ff55, transparent 60%),
              radial-gradient(800px 500px at 100% 0%, #7ff0dc44, transparent 60%),
              linear-gradient(160deg, var(--bg), var(--bg2)) fixed;
}
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; } .muted { color: var(--muted); } .small { font-size: .88rem; }
.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(680px, 100% - 2rem); margin-inline: auto; }
main { flex: 1; padding: 1.5rem 0 3rem; }

/* Kopf & Fuß */
.top { backdrop-filter: blur(12px); background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; }
nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
nav a, nav button.linklike { padding: .4rem .8rem; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .92rem; }
nav a:hover { background: var(--primary-soft); text-decoration: none; }
footer { text-align: center; padding: 1.5rem 1rem 2rem; color: var(--muted); font-size: .85rem; }
button.linklike { background: none; border: 0; cursor: pointer; font: inherit; }

/* Karten */
.card { background: var(--card); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.card h2 { display: flex; align-items: center; gap: .5rem; }
.grid { display: grid; gap: 1.2rem; } .g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; } .between { justify-content: space-between; }
.stack > * + * { margin-top: .9rem; }

/* Formulare */
label, legend { font-weight: 600; font-size: .92rem; display: block; margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--card-solid); border: 1.5px solid var(--line);
  border-radius: 12px; padding: .65rem .85rem; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: .3rem; accent-color: var(--primary); width: 1.05rem; height: 1.05rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 700; cursor: pointer; border: 0;
  padding: .7rem 1.2rem; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--primary), #8a63f0); box-shadow: 0 8px 20px -8px var(--primary); transition: transform .12s, filter .12s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); text-decoration: none; }
.btn.ghost { background: var(--primary-soft); color: var(--primary-d); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #e5484d, #c92a63); box-shadow: 0 8px 20px -10px #e5484d; }
.btn.small { padding: .4rem .8rem; font-size: .85rem; } .btn.block { width: 100%; }

/* Hinweise */
.flash { padding: .8rem 1rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 600; border: 1px solid; }
.flash.ok { background: #15a36b1f; color: var(--good); border-color: #15a36b55; }
.flash.error { background: #e5484d1c; color: var(--bad); border-color: #e5484d55; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-d); white-space: nowrap; }
.badge.good { background: #15a36b22; color: var(--good); } .badge.warn { background: #f59e0b24; color: #b97500; } .badge.bad { background: #e5484d1f; color: var(--bad); }
@media (prefers-color-scheme: dark) { .badge.warn { color: #fbbf4a; } }

/* Hero */
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero p.lead { color: var(--muted); font-size: 1.12rem; max-width: 36rem; margin-inline: auto; }
.hero h1 span { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.keybox { display: flex; gap: .6rem; max-width: 460px; margin: 1.5rem auto 0; }
.keybox input { text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.25rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.feature { text-align: center; } .feature .ico { font-size: 2rem; display: block; margin-bottom: .3rem; }

/* Art-Auswahl */
.kinds { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.kinds label { margin: 0; border: 2px solid var(--line); background: var(--card-solid); border-radius: 16px; padding: 1rem; cursor: pointer; text-align: center; transition: all .15s; height: 100%; }
.kinds label .ico { font-size: 1.8rem; display: block; } .kinds label b { display: block; } .kinds label small { color: var(--muted); font-weight: 500; }
.kinds input:checked + label { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.kinds input:focus-visible + label { outline: 3px solid var(--primary); outline-offset: 2px; }
.vis { display: grid; gap: .6rem; } .vis label { font-weight: 500; }
.vis b { font-weight: 700; }

/* Termin-Auswahl & Auswahlkarten */
.opt { border: 1.5px solid var(--line); border-radius: 14px; padding: .8rem 1rem; background: var(--card-solid); margin-bottom: .7rem; }
.opt legend { float: left; width: 100%; padding: 0; font-weight: 700; margin-bottom: .55rem; }
.opt .seg, .opt .qty { clear: both; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; text-align: center; padding: .5rem .3rem; border-radius: 10px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; font-size: .9rem; transition: all .12s; }
.seg input:checked + label.s-yes { background: #15a36b; border-color: #15a36b; color: #fff; }
.seg input:checked + label.s-maybe { background: var(--maybe); border-color: var(--maybe); color: #2b1d00; }
.seg input:checked + label.s-no { background: #8884b0; border-color: #8884b0; color: #fff; }
.seg input:focus-visible + label { outline: 3px solid var(--primary); outline-offset: 2px; }
.pick { display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card-solid); margin-bottom: .55rem; cursor: pointer; font-weight: 600; transition: all .12s; }
.pick:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pick input { accent-color: var(--primary); width: 1.1rem; height: 1.1rem; }
.qty { display: flex; align-items: center; gap: .8rem; justify-content: space-between; }
.qty input { width: 5.5rem; text-align: center; font-weight: 700; }

/* Ergebnisse */
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--primary-soft); display: block; }
progress::-webkit-progress-bar { background: var(--primary-soft); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; }
.res { display: grid; gap: .8rem; }
.res-row { padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card-solid); }
.res-row.best { border-color: var(--good); box-shadow: 0 0 0 3px #15a36b22; }
.res-head { display: flex; justify-content: space-between; gap: .6rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.res-meta { display: flex; gap: 1rem; margin-top: .45rem; font-size: .88rem; font-weight: 700; flex-wrap: wrap; }
.yes { color: var(--good); } .maybe { color: #c98200; } .no { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.chip { background: var(--primary-soft); color: var(--primary-d); border-radius: 999px; padding: .1rem .65rem; font-size: .82rem; font-weight: 600; }
.table-wrap { overflow-x: auto; margin-top: 1rem; border: 1.5px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; background: var(--card-solid); font-size: .92rem; }
th, td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); text-align: center; } th:first-child, td:first-child { text-align: left; }
thead th { background: var(--primary-soft); font-size: .8rem; } tr:last-child td, tr:last-child th { border-bottom: 0; }
td.v-yes { color: #fff; background: #15a36b; font-weight: 800; } td.v-maybe { background: #f59e0b; color: #2b1d00; font-weight: 800; } td.v-no { color: var(--muted); }
.quote { border-left: 3px solid var(--primary); padding: .2rem .9rem; margin: .4rem 0; color: var(--muted); }

/* Admin */
.key { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 800; letter-spacing: .1em; color: var(--primary-d); word-break: break-all; }
.qrbox { background: #fff; border-radius: 18px; padding: .6rem; width: min(240px, 100%); margin-inline: auto; box-shadow: var(--shadow); }
.qrbox svg { width: 100%; height: auto; display: block; }
.event-item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card-solid); margin-bottom: .7rem; color: var(--text); transition: all .15s; flex-wrap: wrap; }
.event-item:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.date-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; margin-bottom: .5rem; }
.panel[hidden] { display: none; }
.danger-zone { border-color: #e5484d55; }

/* Druckansicht */
.sheet { text-align: center; padding: 2rem; }
.sheet .qrbox { width: 320px; box-shadow: none; border: 2px solid #000; border-radius: 12px; }
.sheet h1 { font-size: 2.2rem; } .sheet .key { color: #000; font-size: 2rem; }
@media print { .top, footer, .noprint { display: none !important; } body { background: #fff; color: #000; } .card { box-shadow: none; border: 0; background: none; } }
@media (max-width: 560px) { .date-row { grid-template-columns: 1fr 1fr; } .date-row button { grid-column: span 2; } .keybox { flex-direction: column; } }

/* Hilfsklassen (statt Inline-Styles wegen CSP) */
.center { text-align: center; } .center-row { justify-content: center; }
.mt { margin-top: .8rem; } .mt2 { margin-top: 1.2rem; } .mb { margin-bottom: 1.2rem; }
.prewrap { white-space: pre-line; } .tight { margin: 0; } .break { word-break: break-all; } .big { font-size: 2.5rem; margin: 0; }
.manage-row { padding: .45rem 0; border-bottom: 1px solid var(--line); } .manage-row:last-child { border-bottom: 0; }
code { background: var(--primary-soft); padding: .1rem .4rem; border-radius: 6px; }
