/* Reiseplaner — Design-System
   Richtung: hell & luftig — Weiß, helles Blau, Flieder, schwarze Schrift.
   Daten/Zeiten/Codes in Mono wie auf der Anzeigetafel, Ticket-Karten mit Perforation. */

:root {
  --seite: #f4f5fc;          /* Seitenhintergrund: sehr helles Flieder-Blau */
  --papier: #ffffff;         /* Karten */
  --flieder: #7c6fe0;        /* Primär-Aktionen */
  --flieder-dunkel: #5f52c7;
  --flieder-hell: #ede9fb;
  --blau: #5b8def;           /* Akzent */
  --blau-hell: #e3edff;
  --himmel: #eaf2ff;
  --tinte: #141721;          /* Schrift: fast schwarz */
  --tinte-soft: #5c6270;
  --koralle: #e4572e;        /* überfällig */
  --bernstein: #d9a441;      /* bald */
  --gruen: #3f9d63;          /* ok */
  --linie: #e6e6f2;

  --font-display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", monospace;

  --radius: 16px;
  --shadow: 0 12px 32px rgba(92, 98, 140, 0.12);
  --shadow-soft: 0 4px 14px rgba(92, 98, 140, 0.08);
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--seite);
  color: var(--tinte);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
a { color: var(--flieder-dunkel); }

.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--tinte-soft);
  margin-bottom: 0.6rem;
}
.hero .eyebrow { color: rgba(255,255,255,0.85); }

/* ---------- Nav: weiß, schwarze Schrift, Flieder-Pill ---------- */
.topnav {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  color: var(--tinte);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--linie);
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.wordmark {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--tinte);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark b { color: var(--flieder); font-weight: 600; }
.topnav nav { display: flex; gap: 0.2rem; margin-left: auto; flex-wrap: wrap; }
.topnav nav a {
  color: var(--tinte-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
}
.topnav nav a.active { background: var(--flieder); color: #fff; }
.topnav nav a:hover { color: var(--tinte); }
.nav-user {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--tinte-soft);
  cursor: pointer;
  background: none; border: none; padding: 0.3rem;
}
.nav-user:hover { color: var(--tinte); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }
.grid { display: grid; gap: 1.2rem; }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1.2fr 1fr 1fr; }
}
section { margin-bottom: 2.2rem; }

.card {
  background: var(--papier);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow-soft);
}

/* ---------- Hero (Dashboard) ---------- */
.hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(150deg, var(--blau) 0%, var(--flieder) 100%);
  isolation: isolate;
  box-shadow: var(--shadow);
}
.hero-img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(10deg, rgba(31,28,70,0.72) 8%, rgba(31,28,70,0.18) 55%, rgba(31,28,70,0.02) 100%);
  z-index: -1;
}
.hero-code {
  position: absolute;
  top: -0.18em; right: 0.05em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 22vw, 14rem);
  color: rgba(255,255,255,0.08);
  letter-spacing: -0.04em;
  pointer-events: none;
}
.hero-inner { padding: 2.2rem 1.8rem 1.6rem; width: 100%; }
.hero h1 { margin-bottom: 0.2em; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: rgba(255,255,255,0.92);
}
.hero-meta .big { color: #ffd98a; }

/* Kleine 3D-Deko-Figuren (vereinzelt!) */
.deco {
  position: absolute;
  width: 74px; height: auto;
  filter: drop-shadow(0 10px 14px rgba(31,28,70,0.28));
  pointer-events: none;
}
.deco-hero { top: 1.4rem; right: 1.6rem; width: 86px; }
.deco-inline { position: static; width: 60px; display: block; margin: 0 auto 0.6rem; filter: drop-shadow(0 8px 10px rgba(92,98,140,0.25)); }
@media (prefers-reduced-motion: no-preference) {
  .deco-hero { animation: floaty 5s ease-in-out infinite; }
  @keyframes floaty { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-9px) rotate(2deg); } }
}

/* ---------- Ticket-Karten (Signature) ---------- */
.ticket {
  background: var(--papier);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.ticket-top { padding: 1.05rem 1.2rem 0.9rem; }
.ticket-bottom {
  padding: 0.75rem 1.2rem 0.9rem;
  border-top: 2px dashed var(--linie);
  position: relative;
  font-size: 0.9rem;
}
.ticket-bottom::before, .ticket-bottom::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--seite);
}
.ticket-bottom::before { left: -9px; }
.ticket-bottom::after { right: -9px; }
.ticket .route {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tinte-soft);
}
.ticket h3 { margin: 0.15rem 0 0.2rem; font-size: 1.25rem; }

/* Stations-Bildstreifen: Bild oben, Gradient dahinter als Fallback */
.ticket-img {
  height: 110px;
  background-size: cover;
  background-position: center;
}

