:root {
  --teal:        #5bb8b6;
  --teal-light:  #b8e4e3;
  --teal-pale:   #e8f7f6;
  --teal-dark:   #2e8a88;
  --purple:      #3535a8;
  --purple-mid:  #2d2a8a;
  --purple-light:#c5c4f0;
  --purple-pale: #eeeefa;
  --cream:       #f7f8fd;
  --cream-mid:   #eceef8;
  --dark:        #1e1c6e;
  --muted:       #4a4880;
  --ok:          #1e8449;
  --err:         #c0392b;
  --err-bg:      #fdecea;
  --warn:        #8a5a00;
  --warn-bg:     #fff4e0;
}

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

body {
  margin: 0;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--dark);
  background: var(--cream);
  line-height: 1.6;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 2rem 1rem 3rem; }

.kopf { text-align: center; margin-bottom: .6rem; }
.logo { max-width: 180px; height: auto; }
.brand {
  text-align: center; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal-dark); font-weight: 500; margin-bottom: .6rem;
}

h1 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 400; font-size: clamp(1.8rem, 6vw, 2.4rem);
  text-align: center; margin: 0 0 1rem;
}
h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 500; font-size: 1.35rem; margin: 0;
}

.intro { text-align: center; color: var(--muted); font-weight: 300; margin: 0 0 1.4rem; }
.intro-karten { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: -.6rem 0 1.4rem; }
.intro-nachtrag { text-align: center; color: var(--muted); font-size: .92rem; margin: -.6rem 0 1.4rem; }
.intro-nachtrag strong { color: var(--teal-dark); font-weight: 500; }
.e-ab { margin: .5rem 0 0; }

/* Geburtstag des Pferdes (freiwillig) */
.geburt-block { margin: .4rem 0 1rem; }
.geburt-tipp { background: var(--purple-pale); color: var(--purple); border-radius: 10px; padding: .55rem .8rem; font-size: .9rem; margin: .2rem 0 .7rem; }
.geburt-felder { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: .5rem; }
.geburt-felder select { margin-bottom: .4rem; }
.pferd-geburt { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; margin: -.5rem 0 .9rem; color: var(--muted); font-size: .92rem; }
.geburt-form { margin: 0 0 1rem; }
.geb-wdh-label { margin-top: .3rem; }
.gutschein-box { background: #fdf0e6; border: 1.5px dashed #e8a46a; border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1rem; color: #7a4515; }
.gutschein-titel { font-weight: 500; }
.gutschein-code { font-family: "Playfair Display", Georgia, serif; font-size: 1.6rem; letter-spacing: .12em; color: #b5651d; margin: .2rem 0; }
.geb-regel { margin: .2rem 0 .8rem; }
.intro-karte { background: var(--teal-pale); border: 1.5px solid var(--teal-light); border-radius: 12px; padding: .8rem 1rem; }
.intro-karte p { margin: .25rem 0 0; color: var(--muted); font-weight: 300; font-size: .92rem; line-height: 1.45; }
.intro-titel { font-size: .82rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-dark); }
.intro-training { background: var(--purple-pale); border-color: var(--purple-light); }
.intro-training .intro-titel { color: var(--purple); }
@media (max-width: 520px) { .intro-karten { grid-template-columns: 1fr; } }
.zentriert { text-align: center; }
.gedimmt { color: var(--muted); }
.klein { font-size: .85rem; }

.card {
  background: #fff;
  border: 1.5px solid var(--teal-light);
  border-radius: 14px;
  padding: 1.3rem;
  margin-bottom: 1.2rem;
}

.feldlabel { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], select {
  width: 100%;
  background: var(--cream-mid);
  border: 1.5px solid var(--teal-light);
  color: var(--dark);
  padding: .7rem .85rem;
  font-family: inherit;
  font-size: 1rem;
  border-radius: 8px;
  outline: none;
  margin-bottom: .9rem;
}
input:focus, select:focus { border-color: var(--purple); }
input[type="date"] { color-scheme: light; min-height: 2.9rem; }

.zeile { display: flex; gap: .6rem; align-items: flex-start; }
.zeile input { flex: 1; min-width: 0; }
@media (max-width: 480px) { .zeile { flex-direction: column; align-items: stretch; } }

.namen { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 420px) { .namen { grid-template-columns: 1fr; gap: 0; } }

.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--muted); margin: .2rem 0 1rem; cursor: pointer; }
.consent input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; flex-shrink: 0; accent-color: var(--purple); }
.consent a { color: var(--purple); }

