/* RICA Kursanmeldung – Gestaltung nach dem Gestaltungshandbuch RICA.
   Farben, Schriften und Stilelemente kommen von dort, nichts Eigenes. */

/* ------------------------------------------------------------- Schriften */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-700.woff2') format('woff2');
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('/fonts/caveat-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- Werte */
:root {
  --petrol: #17807A;
  --petrol-dunkel: #0F5D58;
  --petrol-hell: #E8F2F0;
  --tinte: #14202C;
  --grau: #4A5967;
  --creme: #FAF8F1;
  --weiss: #FFFFFF;
  --linie: #E5E0D3;
  --rot: #A8322D;

  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobble-2: 15px 225px 15px 255px / 225px 15px 255px 15px;
  --schatten: 4px 5px 0 rgba(20, 32, 44, .12);

  --titel: 'Archivo', 'Bahnschrift', 'Arial Narrow', system-ui, sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --hand: 'Caveat', 'Segoe Script', cursive;

  --breite: 780px;
}

/* --------------------------------------------------------------- Grundlage */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  /* Karopapier, Raster 24 px – über die ganze Seite */
  background-color: var(--creme);
  background-image:
    linear-gradient(rgba(20, 32, 44, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 44, .055) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--tinte);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--breite); margin: 0 auto; padding: 0 20px; }
.wrap.breit { max-width: 1120px; }

h1, h2, h3 {
  font-family: var(--titel);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 .4em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

a { color: var(--petrol-dunkel); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--tinte); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--petrol);
  outline-offset: 2px;
}

.hand {
  font-family: var(--hand);
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--petrol-dunkel);
}

