/* Notizzettel-Look der Spender-Seiten (index.html, danke.html): Schrift, Farben, Kopfband,
   Knöpfe, Felder, Balken, Fußbereich. Liegt über base.css/panels.css, die auch die Verwaltung
   nutzt und darum unverändert bleiben. Nur helles Papier-Design. */
@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Patrick Hand";
  src: url("/fonts/patrick-hand-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Zweite Auswahl schlägt das Dunkel-Design aus base.css (gleiche Gewichtung, steht weiter unten) */
:root,
:root:not([data-theme="light"]) {
  color-scheme: light;
  --blau: #26377d;
  --dunkelblau: #172353;
  --gelb: #f7b93e;
  --gruen: #2f6b4f;
  --rot: #c2362f;
  --schnee: #ffffff;
  --papier: #fbfcfe;
  --schreibtisch: #dfe6f1;
  --raster: #d3dcee;
  --zettel-gelb: #fff3a6;
  --zettel-mint: #c9f0dc;
  --zettel-rosa: #ffd3dc;
  --zettel-blau: #d4e4ff;
  --klebeband: rgb(247 185 62 / 0.55);
  --schatten: rgb(23 35 83 / 0.25);
  --schrift-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --schrift-text: "Patrick Hand", "Segoe Print", "Comic Sans MS", sans-serif;

  /* Variablen aus base.css auf die neuen Farben umbiegen */
  --bg: var(--papier);
  --ink: var(--dunkelblau);
  --muted: #4a5578;
  --line: #b8c3dc;
  --card: #ffffff;
  --accent: var(--rot);
  --accent-ink: #ffffff;
  --ok: var(--gruen);
  --warn-bg: var(--zettel-gelb);
  --danger: #a82620;
  --radius: 6px;
}

body {
  padding: 1rem 12px 0;
  font-family: var(--schrift-text);
  font-size: 1.1rem;
  line-height: 1.4;
  background: var(--schreibtisch);
}

h1,
h2,
h3,
.zaehler,
.leer-titel,
.summe-wert {
  font-family: var(--schrift-hand);
  font-weight: 700;
  line-height: 1.05;
}

h2 {
  font-size: 1.9rem;
}

.klein {
  font-size: 0.95rem;
}

/* Das Blatt: kariertes Papier mit rotem Rand wie im Schulheft */
#app {
  position: relative;
  max-width: 1100px;
  padding: 0 0 2rem;
  background: var(--papier) url("/img/karo.svg");
  border-radius: 4px;
  box-shadow: 0 10px 30px var(--schatten);
}

#app::before {
  position: absolute;
  inset-block: 0;
  left: 10px;
  width: 2px;
  content: "";
  background: var(--rot);
  opacity: 0.45;
}

#app.schmal {
  max-width: 40rem;
}

#app > :not(.kopf) {
  margin-inline: clamp(1rem, 4vw, 2.5rem);
}

/* Kopfband: dunkelblau, gelbes Logo, Titel in Handschrift */
.kopf {
  gap: 0;
}

.kopfband {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem clamp(1.5rem, 5vw, 3rem);
  overflow: hidden;
  color: var(--schnee);
  background: var(--dunkelblau);
  border-radius: 4px 4px 0 0;
  border-bottom: 5px solid var(--gelb);
}

.logo {
  display: block;
  flex: none;
  width: min(15rem, 62%);
  aspect-ratio: 1024 / 270;
  background: url("/img/logo-familienverband-gelb.png") left center / contain
    no-repeat;
}

.kopfband h1 {
  position: relative;
  font-size: clamp(2.6rem, 9vw, 4rem);
  color: var(--schnee);
  text-shadow: 3px 3px 0 var(--blau);
}

/* Sterne und Flocken: reine Kritzelei, liegt hinter dem Text */
.deko {
  position: absolute;
  width: 2rem;
  height: 2rem;
  pointer-events: none;
  background: center / contain no-repeat;
}

.stern {
  background-image: url("/img/stern.svg");
}

.flocke {
  background-image: url("/img/flocke.svg");
  opacity: 0.75;
}

.s1 {
  top: 0.5rem;
  right: 4%;
}

.s2 {
  right: 8%;
  bottom: 0.4rem;
  width: 1.4rem;
  height: 1.4rem;
}

.f1 {
  top: 0.3rem;
  right: 17%;
  width: 1.6rem;
  height: 1.6rem;
}

