/* ═══════════════════════════════════════════════════════════════════
   Railpedia – Oberfläche
   Farben aus dem Titelbild: Nachtblau → Königsblau → Leuchtblau → Cyan
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --night:   #010216;
  --deep:    #010d4f;
  --navy:    #01196b;
  --royal:   #012583;
  --blue:    #034cc5;
  --bright:  #0a6fe7;
  --cyan:    #39b5f8;
  --ice:     #bfe8ff;
  --white:   #ffffff;

  --bg:      #f4f7fd;
  --surface: #ffffff;
  --text:    #0b1433;
  --muted:   #5b6788;
  --line:    #dbe3f3;
  --ok:      #198754;
  --err:     #c62828;

  --radius:  12px;
  --shadow:  0 1px 2px rgba(1,13,79,.06), 0 6px 24px rgba(1,13,79,.08);
  --font:    'RP Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--bright); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
code, pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

/* ── Marke ─────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.brand b { color: var(--cyan); font-weight: 800; }

/* ── Kopfzeile ─────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; background: linear-gradient(90deg, var(--night), var(--deep) 60%, var(--navy)); color: var(--ice); }
.topbar__nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar__nav a { color: var(--ice); font-weight: 600; }
.topbar__nav a.is-active { color: var(--white); border-bottom: 2px solid var(--cyan); }
.topbar__nav form { margin: 0; }
.topbar .muted { color: #9fb3e6; }
.topbar--landing { position: absolute; inset: 0 0 auto 0; z-index: 2; background: transparent; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; line-height: 1.2; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--bright), var(--blue)); color: var(--white); box-shadow: 0 4px 16px rgba(10,111,231,.35); }
.btn--primary:hover { box-shadow: 0 6px 22px rgba(57,181,248,.45); }
.btn--ghost { background: transparent; color: var(--bright); border-color: currentColor; }
.topbar .btn--ghost, .hero .btn--ghost { color: var(--ice); }
.btn--link { background: none; border: 0; padding: 4px 0; color: var(--bright); font-weight: 600; }
.btn--sm { padding: 6px 12px; font-size: .85rem; }

/* ── Titelbereich ──────────────────────────────────────────────────── */
.landing { background: var(--night); }
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; padding: 120px 24px 80px;
  color: var(--white); background: var(--night) url(/assets/img/hero.webp) center / cover no-repeat; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(1,2,22,.15) 0%, rgba(1,2,22,.55) 45%, rgba(1,2,22,.85) 100%); }
.hero__text { position: relative; z-index: 1; max-width: 620px; margin-left: auto; margin-right: 6vw; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--cyan); text-shadow: 0 0 24px rgba(57,181,248,.6); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--cyan); margin: 0 0 12px; }
.lead { font-size: 1.12rem; color: #d8e6ff; }
.hero .muted { color: #9fb3e6; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
@media (max-width: 820px) {
  .hero { background-image: url(/assets/img/hero-960.webp); }
  .hero__text { margin: 0; }
  .hero::after { background: linear-gradient(180deg, rgba(1,2,22,.35), rgba(1,2,22,.85)); }
}

/* ── Abschnitte Startseite ─────────────────────────────────────────── */
.section { padding: 72px 24px; background: var(--bg); }
.section > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section--alt { background: linear-gradient(180deg, var(--deep), var(--night)); color: var(--ice); }
.section--alt .section__title { color: var(--white); }
.section__title { font-size: 1.8rem; font-weight: 800; }
.section__lead { font-size: 1.08rem; color: var(--muted); }
.section--alt .section__lead { color: #b8c8ee; }
.section > .section__lead { padding-right: max(0px, calc(100% - 820px)); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 28px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature__icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--royal), var(--bright)); color: var(--white); font-size: 1.3rem; }
.feature p { margin: 0; color: var(--muted); }
.api-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; margin-top: 24px; }
.api-grid .card { background: rgba(255,255,255,.06); border-color: rgba(191,232,255,.18); color: var(--ice); box-shadow: none; }
.api-grid h3 { color: var(--white); }
.code-block { margin: 0; padding: 20px; border-radius: var(--radius); background: #000818; color: #bfe8ff;
  border: 1px solid rgba(57,181,248,.25); overflow: auto; }
ul.plain { list-style: none; padding: 0; margin: 0 0 16px; }
ul.plain li { padding: 4px 0; }
ul.plain code { color: var(--cyan); }
@media (max-width: 820px) { .api-grid { grid-template-columns: 1fr; } }

/* ── Fußzeile ──────────────────────────────────────────────────────── */
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 24px;
  background: var(--night); color: #8fa3d6; font-size: .9rem; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--ice); }