/* ---------- Status-Pills (pastellig, Schrift dunkel) ---------- */
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.ok      { background: #e1f2e7; color: #23744a; }
.pill.soon    { background: #f9eed3; color: #8a6516; }
.pill.overdue { background: #fde3da; color: #c33d17; }
.pill.neutral { background: var(--blau-hell); color: #2d5cb8; }
.pill.past    { background: #ececf4; color: var(--tinte-soft); }

/* ---------- Listen ---------- */
.rowlist { display: flex; flex-direction: column; }
.rowlist > div {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--linie);
}
.rowlist > div:last-child { border-bottom: none; }
.rowlist .grow { flex: 1; min-width: 0; }
.rowlist .sub { font-size: 0.82rem; color: var(--tinte-soft); }
.rowlist > div.fav { background: #fbf3e0; border-radius: 10px; padding-left: 0.5rem; padding-right: 0.5rem; }
.fav-btn { background: none; border: none; padding: 0 0.1rem; font-size: 1.35rem; line-height: 1; color: var(--bernstein); cursor: pointer; }
.fav-btn:hover { transform: scale(1.15); }

/* Gestapelte Erinnerungs-Zeilen: Text oben, Status + Aktionen darunter */
.stack-row { padding: 0.7rem 0; border-bottom: 1px solid var(--linie); }
.stack-row:last-child { border-bottom: none; }
.stack-row .title { font-weight: 600; }
.stack-row .sub { font-size: 0.8rem; color: var(--tinte-soft); margin-top: 0.1rem; }
.stack-row .actions {
  display: flex; align-items: center; gap: 6px;
  margin-top: 0.45rem;
}
.stack-row .actions .spacer { flex: 1; }

/* ---------- Gauge ---------- */
.gauge-wrap { text-align: center; }
.gauge-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1;
}
.gauge-sub { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tinte-soft); }
.gauge-legend { display: flex; justify-content: center; gap: 1.2rem; margin-top: 0.7rem; font-size: 0.82rem; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.gauge-arc .track { stroke: #ececf6; }

/* ---------- Buttons & Formulare ---------- */
button, .btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  background: var(--flieder);
  color: #fff;
}
button:hover, .btn:hover { background: var(--flieder-dunkel); }
.btn-ghost { background: transparent; color: var(--flieder-dunkel); border: 1.5px solid #cfc8f0; }
.btn-ghost:hover { background: var(--flieder-hell); }
.btn-small { font-size: 0.78rem; padding: 0.32rem 0.8rem; }
.btn-danger { background: transparent; color: var(--koralle); border: none; font-size: 0.78rem; }
.btn-danger:hover { background: #fde3da; }

input, select, textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid var(--linie);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  background: #fff;
  color: var(--tinte);
  width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blau);
  outline-offset: 1px;
}
label { font-size: 0.78rem; font-weight: 700; color: var(--tinte-soft); display: block; margin-bottom: 0.2rem; }
.field { margin-bottom: 0.8rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.7rem 0.9rem; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(31, 28, 70, 0.38);
  display: flex; align-items: center; justify-content: center;
  z-index: 90;
  padding: 1rem;
}
.modal {
  background: var(--papier);
  border-radius: var(--radius);
  padding: 1.4rem;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--himmel) 0%, #dcd6f7 55%, var(--blau-hell) 100%);
  padding: 1rem;
}
.login-card {
  background: var(--papier);
  border-radius: 20px;
  padding: 2.2rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  text-align: left;
}
.login-error { color: var(--koralle); font-size: 0.85rem; min-height: 1.2em; }

/* ---------- Icons: zeichnen sich beim Laden ---------- */
.icon { width: 1.35em; height: 1.35em; flex: none; vertical-align: -0.28em; }
.icon path, .icon circle, .icon line, .icon polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-row { display: flex; gap: 1.6rem; color: var(--flieder-dunkel); margin: 0.3rem 0 0.4rem; }
.icon-row .icon { width: 2rem; height: 2rem; }

@media (prefers-reduced-motion: no-preference) {
  .draw path, .draw circle, .draw line, .draw polyline {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: draw 1.1s ease forwards;
  }
  .draw.d1 * { animation-delay: 0.10s; }
  .draw.d2 * { animation-delay: 0.28s; }
  .draw.d3 * { animation-delay: 0.46s; }
  .draw.d4 * { animation-delay: 0.64s; }
  .draw.d5 * { animation-delay: 0.82s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }

  .fade-up { opacity: 0; transform: translateY(14px); animation: fadeUp 0.6s ease forwards; }
  .fade-up.d1 { animation-delay: 0.08s; }
  .fade-up.d2 { animation-delay: 0.18s; }
  .fade-up.d3 { animation-delay: 0.28s; }
  .fade-up.d4 { animation-delay: 0.38s; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }
}

/* ---------- Tabellen (Historie) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinte-soft);
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--linie);
}
td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
tr.sumrow td { font-weight: 700; border-top: 2px solid var(--tinte); border-bottom: none; }
.proof-links a { display: inline-block; margin-right: 0.6rem; font-size: 0.82rem; }
.proof-missing { color: var(--bernstein); font-size: 0.82rem; }

/* ---------- Sonstiges ---------- */
.muted { color: var(--tinte-soft); }
.small { font-size: 0.84rem; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.banner {
  background: var(--bernstein);
  color: #3d2c05;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 0.45rem 1rem;
}
.empty {
  text-align: center;
  color: var(--tinte-soft);
  padding: 2rem 1rem;
  border: 2px dashed var(--linie);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.5);
}
.toast {
  position: fixed;
  bottom: 1.2rem; left: 50%;
  transform: translateX(-50%);
  background: var(--flieder);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 100;
  box-shadow: var(--shadow);
}
.leg-row {
  display: flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--tinte-soft);
  padding: 0.5rem 1.2rem;
}
.leg-connector {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 0.15rem 0 0.15rem 2rem;
  color: var(--flieder-dunkel);
}
.leg-connector .line { width: 1px; height: 14px; background: var(--linie); margin-left: 0.65rem; }

@media (max-width: 600px) {
  .hero { min-height: 260px; }
  .topnav-inner { padding: 0.55rem 0.8rem; gap: 0.7rem; }
  .topnav nav a { padding: 0.3rem 0.5rem; font-size: 0.85rem; }
  main { padding: 1rem 0.8rem 3rem; }
  .deco-hero { width: 60px; top: 1rem; right: 1rem; }
}

@media print {
  .topnav, .no-print, .banner, .toast, .deco { display: none !important; }
}