.btn-primary, .btn-outline {
  display: inline-block;
  font-family: inherit; font-size: .95rem; font-weight: 500;
  padding: .75rem 1.3rem; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--purple);
  min-height: 2.9rem;
}
.btn-primary { background: var(--purple); color: #fff; width: 100%; }
a.btn-primary { text-decoration: none; text-align: center; }
.btn-primary:hover { background: var(--purple-mid); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary.schmal { width: auto; white-space: nowrap; }
@media (max-width: 480px) { .btn-primary.schmal { width: 100%; } }
.btn-outline { background: transparent; color: var(--purple); }
.btn-outline:hover { background: var(--purple); color: #fff; }
.btn-outline:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: var(--purple); }

.link-btn { background: none; border: none; color: var(--purple); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; padding: 0; }

.status { font-size: .88rem; margin-top: .6rem; min-height: 1em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.hinweis-box { border-radius: 10px; padding: .8rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.fehler-box { background: var(--err-bg); color: var(--err); }

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

.gross-icon { font-size: 2.4rem; color: var(--teal-dark); line-height: 1; margin-bottom: .4rem; }

.begruessung { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* ── Pferde-Karte ─────────────────────────────────────── */
.pferd > h2 { margin-bottom: .8rem; }

/* Zwei Karten pro Pferd: Behandlung (türkis) und Training (lila) */
.karte + .karte { border-top: 1.5px solid var(--cream-mid); margin-top: 1.3rem; padding-top: 1.2rem; }
.karte-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.karte-titel { margin: 0; font-size: 1rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-dark); }
.karte-training .karte-titel { color: var(--purple); }
.karte-wert { font-family: "Playfair Display", Georgia, serif; font-size: 1.5rem; color: var(--purple); white-space: nowrap; }
.karte-regel { color: var(--muted); margin: .1rem 0 .8rem; }
.karte-training .feld { border-color: var(--purple-light); color: var(--purple-light); }
.karte-training .feld.voll { border-color: var(--purple); background: var(--purple-pale); color: var(--purple); }
.karte-training .feld.wartet { border-color: var(--purple-light); background: #f6f6fc; color: var(--muted); }

.felder { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-bottom: .8rem; }
.feld {
  aspect-ratio: 1;
  border: 2px dashed var(--teal-light);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--teal-light); font-size: .8rem; text-align: center; line-height: 1.15;
}
.feld.voll {
  border: 2px solid var(--teal-dark);
  background: var(--teal-pale);
  color: var(--teal-dark);
  transform: rotate(-8deg);
}
.feld.voll .haken { font-size: 1.2rem; line-height: 1; }
.feld.voll .datum { font-size: .66rem; font-weight: 500; }
.feld.wartet { border: 2px dashed var(--purple-light); background: var(--purple-pale); color: var(--muted); font-size: .62rem; }
@media (max-width: 380px) { .feld.voll .datum { font-size: .58rem; } }

.karte-stand { color: var(--muted); margin: 0 0 .6rem; }
.offen-liste .eintrag { font-size: .85rem; padding: .4rem .7rem; border-radius: 8px; margin-bottom: .4rem; }
.eintrag.wartet { background: var(--purple-pale); color: var(--muted); }
.eintrag.abgelehnt { background: var(--warn-bg); color: var(--warn); }

.aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.aktionen .btn-primary { width: auto; }
@media (max-width: 420px) { .aktionen { grid-template-columns: 1fr; } }

.formular { border-top: 1px solid var(--cream-mid); margin-top: 1rem; padding-top: 1rem; }

.code-box {
  background: var(--purple-pale); border: 1.5px solid var(--purple-light);
  border-radius: 12px; padding: 1rem; text-align: center; margin: .6rem 0;
}
.code-text { font-family: "DM Sans", monospace; font-size: 2rem; font-weight: 500; letter-spacing: .12em; color: var(--purple); }
.code-info { font-weight: 500; margin-bottom: .3rem; }

.verlauf { margin-top: 1rem; font-size: .85rem; color: var(--muted); }
.verlauf summary { cursor: pointer; }
.verlauf ul { margin: .4rem 0 0; padding-left: 1.2rem; }

.kleingedrucktes { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 1.5rem; }
.fuss { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 2rem; }
.fuss a { color: var(--purple); }

/* Anmeldung per Code */
.code-anmeldung { text-align: left; border-top: 1px solid var(--cream-mid); margin: 1rem 0; padding-top: 1rem; }
#l-code { letter-spacing: .3em; font-size: 1.2rem; text-align: center; }

/* Hinweis „Als App aufs Handy“ */
.app-hinweis { display: flex; gap: .9rem; align-items: flex-start; position: relative; background: var(--purple-pale); border-color: var(--purple-light); }
.app-icon { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; box-shadow: 0 1px 4px rgba(30, 28, 110, .15); }
.app-text { flex: 1; padding-right: 1.2rem; }
.app-text p { margin: .2rem 0 .6rem; color: var(--muted); }
.app-text p:last-child { margin-bottom: 0; }
.schliessen { position: absolute; top: .4rem; right: .5rem; background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .3rem .5rem; }

/* Rechtstexte */
.rechts h2 { margin-top: 1.8rem; font-size: 1.15rem; }
.rechts p, .rechts li { color: var(--muted); font-weight: 300; }
.rechts .stand { text-align: center; margin-top: 2.5rem; font-size: .85rem; }

/* PIN-Anmeldung */
#pin-bereich { margin-top: .9rem; }
.pin-feld { letter-spacing: .35em; font-size: 1.15rem; }
.pin-karte h3 { margin: 0 0 .3rem; font-size: 1rem; font-weight: 500; color: var(--text, #1e1b4b); }
.pin-knoepfe { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.pin-knoepfe .btn-outline { width: auto; }
#pin-form { margin-top: 1rem; }
#pin-form .btn-primary { margin-top: .4rem; }
#lieber-link-wrap { margin: .6rem 0 0; }
.pin-huelle { position: relative; margin-bottom: .9rem; }
.pin-huelle .pin-feld { padding-right: 2.8rem; margin-bottom: 0; }
.pin-auge { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: none; border: none; padding: .4rem; cursor: pointer; color: var(--muted); line-height: 0; border-radius: 6px; }
.pin-auge:hover, .pin-auge:focus-visible { color: var(--purple); }
