/* Mobile zuerst — die meisten Fahrer:innen füllen das auf dem Handy aus. */

:root {
  --rot: #e72b37;          /* Unia-Rot, von unia.ch */
  --rot-dunkel: #c21f2a;
  --text: #000;
  --grau: #585858;
  --linie: #e5e5e5;
  --flaeche: #f6f6f6;
  --warnung-bg: #fff6e5;
  --warnung-linie: #e6a300;
  --erfolg-bg: #e8f5ec;
  --erfolg-linie: #1e8b4d;
  --fehler: #c0001a;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Unia nutzt ITC Franklin Gothic (lizenzpflichtig) mit Arial als Fallback. */
  font: 17px/1.55 Arial, sans-serif;
  color: var(--text);
  background: #fff;
}

header {
  border-bottom: 4px solid var(--rot);
  padding: 1rem;
}
header .logo { display: block; width: 7rem; height: auto; margin-bottom: .6rem; }
header h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
header .untertitel { margin: .4rem 0 0; font-size: .92rem; color: var(--grau); }

footer {
  max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--linie);
  font-size: .85rem; color: var(--grau);
}
footer a { color: inherit; }
footer a, .schritt p > a { display: inline-block; padding: .75rem 0; }

main { max-width: 44rem; margin: 0 auto; padding: 1rem 1rem 4rem; }

/* --- Fortschritt ------------------------------------------------------- */

#fortschritt { max-width: 44rem; margin: 0 auto; padding: .8rem 1rem 0; }
.balken { height: 6px; background: var(--flaeche); border-radius: 3px; overflow: hidden; }
#balken-fuellung { height: 100%; width: 0; background: var(--rot); transition: width .25s ease; }
#fortschritt-text { margin: .4rem 0 0; font-size: .85rem; color: var(--grau); }

/* --- Schritte ---------------------------------------------------------- */

.schritt { display: none; }
.schritt.aktiv { display: block; }

h2 { font-size: 1.3rem; line-height: 1.3; margin: .6rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
p  { margin: .6rem 0; }

.hinweis { color: var(--grau); font-size: .92rem; margin: .2rem 0 .5rem; }

ol, ul { padding-left: 1.3rem; }
li { margin: .4rem 0; }

/* --- Kästen ------------------------------------------------------------ */

.kasten {
  background: var(--flaeche);
  border-left: 4px solid var(--linie);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin: 1rem 0;
  white-space: pre-line;   /* Adressblöcke behalten ihre Zeilenumbrüche */
}
.kasten h2, .kasten h3 { margin-top: 0; }
.kasten.warnung { background: var(--warnung-bg); border-left-color: var(--warnung-linie); }
.kasten.erfolg  { background: var(--erfolg-bg);  border-left-color: var(--erfolg-linie); }
.kasten.fehler-kasten { background: #fdecee; border-left-color: var(--fehler); }

details {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 0 .9rem;
  margin: .8rem 0;
}
details[open] { padding-bottom: 1rem; }
/* Mind. 44 px Tippfläche — auf dem Handy wird mit dem Daumen getroffen. */
summary { cursor: pointer; font-weight: 600; padding: .75rem 0; }

.bilder { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .8rem; }
.bilder img { width: calc(33.333% - .4rem); min-width: 130px; border: 1px solid var(--linie); border-radius: 6px; }
img.breit { width: 100%; margin-top: .8rem; border: 1px solid var(--linie); border-radius: 6px; }

/* --- Felder ------------------------------------------------------------ */

label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
label + .hinweis { margin-top: -.15rem; }

input[type=text], input[type=email], input[type=tel], input[type=date], select {
  width: 100%;
  padding: .7rem .75rem;
  font: inherit;
  color: inherit;
  border: 1px solid #9a9a9a;
  border-radius: var(--radius);
  background: #fff;
}
input:focus, select:focus, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--rot);
  outline-offset: 1px;
}
input.ungueltig { border-color: var(--fehler); background: #fff7f8; }

.paar { display: flex; gap: .8rem; }
.paar > div { flex: 1; }
.paar > div.schmal { flex: 0 0 7rem; }

fieldset { border: 0; padding: 0; margin: 1.4rem 0 0; }
legend { font-weight: 600; padding: 0; }

/* Auswahlkarten statt kleiner Radiobuttons — auf dem Handy besser treffbar */
.wahl { display: flex; flex-direction: column; gap: .5rem; margin-top: .6rem; }
.wahl.schmal-wahl { flex-direction: row; flex-wrap: wrap; }
.wahl.schmal-wahl .karte { flex: 1; min-width: 6rem; }

.karte {
  display: flex; align-items: center; gap: .6rem;
  border: 1px solid #9a9a9a; border-radius: var(--radius);
  padding: .8rem .9rem; margin: 0;
  font-weight: 400; cursor: pointer;
}
.karte:has(input:checked) { border-color: var(--rot); border-width: 2px; background: #fdf3f4; padding: calc(.8rem - 1px) calc(.9rem - 1px); }
.karte input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--rot); flex: none; }

