/* =========================================================================
   UNICON 22 · Einrad-Triathlon · Anmeldung
   Gestaltung übernommen aus dem Fun- & Community-Plan und den A4-Aushängen:
   Papierton, Tiefblau als Grundfarbe, Orange als Akzent, kursive Serifen-
   Überschriften, harte Schlagschatten statt Weichzeichner.
   ========================================================================= */

:root {
  --paper: #f6f1e4;
  --paper-2: #ede6cc;
  --paper-3: #fdfaf0;
  --ink: #1b2a6b;
  --muted: #5a6a9a;
  --line: #bfc8e8;
  --line-2: #9aa5d0;
  --accent: #f07820;
  --warn: #7b2a90;
  --danger: #b3261e;
  --ok: #1e8e4a;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Georgia", "Times New Roman", serif;
  --content-max: 940px;
}

/* Grünes Layout nach erfolgreicher Anmeldung – dieselbe Struktur, andere Farbwelt. */
body.theme-success {
  --paper: #e9f6ec;
  --paper-2: #d1ebd8;
  --paper-3: #f5fbf6;
  --ink: #114a2c;
  --muted: #497a5d;
  --line: #bcdcc6;
  --line-2: #8cbf9e;
  --accent: #1e8e4a;
}

*, *::before, *::after { box-sizing: border-box; }

/* Muss vor allen Layoutregeln stehen: `display:flex` auf .field/.check würde
   das native [hidden] sonst aushebeln und bedingte Felder sichtbar lassen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ Kopf */

