/* Design tokens from draft A "Hell und luftig" (spec AKD1/AKD2). No web fonts. */
:root {
  --bg: #ffffff;
  --surface: #f7f4ef;
  --line: #e4ded5;
  --text: #1f2933;
  --muted: #5f6b7a;
  --primary: #c2185b;
  --primary-dark: #9e1149;
  --primary-soft: #fce7ef;
  --ok: #2e7d32;
  --ok-soft: #e6f4e8;
  --error: #b3261e;
  --error-soft: #fbeae8;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

h1, h2, h3 { font-weight: 700; }

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

/* ---- Header ---- */
.app-header {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

.brand svg { width: 28px; height: 28px; }

main { max-width: 1000px; margin: 0 auto; padding: 8px 20px 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
}

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

.btn-block { width: 100%; }

/* Below 900px the call to action sits in the counter box instead. */
.header-cta { display: none; }

/* ---- Counter ---- */
.counter {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  margin: 12px 0 24px;
}

.counter-big {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.counter-big span { color: var(--primary); }

.counter-bar {
  display: block;
  width: 100%;
  height: 12px;
  margin-top: 14px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  color: var(--primary);
}

.counter-bar::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.counter-bar::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.counter-bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

.counter-cta { margin-top: 18px; }

@media (min-width: 900px) {
  html { font-size: 18px; }

  .app-header { padding: 28px 24px 12px; }
  .header-cta { display: inline-flex; }

  main { padding: 8px 24px 0; }

  .counter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 40px;
    align-items: center;
    padding: 32px;
  }

  .counter-big { font-size: 3.2rem; }
  .counter-bar { margin-top: 0; }
  .counter-cta { display: none; }
}

/* ---- Form /eintragen (spec AKD5) ---- */
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-ghost:hover { background: var(--primary-soft); }

.page-title { font-size: 1.7rem; margin: 10px 0 4px; letter-spacing: -0.01em; }
.lead { color: var(--muted); margin: 0 0 24px; }

.cake-form { max-width: 560px; margin: 0 auto; }

.field { margin-bottom: 22px; }

.cake-form label,
.legend-label { display: block; font-weight: 600; margin-bottom: 6px; }

.req { color: var(--primary); }

.hint { color: var(--muted); font-size: 0.9rem; margin: -2px 0 8px; }

.cake-form input[type="text"],
.cake-form select {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid #b9b2a8;
  border-radius: 12px;
}

.cake-form input:focus,
.cake-form select:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }

.cake-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cake-form legend { padding: 0; }

.choices { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }

.cake-form .choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  font-weight: 500;
  background: var(--bg);
  border: 1.5px solid #b9b2a8;
  border-radius: 12px;
  cursor: pointer;
}

.choice input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--primary); }

.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--primary-soft); }

.field.err input[type="text"],
.field.err select,
.field.err .choice { border-color: var(--error); }

.msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  color: var(--error);
  font-size: 0.92rem;
  font-weight: 500;
}

.msg::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--error);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.summary {
  margin-bottom: 20px;
  padding: 12px 14px;
  color: #7a1a14;
  background: var(--error-soft);
  border-left: 4px solid var(--error);
  border-radius: 10px;
}

.summary strong { color: var(--error); }

/* Honeypot: off-screen for humans, still filled in by naive bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.actions { display: grid; gap: 10px; margin: 8px 0 32px; }

.aside { display: none; }

.notice-page { max-width: 560px; padding-bottom: 32px; }

@media (min-width: 900px) {
  .choices { grid-template-columns: repeat(4, 1fr); }
  .checks { grid-template-columns: repeat(3, 1fr); }

  .actions { grid-template-columns: 1fr auto; direction: rtl; }
  .actions > * { direction: ltr; }

  .form-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
  .cake-form { margin: 0; }

  .aside {
    display: block;
    position: sticky;
    top: 24px;
    padding: 24px;
    background: var(--surface);
    border-radius: 20px;
  }

  .aside-big { font-size: 2rem; font-weight: 800; }
  .aside-big span { color: var(--primary); }
  .aside p { margin: 4px 0 0; color: var(--muted); }
}

/* ---- Start page: list, empty state, notice (package m1-2) ---- */
.counter-text { margin: 4px 0 0; color: var(--muted); }
.counter-text-reached { color: var(--ok); font-weight: 600; }

.toast {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--ok-soft);
  color: #1b5e20;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0 0;
  font-weight: 600;
}

.toast svg { width: 24px; height: 24px; flex: none; }

.empty { text-align: center; padding: 24px 12px 8px; }
.empty svg { width: 120px; height: 120px; }
.empty h2 { font-size: 1.5rem; margin: 12px 0 6px; }
.empty p { color: var(--muted); margin: 0 auto 20px; max-width: 420px; }

.cat { margin: 28px 0 0; }

.cat h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cat-count {
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.card {
  display: grid;
  gap: 6px;
  align-content: start;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-wrap: anywhere;
}

.card-new { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.card-name { font-weight: 700; font-size: 1.05rem; }
.card-who { color: var(--muted); font-size: 0.95rem; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.tag-other { background: var(--surface); color: var(--text); font-weight: 600; }
.tag-none { background: var(--ok-soft); color: var(--ok); font-weight: 600; }

.legend { color: var(--muted); font-size: 0.85rem; margin: 20px 0 0; }

/* Below 900px the call to action also sticks to the bottom edge of the screen. */
.sticky-cta {
  position: sticky;
  bottom: 0;
  margin: 20px -20px 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .sticky-cta { display: none; }
  .legend { margin-bottom: 32px; }
}
