/* Contrallion Konto – Farben, Schrift und Formen folgen der Contrallion-Website (DESIGN.md, brand.css). */

@font-face { font-family: Manrope; src: url(fonts/Manrope-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url(fonts/Manrope-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url(fonts/Manrope-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url(fonts/Manrope-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #000000; --bg-2: #0a0a0a; --surface: #0c0c0c; --surface-line: #252525;
  --text: #f2f2f2; --muted: #b8b8b8; --soft: #aaaaaa;
  --accent: #75c9ff; --accent-hover: #a4dfff; --accent-red: #ef5364; --danger: #f06470;
  --line: #2b2b2b; --focus: #9fdaff; --status: #bddff4; --input-border: #707070;
  --gutter: clamp(24px, 5vw, 80px);
  color-scheme: dark;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 Manrope, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2 { font-weight: 600; letter-spacing: -.045em; line-height: 1.04; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto; }
h1 { font-size: clamp(2.3rem, 4.4vw, 4.3rem); }
h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); margin-bottom: 28px; }
h2.klein { font-size: clamp(1.25rem, 1.8vw, 1.5rem); letter-spacing: -.03em; line-height: 1.25; margin-bottom: 14px; }
h3 { font-size: 1.05rem; font-weight: 500; letter-spacing: -.025em; line-height: 1.3; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
main:focus { outline: 0; }

.sprung { position: fixed; left: 20px; top: -100px; z-index: 10; padding: 12px 18px; color: var(--text); background: #111111; }
.sprung:focus { top: 14px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); border: 0; padding: 0; }
.leiser { color: var(--soft); font-size: .9rem; }
.nr { font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .05em; color: var(--accent-red); }

/* ---- Rahmen: links die Schiene mit Aussage und Stationen, rechts die Arbeitsfläche ---- */

.rahmen { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; max-width: 1320px; min-height: 100dvh; margin-inline: auto; }

.schiene {
  position: sticky; top: 0; height: 100dvh; overflow: hidden auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 40px;
  padding: 34px var(--gutter) 30px; border-right: 1px solid var(--line);
  view-transition-name: schiene;
}
.schiene::after { /* Verbindungszeichen als ruhiger Grund */
  content: ""; position: absolute; right: -150px; bottom: -130px; width: 520px; aspect-ratio: 1;
  background: url(mark.svg) center / contain no-repeat; opacity: .07; pointer-events: none; z-index: -1;
}

.wortmarke { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; color: var(--text); text-decoration: none; font-size: .94rem; font-weight: 700; letter-spacing: .09em; line-height: 1; white-space: nowrap; }
.wortmarke:hover { color: var(--text); }
.wortmarke img { flex: none; }
.wortmarke span { padding-left: 12px; border-left: 1px solid var(--input-border); color: var(--muted); font-weight: 500; letter-spacing: .08em; }

.aussage { margin-block: auto; }
.kennung { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; font-size: .76rem; line-height: 1.6; letter-spacing: .08em; color: var(--muted); }
.punkt { width: 7px; height: 7px; background: var(--accent-red); flex: none; }
.aussage h1 { max-width: 12ch; color: var(--accent); }
.aussage-text { margin-top: 24px; max-width: 34ch; color: var(--muted); font-size: 1.05rem; }
.adresse { overflow-wrap: anywhere; }
.regeln { list-style: none; padding: 0; margin-top: 26px; max-width: 40ch; color: var(--muted); font-size: .95rem; }
.regeln li { padding: 11px 0 11px 22px; border-top: 1px solid var(--line); position: relative; }
.regeln li::before { content: ""; position: absolute; left: 0; top: 1.42em; width: 7px; height: 1px; background: var(--accent); }

.stationen ol { list-style: none; padding: 0; border-left: 1px solid var(--line); }
.stationen li { position: relative; }
.stationen li::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .35s ease; }
.stationen .ist-aktiv::before { transform: scaleY(1); }
.station { display: flex; align-items: baseline; gap: 18px; padding: 9px 0 9px 22px; color: var(--soft); font-weight: 500; text-decoration: none; }
a.station:hover, .ist-aktiv .station { color: var(--text); }
.ist-fertig .nr { color: var(--status); }

.schiene-fuss { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; position: relative; font-size: .86rem; color: var(--muted); }
.schiene-fuss::before { content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 2px; background: var(--accent-red); }
.wer { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leise { font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--accent); padding: 6px 0; cursor: pointer; white-space: nowrap; }
.leise:hover { color: var(--accent-hover); }

main { padding: clamp(40px, 9vh, 110px) var(--gutter) 34px; display: flex; flex-direction: column; min-width: 0; }
main > section, .meldung, .fuss { width: 100%; max-width: 640px; }
main > section + section { margin-top: 52px; padding-top: 34px; border-top: 1px solid var(--line); }
main > section p + p { margin-top: 10px; }
.abschnitt { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; font-size: .76rem; line-height: 1.6; letter-spacing: .08em; color: var(--muted); }
.hinweis p { color: var(--muted); max-width: 52ch; }

.fuss { margin-top: auto; padding-top: 64px; color: var(--soft); font-size: .8rem; }
.fuss p + p { margin-top: 4px; }

/* ---- Meldungen ---- */

.meldung { margin-bottom: 34px; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent); font-weight: 500; }
.meldung--fehler { border-left-color: var(--danger); }
.meldung--hinweis { border-left-color: var(--status); color: var(--status); }

/* ---- Arbeitsfläche mit Formular ---- */

.flaeche { position: relative; padding: clamp(22px, 4vw, 40px); background: var(--surface); border: 1px solid var(--surface-line); border-radius: 2px; }
.flaeche::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: var(--accent); transform: scaleX(.12); transform-origin: left; transition: transform .5s ease; }
.flaeche:focus-within::before { transform: scaleX(1); }

.formular { display: grid; gap: 22px; }
.feld { display: grid; gap: 8px; }
label { font-size: .9rem; font-weight: 500; color: var(--muted); }
input[type=email], input[type=password], input[type=text] {
  width: 100%; min-height: 50px; padding: 11px 14px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--input-border); border-radius: 2px;
}
input:hover { border-color: var(--soft); }
input:focus-visible { outline-offset: 0; border-color: var(--focus); }
input[aria-invalid=true] { border-color: var(--danger); }
.auswahl { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.auswahl legend { padding: 0; margin-bottom: 4px; font-size: .9rem; font-weight: 500; color: var(--muted); }
.auswahl label { color: var(--text); font-size: 1rem; overflow-wrap: anywhere; }
.schritte { display: grid; gap: 14px; margin: 0 0 26px; padding-left: 1.3em; color: var(--muted); }
.schritte .qr, .schritte .wert { margin-top: 12px; }
.mit-knopf { display: flex; }
.mit-knopf input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.zeigen { flex: none; min-width: 6.4em; padding: 0 14px; font: inherit; font-size: .86rem; color: var(--text); background: #191919; border: 1px solid var(--input-border); border-left: 0; border-radius: 0 2px 2px 0; cursor: pointer; }
.zeigen:hover { background: #222222; }

.knopf { justify-self: start; min-height: 50px; padding: 0 30px; font: inherit; font-weight: 600; color: #000000; background: var(--accent); border: 0; border-radius: 2px; cursor: pointer; transition: background .2s, transform .2s; }
.knopf:hover { background: var(--accent-hover); }
.knopf:active { transform: translateY(1px); }

/* Linie statt Balken: Speicherstand und Passwortlänge */
.linie { display: block; width: 100%; height: 2px; margin-top: 10px; border: 0; appearance: none; -webkit-appearance: none; background: var(--line); color: var(--accent); }
.linie::-webkit-progress-bar { background: var(--line); }
.linie::-webkit-progress-value { background: var(--accent); transition: width .2s ease; }
.linie::-moz-progress-bar { background: var(--accent); }
.laenge-linie { margin-top: 2px; color: var(--accent-red); }
.laenge-linie::-webkit-progress-value { background: var(--accent-red); }
.laenge-linie::-moz-progress-bar { background: var(--accent-red); }
.laenge-linie.ist-erreicht { color: var(--accent); }
.laenge-linie.ist-erreicht::-webkit-progress-value { background: var(--accent); }
.laenge-linie.ist-erreicht::-moz-progress-bar { background: var(--accent); }
.laenge { font-variant-numeric: tabular-nums; }

/* ---- Zeilen mit Kennbuchstabe, Inhalt und Aktion ---- */

.signale { list-style: none; padding: 0; }
.signale > li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px 18px; align-items: start; padding: 22px 0; border-top: 1px solid var(--line); }
.signale .nr { padding-top: 5px; }
.signale h3 { margin-bottom: 4px; }
.signale p { color: var(--muted); }
.pfeil { display: inline-flex; align-items: center; gap: 14px; padding-block: 8px; font-size: .95rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--accent); white-space: nowrap; }
.pfeil:hover { color: var(--accent-hover); }
.pfeil span { display: inline-block; transition: transform .25s; }
.pfeil:hover span { transform: translate(3px, -3px); }
.pfeil[download]:hover span { transform: translateY(3px); }

/* QR-Code: dunkle Module auf hellem Grund, damit jede Kamera ihn liest */
.qr { width: 132px; padding: 10px; background: var(--text); color: #000000; border-radius: 2px; line-height: 0; }
.qr svg { display: block; width: 100%; height: auto; }

.wert { color: var(--text); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.werte { margin-top: 22px; }
.werte > div { display: grid; grid-template-columns: 12.5em minmax(0, 1fr); gap: 2px 18px; padding: 15px 0; border-top: 1px solid var(--line); }
.werte > div:last-child { border-bottom: 1px solid var(--line); }
.werte dt { color: var(--muted); font-size: .9rem; padding-top: 1px; }

.liste { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .92rem; }
.liste th { text-align: left; font-weight: 500; font-size: .76rem; letter-spacing: .08em; color: var(--muted); padding: 0 12px 10px 0; }
.liste td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.liste td:first-child { white-space: nowrap; }

/* ---- Schmal: Schiene wird zum Kopf, Stationen liegen quer ---- */

@media (max-width: 900px) {
  .rahmen { display: block; }
  .schiene { position: static; height: auto; overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px 16px; padding: 22px var(--gutter) 0; border-right: 0; }
  .aussage, .stationen { grid-column: 1 / -1; }
  [data-angemeldet] .wer { display: none; }
  .schiene::after { display: none; }
  .aussage { margin-block: 14px 0; }
  .aussage h1 { max-width: none; }
  .kennung { margin-bottom: 16px; }
  .stationen ol { display: grid; grid-template-columns: repeat(3, 1fr); border-left: 0; border-top: 1px solid var(--line); }
  .stationen li::before { top: -1px; bottom: auto; right: 0; left: 0; width: auto; height: 2px; transform: scaleX(0); transform-origin: left; }
  .stationen .ist-aktiv::before { transform: scaleX(1); }
  .station { flex-direction: column; gap: 0; padding: 12px 8px 0 0; font-size: .92rem; }
  .schiene-fuss { grid-area: 1 / 2; padding-top: 0; }
  .schiene-fuss::before { display: none; }
  main { padding-top: 40px; min-height: 60dvh; }
}

@media (max-width: 680px) {
  .signale > li { grid-template-columns: 22px minmax(0, 1fr); }
  .signale > li > :nth-child(3) { grid-column: 2; justify-self: start; margin-top: 8px; }
  .werte > div { grid-template-columns: 1fr; }
  .liste thead { display: none; }
  .liste tr { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
  .liste td { display: block; padding: 0; border: 0; }
  .liste td:first-child { color: var(--muted); font-size: .84rem; }
  .knopf { justify-self: stretch; }
  .wortmarke span, .wer, .mit-qr { display: none; }
}

/* Niedrige Fenster: Schiene strafft sich, statt abgeschnitten zu werden */
@media (min-width: 901px) and (max-height: 840px) {
  .schiene { gap: 22px; padding-block: 24px 20px; }
  h1 { font-size: clamp(2rem, 3.4vw, 3.1rem); }
  .kennung { margin-bottom: 16px; }
  .aussage-text, .regeln { margin-top: 16px; }
  .regeln { font-size: .88rem; }
  .regeln li { padding-block: 7px; }
  .station { padding-block: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  @view-transition { navigation: none; }
}