.topbar {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .brand img { height: 30px; width: auto; display: block; }
.topbar .brand span {
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.topnav { display: flex; align-items: stretch; border: 1.5px solid var(--ink); }
.topnav a, .topnav button {
  background: transparent; color: var(--ink); border: 0;
  border-right: 1px solid var(--ink); padding: 7px 13px;
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  display: flex; align-items: center; white-space: nowrap;
}
.topnav > :last-child { border-right: 0; }
.topnav a:hover, .topnav button:hover { background: var(--ink); color: var(--paper); }
.topnav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.wrap { max-width: var(--content-max); margin: 0 auto; padding: 26px 20px 60px; }
.wrap.wide { max-width: 1500px; }

/* ------------------------------------------------------------- Titelblock */

.kicker {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 800; margin: 0 0 6px;
}
h1 {
  font-family: var(--serif); font-style: italic; font-weight: 900;
  font-size: clamp(30px, 6vw, 46px); line-height: 1; letter-spacing: -.02em;
  margin: 0 0 6px;
}
.subtitle { font-size: 15px; font-weight: 700; color: var(--muted); margin: 0 0 20px; }
h2 {
  font-family: var(--serif); font-style: italic; font-weight: 900;
  font-size: 23px; margin: 34px 0 12px; letter-spacing: -.01em;
}
h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; }
.lede { font-family: var(--serif); font-size: 17px; line-height: 1.5; margin: 0 0 14px; }
p { margin: 0 0 12px; }

.rule { border: 0; border-top: 3px double var(--ink); margin: 26px 0; opacity: .5; }

/* ----------------------------------------------------------------- Karten */

.card {
  background: var(--paper-3);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 var(--paper-2);
  padding: 20px 22px;
  margin: 0 0 26px;
}
.card.tight { padding: 14px 16px; }

/* Faktenraster wie auf den A4-Aushängen */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1.5px solid var(--ink); background: var(--paper-3); margin: 0 0 26px;
}
.fact { padding: 11px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.f-k { font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.f-v { font-size: 14px; font-weight: 700; line-height: 1.3; margin-top: 2px; }
.f-n { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.3; margin-top: 2px; }

/* ------------------------------------------------------------- Platzstand */

.gauge { border: 2px solid var(--ink); background: var(--paper-3); padding: 13px 16px; margin: 0 0 26px; }
.gauge-top { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.gauge-main { font-size: 16px; font-weight: 800; }
.gauge-side { font-size: 12px; font-weight: 700; color: var(--muted); }
.bar { height: 12px; background: var(--paper-2); border: 1.5px solid var(--ink); margin-top: 9px; position: relative; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar.full i { background: var(--warn); }

/* ---------------------------------------------------------------- Hinweis */

.note { display: flex; border: 1.5px solid var(--ink); background: var(--paper-3); margin: 0 0 22px; }
.note .tag {
  display: flex; align-items: center; background: var(--ink); color: var(--paper);
  padding: 0 13px; font-size: 10px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; white-space: nowrap; text-align: center;
}
.note .txt { padding: 10px 14px; font-size: 13.5px; line-height: 1.45; font-weight: 600; }
.note.warn .tag { background: var(--warn); }
.note.err .tag { background: var(--danger); }
.note.ok .tag { background: var(--ok); }

/* --------------------------------------------------------------- Formular */

fieldset { border: 0; padding: 0; margin: 0 0 4px; }
legend {
  font-size: 11.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); padding: 0; margin: 0 0 12px;
  border-bottom: 1.5px solid var(--line); width: 100%; padding-bottom: 6px;
}

.grid { display: grid; gap: 16px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .span2 { grid-column: 1 / -1; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } .grid .span2 { grid-column: auto; } }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .lbl {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.req { color: var(--accent); }
.opt { color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 11px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.4; font-weight: 500; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="search"], select, textarea {
  font: inherit; font-size: 16px;      /* 16px verhindert Zoom auf iOS */
  color: var(--ink); background: var(--paper-3);
  border: 1.5px solid var(--line-2); padding: 10px 12px; width: 100%;
  border-radius: 0; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: 34px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); background: #fff; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger); border-width: 2px; background: #fdf3f2;
}
.err-msg { font-size: 12px; font-weight: 700; color: var(--danger); }

/* Auswahlkacheln (Radio) */
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choices.cols { flex-direction: column; }
/* Kurze Beschriftungen ohne Hinweiszeile passen zu dritt in eine Spalte. */
.choices.tight .choice { flex: 1 1 60px; }
.choice {
  flex: 1 1 150px; display: flex; gap: 9px; align-items: flex-start;
  border: 1.5px solid var(--line-2); background: var(--paper-3);
  padding: 10px 12px; cursor: pointer; min-width: 0;
}
.choice:hover { border-color: var(--ink); }
.choice input { margin: 2px 0 0; flex: none; width: 17px; height: 17px; accent-color: var(--accent); }
/* Beide sind <span> – ohne display:block klebte der Hinweis am Titel. */
.choice > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.choice .c-t { display: block; font-size: 14px; font-weight: 700; line-height: 1.25; }
.choice .c-h { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.choice:has(input:checked) { border-color: var(--ink); border-width: 2px; background: var(--paper-2); padding: 9.5px 11.5px; }

/* Bestätigungen (Checkbox) */
.check { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.check:first-of-type { border-top: 0; }
.check input { margin: 2px 0 0; flex: none; width: 19px; height: 19px; accent-color: var(--accent); }
.check .c-body { font-size: 13.5px; line-height: 1.45; }
.check.invalid { background: #fdf3f2; box-shadow: -8px 0 0 #fdf3f2, 8px 0 0 #fdf3f2; }
.check.invalid .err-msg { margin-top: 3px; }

/* Ehrenfalle für automatische Ausfüller – für Menschen unsichtbar. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; padding: 13px 26px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--paper-3); color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 4px 4px 0 var(--paper-2);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.small { font-size: 11px; padding: 8px 14px; box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

/* --------------------------------------------------------- Bestätigung */

.hero-ok { text-align: center; border: 3px double var(--ink); background: var(--paper-3); padding: 30px 22px; margin: 0 0 26px; box-shadow: 7px 7px 0 var(--paper-2); }
.hero-ok .mark {
  width: 62px; height: 62px; margin: 0 auto 14px; border: 3px solid var(--ok);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--ok); line-height: 1;
}
.hero-ok h1 { margin-bottom: 8px; }
.hero-ok p { max-width: 560px; margin: 0 auto; font-size: 15px; }

.bignum { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 26px; }
.bignum > div { flex: 1 1 220px; border: 2px solid var(--ink); background: var(--paper-3); padding: 15px 18px; box-shadow: 5px 5px 0 var(--paper-2); }
.bignum .k { font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.bignum .v { font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 44px; line-height: 1.05; letter-spacing: -.02em; }
.bignum .v.code { font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace; font-style: normal; font-size: 27px; letter-spacing: .04em; word-break: break-all; }
.bignum .n { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 5px; line-height: 1.35; }

/* Angaben-Tabelle */
.dl { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; border-top: 1px solid var(--line); }
.dl > dt, .dl > dd { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; min-width: 0; }
.dl > dt { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-right: 16px; }
.dl > dd { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .dl { grid-template-columns: 1fr; }
  .dl > dt { border-bottom: 0; padding-bottom: 0; }
  .dl > dd { padding-top: 2px; }
}

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 9px 0 9px 26px; border-bottom: 1px solid var(--line); font-size: 14px; position: relative; }
ul.plain li::before { content: "▸"; position: absolute; left: 4px; color: var(--accent); font-weight: 900; }
ul.plain li:last-child { border-bottom: 0; }

/* Zeitplan */
.timeline { border: 1.5px solid var(--ink); background: var(--paper-3); }
.tl-row { display: grid; grid-template-columns: 118px 1fr; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-t { padding: 9px 13px; font-weight: 800; font-size: 13.5px; background: var(--paper-2); border-right: 1px solid var(--line); }
.tl-d { padding: 9px 13px; font-size: 13.5px; }

/* ------------------------------------------------------------- Tabellen */

.tablewrap { overflow-x: auto; border: 1.5px solid var(--ink); background: var(--paper-3); }
table.list { border-collapse: collapse; width: 100%; font-size: 13px; }
table.list th, table.list td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list th { background: var(--ink); color: var(--paper); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; position: sticky; top: 0; }
table.list tbody tr:nth-child(even) { background: var(--paper); }
table.list td.num { text-align: right; font-weight: 700; }
table.list td.wrap { white-space: normal; min-width: 200px; }
.badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); }
.badge.wl { color: var(--accent); }
.badge.no { color: var(--danger); }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 0 0 24px; }
.stat { border: 1.5px solid var(--ink); background: var(--paper-3); padding: 12px 14px; }
.stat .k { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.stat .v { font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 30px; line-height: 1.1; }

/* ------------------------------------------------------------------ Fuss */

.foot { border-top: 2px solid var(--ink); margin-top: 40px; padding: 16px 20px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.foot div { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }

/* ----------------------------------------------------------------- Druck */

@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: #fff; }
  .topbar, .topnav, .foot, .noprint, .actions { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card, .hero-ok, .tablewrap, .gauge, .facts { box-shadow: none; break-inside: avoid; }
  table.list { font-size: 9.5pt; }
  table.list th { position: static; }
  table.list thead { display: table-header-group; }
  table.list tr { break-inside: avoid; }
  a[href]::after { content: ""; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print { .print-portrait { page: portrait; } }