.klein { font-size: .9rem; color: var(--grau); }
.grau { color: var(--grau); }
.mitte { text-align: center; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ Kopf */
header.kopf {
  border-bottom: 1px solid var(--linie);
  background: rgba(250, 248, 241, .92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.kopf .innen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.marke {
  font-family: var(--titel);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: .02em;
  color: var(--tinte);
  text-decoration: none;
}
.marke .punkt { color: var(--petrol); }
.kopf .zusatz { font-size: .9rem; color: var(--grau); }
.kopf a.zurueck { font-size: .95rem; }

/* ------------------------------------------------------------------ Karo */
/* Das Karopapier liegt jetzt auf dem body (siehe oben), nicht mehr
   nur hinter dem Kopfbereich. Die Karten sind deckend, es steht also
   nie Fliesstext direkt auf dem Raster. */

.hero { padding: 44px 0 36px; border-bottom: 1px solid var(--linie); }
.hero p.lead { font-size: 1.15rem; color: var(--grau); max-width: 48ch; margin-bottom: 0; }

/* ----------------------------------------------------------------- Karten */
main { padding: 32px 0 64px; }

.karte {
  background: var(--weiss);
  border: 2px solid var(--tinte);
  border-radius: var(--wobble);
  box-shadow: var(--schatten);
  padding: 22px 24px;
  margin: 0 0 22px;
}
.karte:nth-child(even) { border-radius: var(--wobble-2); }

.karte.ruhig {
  border: 1px solid var(--linie);
  border-radius: 8px;
  box-shadow: none;
}

/* Kurskarte in der Liste */
.kurs-karte { display: block; text-decoration: none; color: inherit; }
.kurs-karte:hover { transform: translate(-1px, -1px) rotate(-.4deg); color: inherit; }
.kurs-karte { transition: transform .13s ease, box-shadow .13s ease; }
.kurs-karte:hover { box-shadow: 6px 7px 0 rgba(20, 32, 44, .14); }

.kurs-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.kurs-datum {
  font-family: var(--titel);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: .01em;
}
.kurs-titel { font-family: var(--titel); font-weight: 700; font-size: 1.15rem; }

.zeilen { margin: 14px 0 0; padding: 0; list-style: none; font-size: 1rem; }
.zeilen li { display: flex; gap: 10px; padding: 3px 0; }
.zeilen .bez { color: var(--grau); min-width: 5.6em; flex: none; }

/* -------------------------------------------------------------- Merkzeichen */
.merk {
  display: inline-block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--linie);
  background: var(--petrol-hell);
  color: var(--petrol-dunkel);
  white-space: nowrap;
}
.merk.warn { background: #FBF0DC; border-color: #E8D4A8; color: #7A5A12; }
.merk.aus { background: #F4E7E6; border-color: #E3C4C2; color: var(--rot); }
.merk.grau { background: #EFEDE6; color: var(--grau); }

/* ---------------------------------------------------------------- Knöpfe */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--text);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 13px 24px;
  border: 2px solid var(--tinte);
  border-radius: var(--wobble);
  background: var(--petrol);
  color: var(--weiss);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 4px 0 rgba(20, 32, 44, .16);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.knopf:hover {
  background: var(--petrol-dunkel);
  color: var(--weiss);
  transform: translate(-1px, -1px) rotate(-.5deg);
  box-shadow: 5px 6px 0 rgba(20, 32, 44, .18);
}
.knopf:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(20, 32, 44, .16); }
.knopf[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.knopf.hell { background: var(--weiss); color: var(--petrol-dunkel); }
.knopf.hell:hover { background: var(--petrol-hell); color: var(--petrol-dunkel); }
.knopf.klein { padding: 7px 14px; font-size: .9rem; border-width: 1px; border-radius: 6px; box-shadow: none; }
.knopf.klein:hover { transform: none; box-shadow: none; }
.knopf.gefahr { background: var(--rot); }
.knopf.breit { width: 100%; }

/* --------------------------------------------------------------- Formular */
.feld { margin: 0 0 18px; }
.feld > label, .gruppe > legend {
  display: block;
  font-weight: 600;
  font-size: .97rem;
  margin: 0 0 5px;
}
.feld .hinweis { font-size: .87rem; color: var(--grau); margin: 0 0 6px; }

input[type=text], input[type=email], input[type=date], input[type=time],
input[type=number], input[type=password], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--tinte);
  background: var(--weiss);
  border: 1.5px solid var(--linie);
  border-radius: 6px;
  padding: 11px 12px;
}
input:hover, select:hover, textarea:hover { border-color: #cfc8b6; }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(var(--weiss), var(--weiss)); }

.feld.falsch input, .feld.falsch select, .feld.falsch textarea { border-color: var(--rot); }
.feld .fehler { display: none; color: var(--rot); font-size: .88rem; margin: 5px 0 0; }
.feld.falsch .fehler { display: block; }

.reihe { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .reihe.zwei { grid-template-columns: 1fr 1fr; }
  .reihe.strasse { grid-template-columns: 3fr 1fr; }
  .reihe.plz { grid-template-columns: 1fr 2fr; }
}

.gruppe { border: 0; padding: 0; margin: 0 0 18px; }
.wahl { display: block; padding: 9px 12px; border: 1.5px solid var(--linie); border-radius: 6px; margin: 0 0 7px; cursor: pointer; background: var(--weiss); }
.wahl:hover { border-color: var(--petrol); }
.wahl input { margin-right: 9px; accent-color: var(--petrol); }
.wahl.aktiv { border-color: var(--petrol); background: var(--petrol-hell); }

.kasten-hinweis {
  background: var(--petrol-hell);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: .95rem;
  margin: 0 0 20px;
}

.pflicht-stern { color: var(--petrol-dunkel); }

/* Honigtopf gegen Roboter: unsichtbar, aber nicht display:none */
.honig {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ Liste */
ul.haken { list-style: none; margin: 8px 0 0; padding: 0; }
ul.haken li { padding: 4px 0 4px 26px; position: relative; }
ul.haken li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: .66em;
  width: 11px;
  height: 6px;
  border-left: 2.5px solid var(--petrol);
  border-bottom: 2.5px solid var(--petrol);
  transform: rotate(-45deg);
}

/* ---------------------------------------------------------------- Meldung */
.meldung { padding: 14px 16px; border-radius: 8px; margin: 0 0 20px; font-size: .97rem; }
.meldung.gut { background: var(--petrol-hell); color: var(--petrol-dunkel); }
.meldung.schlecht { background: #F4E7E6; color: var(--rot); }
.meldung.info { background: #EFEDE6; color: var(--grau); }

.laden { color: var(--grau); padding: 20px 0; }

/* ------------------------------------------------------------------ Fuss */
footer.fuss {
  border-top: 1px solid var(--linie);
  padding: 26px 0 40px;
  font-size: .88rem;
  color: var(--grau);
}
footer.fuss a { color: var(--grau); }
footer.fuss .zeile { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
footer.fuss img { height: 26px; width: auto; opacity: .8; }

/* ---------------------------------------------------------------- Tabelle */
table.liste { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.liste th, table.liste td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste th { background: var(--petrol-hell); font-family: var(--titel); font-weight: 700; font-size: .9rem; white-space: nowrap; }
table.liste tr.abgemeldet td { color: var(--grau); text-decoration: line-through; }
.tabelle-rahmen { overflow-x: auto; }

/* ------------------------------------------------------------------ Admin */
.admin-kopf { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 22px; }
.reiter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.reiter button {
  font: inherit; font-size: .95rem; font-weight: 600;
  padding: 8px 16px; cursor: pointer;
  background: var(--weiss); color: var(--grau);
  border: 1.5px solid var(--linie); border-radius: 999px;
}
.reiter button.aktiv { background: var(--petrol); border-color: var(--petrol); color: var(--weiss); }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
dialog {
  border: 2px solid var(--tinte);
  border-radius: 10px;
  padding: 0;
  max-width: 680px;
  width: calc(100% - 32px);
  background: var(--weiss);
  color: var(--tinte);
}
dialog::backdrop { background: rgba(20, 32, 44, .45); }
dialog .inhalt { padding: 22px 24px; }

@media print {
  header.kopf, .reiter, .werkzeuge, footer.fuss, .knopf { display: none !important; }
  body { background: #fff; }
  .karte { box-shadow: none; border: 1px solid #ccc; border-radius: 4px; }
}

/* Fehlermeldungen auch in Auswahlgruppen (fieldset) */
.gruppe .fehler { display: none; color: var(--rot); font-size: .88rem; margin: 5px 0 0; }
.gruppe.falsch .fehler { display: block; }
.gruppe.falsch .wahl { border-color: var(--rot); }

/* Freiwillige Angaben, eingeklappt – hält das Formular kurz */
details.mehr {
  border: 1px solid var(--linie);
  border-radius: 8px;
  background: var(--weiss);
  padding: 0 14px;
  margin: 0 0 18px;
}
details.mehr > summary {
  cursor: pointer;
  padding: 13px 0;
  font-weight: 600;
  font-size: .95rem;
  color: var(--petrol-dunkel);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
details.mehr > summary::-webkit-details-marker { display: none; }
details.mehr > summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  border: 1.5px solid var(--linie);
  border-radius: 5px;
  font-size: 1rem;
  line-height: 1;
}
details.mehr[open] > summary::before { content: '\2212'; }
details.mehr[open] > summary { border-bottom: 1px solid var(--linie); margin-bottom: 16px; }
details.mehr .feld:last-child { margin-bottom: 16px; }

/* ---------------------------------------------------- Einklappbare Blöcke */
/* Kursseite: Lernziele, Mitbringen, Gut zu wissen. Zu, bis jemand hinschaut. */
details.klapp {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: 0 22px;
  margin: 0 0 12px;
}
details.klapp > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  font-family: var(--titel);
  font-weight: 700;
  font-size: 1.15rem;
}
details.klapp > summary::-webkit-details-marker { display: none; }
details.klapp > summary::after {
  content: '';
  margin-left: auto;
  width: 9px;
  height: 9px;
  flex: none;
  border-right: 2.5px solid var(--petrol);
  border-bottom: 2.5px solid var(--petrol);
  transform: rotate(45deg) translateY(-3px);
  transition: transform .15s ease;
}
details.klapp[open] > summary::after { transform: rotate(-135deg) translateY(1px); }
details.klapp[open] > summary { border-bottom: 1px solid var(--linie); }
details.klapp .haken { margin: 14px 0 18px; }

/* Das Anmeldeformular liegt hinter einem grossen Knopf. Zu = nur der Knopf,
   offen = die weisse Karte mit dem Formular. */
details.anmeldung { margin: 26px 0 0; }
details.anmeldung > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  font-family: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--weiss);
  background: var(--petrol);
  border: 2px solid var(--tinte);
  border-radius: var(--wobble);
  box-shadow: 3px 4px 0 rgba(20, 32, 44, .16);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
details.anmeldung > summary::-webkit-details-marker { display: none; }
details.anmeldung > summary:hover {
  background: var(--petrol-dunkel);
  transform: translate(-1px, -1px) rotate(-.5deg);
  box-shadow: 5px 6px 0 rgba(20, 32, 44, .18);
}
details.anmeldung[open] {
  background: var(--weiss);
  border: 2px solid var(--tinte);
  border-radius: var(--wobble);
  box-shadow: var(--schatten);
  padding: 22px 24px;
}
details.anmeldung[open] > summary {
  justify-content: flex-start;
  padding: 0 0 16px;
  font-family: var(--titel);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--tinte);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
details.anmeldung[open] > summary:hover { transform: none; box-shadow: none; background: transparent; }