.f2 {
  bottom: 0.3rem;
  left: 52%;
  width: 1.3rem;
  height: 1.3rem;
}

.fortschritt {
  display: grid;
  gap: 0.5rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 0.4rem;
}

.untertitel {
  max-width: 40rem;
  font-size: 1.2rem;
}

.zaehler {
  font-size: 1.7rem;
  color: var(--blau);
}

/* Marker-Unterstreichung */
.zaehler,
.summe-wert {
  background: linear-gradient(
    transparent 60%,
    rgb(247 185 62 / 0.7) 60% 92%,
    transparent 92%
  );
  width: fit-content;
}

/* Handgemalter Balken: Stiftrand, grüne Schraffur = bezahlt, rote = in deinem Beitrag */
.balken {
  height: 1.4rem;
  background: var(--schnee);
  border: 3px solid var(--dunkelblau);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

.balken-bezahlt {
  background: repeating-linear-gradient(
    -45deg,
    var(--gruen) 0 6px,
    #3e8764 6px 10px
  );
}

.balken-korb {
  background: repeating-linear-gradient(
    -45deg,
    var(--rot) 0 6px,
    #d9524b 6px 10px
  );
}

/* Hinweis-Leiste als gelber Zettel */
.hinweis {
  padding: 0.6rem 1rem;
  background: var(--zettel-gelb);
  border: 2px dashed var(--rot);
  border-radius: 4px;
  transform: rotate(-0.6deg);
}

#laden {
  padding: 2rem 0;
  font-size: 1.3rem;
  text-align: center;
}

/* Sichtbarer Fokus */
:is(a, button, input, summary):focus-visible {
  outline: 3px solid var(--dunkelblau);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--schnee);
}

/* Knöpfe: Stiftrand mit kleinem Schatten wie aufgeklebt */
.knopf,
.icon,
.verweis {
  font-family: var(--schrift-text);
}

.knopf {
  color: var(--dunkelblau);
  background: var(--schnee);
  border: 2px solid var(--dunkelblau);
  border-radius: 10px 4px 12px 4px / 4px 12px 4px 10px;
  box-shadow: 2px 2px 0 var(--dunkelblau);
}

.icon {
  border: 2px solid var(--dunkelblau);
  background: var(--schnee);
}

.verweis {
  color: var(--dunkelblau);
}

/* Hauptknopf: gelb, dunkelblaue Schrift (Kontrast über 9:1) */
.haupt {
  padding: 0.55rem 1.3rem;
  font-family: var(--schrift-hand);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dunkelblau);
  background: var(--gelb);
  border: 3px solid var(--dunkelblau);
  border-radius: 14px 5px 16px 5px / 5px 16px 5px 14px;
  box-shadow: 3px 3px 0 var(--dunkelblau);
}

.knopf:disabled,
.haupt:disabled {
  box-shadow: none;
}

/* Felder */
.feld label {
  font-size: 1rem;
}

.feld input {
  font-family: var(--schrift-text);
  background: var(--schnee);
  border: 2px solid var(--dunkelblau);
  border-radius: 4px;
}

/* Fußbereich: kleiner Zettel unter dem Blatt */
.fuss {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 2rem;
  font-size: 0.95rem;
  color: var(--ink);
  border-top: 3px dashed var(--blau);
}

/* Bewegung nur, wenn erlaubt */
@media (prefers-reduced-motion: no-preference) {
  .flocke {
    animation: schweben 7s ease-in-out infinite;
  }

  .stern {
    animation: funkeln 3s ease-in-out infinite;
  }

  .s2,
  .f2 {
    animation-delay: -2s;
  }

  .knopf,
  .haupt {
    transition:
      transform 0.15s,
      box-shadow 0.15s;
  }

  .knopf:not(:disabled):hover,
  .haupt:not(:disabled):hover {
    transform: translate(-1px, -2px) rotate(-1deg);
  }

  .knopf:not(:disabled):active,
  .haupt:not(:disabled):active {
    box-shadow: 0 0 0 var(--dunkelblau);
    transform: translate(3px, 3px);
  }
}

@keyframes schweben {
  50% {
    transform: translateY(0.5rem) rotate(25deg);
  }
}

@keyframes funkeln {
  50% {
    opacity: 0.45;
    transform: scale(0.8) rotate(-12deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