.ankreuz {
  display: flex; align-items: flex-start; gap: .6rem;
  font-weight: 400; margin: 1.4rem 0 .4rem;
  cursor: pointer;
}
.ankreuz input { width: 1.3rem; height: 1.3rem; margin: .1rem 0 0; accent-color: var(--rot); flex: none; }

.fehler { color: var(--fehler); font-weight: 600; font-size: .92rem; margin: .35rem 0; }

/* --- Jahreskarten ------------------------------------------------------ */

.jahr {
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin: 1rem 0;
}
.jahr h3 { margin-top: 0; }
.jahr-felder { margin-top: .5rem; }
.jahr-ergebnis {
  margin-top: .8rem; padding-top: .7rem;
  border-top: 1px dashed var(--linie);
  font-size: .95rem; color: var(--grau);
}
.jahr-ergebnis strong { color: var(--text); }

.feld-hilfe img { width: 100%; max-width: 26rem; border: 1px solid var(--linie); border-radius: 6px; margin-top: .5rem; }
.feld-hilfe { margin: .3rem 0 0; padding: 0 .8rem; }
.feld-hilfe summary { font-weight: 400; font-size: .92rem; color: var(--rot); }

/* --- Beilagen ---------------------------------------------------------- */

.datei-knopf {
  display: inline-block;
  margin: .6rem 0 0;
  padding: .8rem 1.2rem;
  border: 1px solid var(--rot);
  border-radius: var(--radius);
  color: var(--rot);
  font-weight: 600;
  cursor: pointer;
}
.datei-knopf:hover { background: #fdf3f4; }
.datei-knopf input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.datei-knopf:focus-within { outline: 3px solid var(--rot); outline-offset: 1px; }

.beilagen-liste { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .6rem; }

figure.beilage { margin: 0; width: calc(50% - .4rem); }
figure.beilage img {
  width: 100%; height: 9rem; object-fit: cover; object-position: top;
  border: 1px solid var(--linie); border-radius: 6px; background: #fff;
}
figure.beilage figcaption {
  display: flex; align-items: center; justify-content: space-between;
  gap: .4rem; font-size: .85rem; color: var(--grau); margin-top: .25rem;
}

button.klein { min-height: 0; padding: .25rem .6rem; font-size: .85rem; font-weight: 400; }

p.laedt { color: var(--grau); font-size: .92rem; }
.hinweis.betont { color: var(--text); font-weight: 600; }

#zwischenstand {
  position: sticky; bottom: 0;
  background: #fff; border-top: 2px solid var(--rot);
  padding: .7rem 0; margin-top: 1rem;
  font-weight: 600;
}

/* --- Zusammenfassung --------------------------------------------------- */

.zus-block { margin: 1.2rem 0; }
.zus-block h3 { margin-bottom: .3rem; }
.zus-zeile { display: flex; gap: .8rem; padding: .3rem 0; border-bottom: 1px solid var(--flaeche); }
.zus-zeile dt { flex: 0 0 40%; color: var(--grau); margin: 0; font-size: .95rem; }
.zus-zeile dd { flex: 1; margin: 0; }

.tabellen-rahmen { overflow-x: auto; }
table { width: 100%; min-width: 21rem; border-collapse: collapse; margin: .6rem 0; font-size: .95rem; }
th, td { text-align: right; padding: .45rem .3rem; border-bottom: 1px solid var(--linie); }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--grau); font-weight: 600; }
tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--text); }

.formeln { font-size: .85rem; color: var(--grau); }
.formeln div { margin: .15rem 0; }

/* --- Knöpfe ------------------------------------------------------------ */

.knoepfe { display: flex; gap: .8rem; margin: 1.8rem 0 0; }
.knoepfe .zurueck { flex: 0 0 auto; }
.knoepfe .weiter, .knoepfe button:last-child:not(.zurueck) { flex: 1; }

button, a.knopf {
  font: inherit; font-weight: 600;
  padding: .85rem 1.2rem;
  border: 0; border-radius: var(--radius);
  background: var(--rot); color: #fff;
  cursor: pointer;
  min-height: 3rem;
}
button:hover, a.knopf:hover { background: var(--rot-dunkel); }
a.knopf { display: inline-block; text-decoration: none; }
button.leise { background: transparent; color: var(--rot); border: 1px solid var(--rot); }
button.leise:hover { background: #fdf3f4; }
button.zurueck { background: transparent; color: var(--grau); border: 1px solid var(--linie); }
button.zurueck:hover { background: var(--flaeche); }
button.gross { width: 100%; font-size: 1.05rem; padding: 1rem; }
button[disabled] { opacity: .5; cursor: not-allowed; }

#adresse-kopieren { margin-top: .6rem; }

/* Spamfalle */
#f-website { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* --- Ab Tablet --------------------------------------------------------- */

@media (min-width: 40rem) {
  header { padding: 1.6rem 2rem; }
  header h1 { font-size: 1.6rem; }
  main { padding: 1.5rem 2rem 5rem; }
  h2 { font-size: 1.5rem; }
}