/* ── Karten, Formulare ─────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.form { display: grid; gap: 14px; margin: 0 0 8px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: var(--bright); }
input.code { font-size: 1.4rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: auto; margin-top: 4px; }
label.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; cursor: pointer; }
label.choice:has(input:checked) { border-color: var(--bright); background: #eef5ff; }
label.choice input { width: auto; margin-top: 5px; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; }
.alert--info { background: #e7f2ff; color: #063a86; border: 1px solid #c4defe; }
.alert--error { background: #fdecea; color: var(--err); border: 1px solid #f5c2c0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e7eefc; color: var(--royal); font-size: .78rem; font-weight: 700; }
.badge--ok { background: #e3f4ea; color: var(--ok); }

/* ── Anmeldung ─────────────────────────────────────────────────────── */
.page-auth { min-height: 100vh; background: var(--night) url(/assets/img/hero-960.webp) center / cover fixed; }
.auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 32px 16px; }
.auth__card { width: min(460px, 92vw); margin: 0; }
.auth__back a { color: var(--ice); }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; font-size: .85rem; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li + li::before { content: ''; width: 18px; height: 1px; background: var(--line); }
.steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; }
.steps .is-active { color: var(--text); font-weight: 700; }
.steps .is-active span { background: var(--bright); border-color: var(--bright); color: var(--white); }
.steps .is-done span { background: var(--ok); border-color: var(--ok); color: var(--white); }
.totp-setup { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 10px 0 16px; }
.totp-setup__qr { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
code.secret { display: inline-block; padding: 6px 10px; background: #eef3ff; border-radius: 6px; word-break: break-all; }
ul.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; list-style: none; padding: 12px; background: #f3f6fd; border-radius: 10px; }
.alt-methods { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.alt-methods form { margin: 0; }

/* ── Angemeldeter Bereich ──────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; border-radius: var(--radius); color: var(--white); background: linear-gradient(135deg, var(--royal), var(--bright)); box-shadow: var(--shadow); }
.stat b { display: block; font-size: 2rem; line-height: 1; }
.stat span { color: var(--ice); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions-cell form { margin: 0; }
.setup-box { margin-top: 16px; padding: 16px; border: 1px dashed var(--bright); border-radius: 10px; background: #f6faff; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree { padding-left: 0; }
.tree li { padding: 3px 0; }
.tree ul { border-left: 1px dashed var(--line); margin-left: 6px; }
.tree__name { font-weight: 600; }
.indent { display: inline-block; }
.indent--1 { width: 18px; } .indent--2 { width: 36px; } .indent--3 { width: 54px; } .indent--4 { width: 72px; }
.indent--5 { width: 90px; } .indent--6 { width: 108px; } .indent--7 { width: 126px; } .indent--8 { width: 144px; }

/* ── Rechtstexte ───────────────────────────────────────────────────── */
.wrap.legal { max-width: 820px; }
.wrap.legal h2 { margin-top: 1.6em; }
.legal-note { padding: 10px 14px; border-left: 3px solid var(--bright); background: #eef5ff; border-radius: 6px; }

/* ── Sprachwahl ────────────────────────────────────────────────────── */
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid rgba(191,232,255,.35); }
.lang-switch a { padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--ice); letter-spacing: .04em; }
.lang-switch a:hover { text-decoration: none; background: rgba(191,232,255,.12); }
.lang-switch a.is-active { background: var(--cyan); color: var(--night); }
.auth .lang-switch { margin-top: 4px; }

/* ── Hersteller ────────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; flex: 1 1 420px; }
.toolbar input[type=search] { flex: 1 1 220px; width: auto; }
.toolbar select { width: auto; }
.table-scroll { overflow-x: auto; }
.table td.num, .table th.num { text-align: right; }
.logo-thumb { width: 72px; height: 36px; object-fit: contain; display: block; }
.logo-ph { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, var(--royal), var(--bright)); color: var(--white); font-weight: 800; font-size: .9rem; }
.mf-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.mf-head__logo { width: 160px; height: 80px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.mf-head h1 { margin: 0; }
.mf-head .muted { margin: 4px 0 0; }
.address { margin: 0; font-style: normal; }
.addr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.addr { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.addr--old { opacity: .65; border-style: dashed; }
.addr h3 { font-size: .95rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.media { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; }
.media img { width: 100%; height: 90px; object-fit: contain; background: #fff; }
.media .actions-cell { justify-content: flex-start; }
.badge--warn { background: #fff4d6; color: #8a5a00; }
.badge--err { background: #fdecea; color: var(--err); }
.restricted { border-color: #f0c36d; }
.restricted h2::after { content: ' 🔒'; font-size: .9em; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
textarea { min-height: 90px; resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }

/* ── Sortierbare Tabellenköpfe ─────────────────────────────────────── */
.table th a.sort { color: inherit; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.table th a.sort:hover { color: var(--bright); text-decoration: none; }
.table th a.sort.is-active { color: var(--royal); }
.sort__arrow { font-size: .75em; opacity: .45; }
.sort.is-active .sort__arrow { opacity: 1; }
