/* Wartungsseite – „Editorial Dark“ (Tokens wie src/tailwind.input.css der Webseite).
   Bewusst ohne Build, CDN oder Webfonts: die Seite muss auch laufen, wenn sonst nichts läuft. */

:root {
  --c-base:          247 248 250;
  --c-surface:       255 255 255;
  --c-surface-2:     240 243 247;
  --c-line:          226 230 236;
  --c-strong:         20  22  27;
  --c-body:           58  63  74;
  --c-muted:         107 114 128;
  --c-accent:          7 169 210; /* #07a9d2 */
  --c-accent-strong:   6 137 176;
  --c-accent-soft:    10 110 143;
  --c-warn:          180  83   9; /* amber-700 */
  --c-ok:              4 120  87; /* emerald-700 */
  --c-danger:        220  38  38; /* red-600 */
  --c-danger-hover:  185  28  28;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --radius: 12px;
  color-scheme: light;
}

html.dark {
  --c-base:           13  14  17; /* #0d0e11 */
  --c-surface:        19  20  25; /* #131419 */
  --c-surface-2:      25  27  34; /* #191b22 */
  --c-line:           32  34  43; /* #20222b */
  --c-strong:        232 233 236;
  --c-body:          196 199 206;
  --c-muted:         130 133 143;
  --c-accent-soft:   109 216 240;
  --c-warn:          252 211  77; /* amber-300 */
  --c-ok:            110 231 183; /* emerald-300 */
  --c-danger:        239  68  68; /* red-500 wie im Footer der Webseite */
  --c-danger-hover:  248 113 113;
  color-scheme: dark;
}

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

html { background: rgb(var(--c-base)); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: rgb(var(--c-body));
  background: rgb(var(--c-base));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.mono { font-family: var(--font-mono); }

/* ---------- Hintergrund: Haarlinien-Raster mit dezentem Cobalt-Hauch ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 15% -10%, rgb(var(--c-accent) / .10), transparent 70%),
    linear-gradient(rgb(var(--c-line) / .7) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgb(var(--c-line) / .7) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 20%, transparent 75%);
}

/* ---------- Kopfzeile ---------- */
.top, .wrap, .foot {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgb(var(--c-strong));
}
.brand img { width: 32px; height: 32px; }
.brand span { white-space: nowrap; }

.top-right { display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgb(var(--c-warn) / .4);
  background: rgb(var(--c-warn) / .1);
  color: rgb(var(--c-warn));
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Schmale Handys: „läuft“ weglassen, damit Logo, Status und Schalter in eine Zeile passen */
@media (max-width: 400px) { .pill-long, .sm-hide { display: none; } }

.dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-line));
  background: rgb(var(--c-surface));
  color: rgb(var(--c-body));
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: rgb(var(--c-strong)); border-color: rgb(var(--c-accent) / .6); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
html.dark .theme-toggle .i-sun { display: block; }
html.dark .theme-toggle .i-moon { display: none; }

/* ---------- Inhalt ---------- */
.wrap {
  display: grid;
  align-items: center;
  gap: 40px;
  padding-top: 24px;
  padding-bottom: 56px;
}

@media (min-width: 960px) {
  .wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; padding-top: 32px; }
}

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgb(var(--c-accent-soft));
}

.wrap h1 {
  margin: 20px 0 0;
  font-size: clamp(2.1rem, 3.6vw + 1rem, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: rgb(var(--c-strong));
  text-wrap: balance;
}
.wrap h1 .accent { color: rgb(var(--c-accent-soft)); }

.lead {
  margin: 20px 0 0;
  max-width: 36rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.note {
  margin: 20px 0 0;
  max-width: 36rem;
  padding: 12px 14px;
  border-left: 2px solid rgb(var(--c-accent));
  background: rgb(var(--c-accent) / .07);
  border-radius: 0 8px 8px 0;
  font-size: .95rem;
  color: rgb(var(--c-strong));
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-line));
  background: rgb(var(--c-surface));
  color: rgb(var(--c-strong));
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.btn:hover { border-color: rgb(var(--c-accent) / .6); transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { border-color: transparent; background: rgb(var(--c-accent)); color: #fff; }
.btn-primary:hover { border-color: transparent; background: rgb(var(--c-accent-strong)); }
.btn .ext { width: 14px; height: 14px; opacity: .6; }

/* ---------- Statuskarte ---------- */
.card {
  position: relative;
  padding: 20px;
  border: 1px solid rgb(var(--c-line));
  border-radius: 16px;
  background: rgb(var(--c-surface) / .85);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
@media (min-width: 480px) { .card { padding: 24px; } }

/* Rack-Andeutung: eine Höheneinheit in Wartung, der Rest läuft */
.rack {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgb(var(--c-line));
  border-radius: 10px;
  background: rgb(var(--c-base));
}
.ru {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  padding: 0 8px;
  border: 1px solid rgb(var(--c-line));
  border-radius: 4px;
  background: rgb(var(--c-surface));
}
.ru .vent {
  flex: 1;
  height: 6px;
  margin: 0 6px;
  background: repeating-linear-gradient(90deg, rgb(var(--c-line)) 0 2px, transparent 2px 6px);
  opacity: .9;
}
.led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgb(var(--c-ok));
  opacity: .85;
  animation: blink 2.6s steps(2, jump-none) infinite;
}
.ru:nth-child(2) .led:nth-child(2) { animation-delay: .7s; }
.ru:nth-child(4) .led:nth-child(1) { animation-delay: 1.3s; }
.ru:nth-child(5) .led:nth-child(2) { animation-delay: .4s; }
.led.idle { background: rgb(var(--c-muted) / .5); animation: none; }
.ru .tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgb(var(--c-muted));
}
.ru.is-maint { border-color: rgb(var(--c-warn) / .45); background: rgb(var(--c-warn) / .07); }
.ru.is-maint .led { background: rgb(var(--c-warn)); animation: pulse 1.2s ease-in-out infinite; }
.ru.is-maint .tag { color: rgb(var(--c-warn)); }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}
.label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgb(var(--c-muted));
}
.pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--c-accent-soft));
}

.clock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.clock.has-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile {
  padding: 14px 4px 12px;
  border: 1px solid rgb(var(--c-line));
  border-radius: 10px;
  background: rgb(var(--c-base));
  text-align: center;
}
.tile b {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: rgb(var(--c-strong));
}
.tile span {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgb(var(--c-muted));
}

.clock-empty {
  margin-top: 12px;
  padding: 18px 16px;
  border: 1px solid rgb(var(--c-line));
  border-radius: 10px;
  background: rgb(var(--c-base));
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(var(--c-strong));
}

.bar {
  position: relative;
  height: 6px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(var(--c-surface-2));
}
.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: rgb(var(--c-accent));
  transition: width 1s linear;
}
.bar.is-open i { width: 32%; animation: sweep 1.8s ease-in-out infinite; transition: none; }
.bar.is-done i { width: 100%; animation: pulse 1.6s ease-in-out infinite; }

.times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgb(var(--c-line));
}
.times.single { grid-template-columns: 1fr; }
.times div { min-width: 0; }
.times dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgb(var(--c-muted));
}
.times dd {
  margin: 4px 0 0;
  font-size: .9375rem;
  font-weight: 600;
  color: rgb(var(--c-strong));
  font-variant-numeric: tabular-nums;
}

.live {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: .8125rem;
  line-height: 1.5;
  color: rgb(var(--c-muted));
}
.live .dot { margin-top: 5px; color: rgb(var(--c-accent)); }

/* ---------- Fußzeile: Rechtstexte + Vertragslinks (im Wartungsmodus aus diesem Ordner) ---------- */
.foot {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  padding-bottom: 24px;
  border-top: 1px solid rgb(var(--c-line));
  font-size: 12px;
  color: rgb(var(--c-muted));
}

.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.foot-links a { color: rgb(var(--c-body)); text-decoration: none; transition: color .2s; }
.foot-links a:hover, .foot-links a[aria-current="page"] { color: rgb(var(--c-strong)); }
.foot-links a.is-vertrag { color: rgb(var(--c-danger)); font-weight: 600; }
.foot-links a.is-vertrag:hover { color: rgb(var(--c-danger-hover)); }
.foot-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }

/* ---------- Rechtstexte/Vertragsformulare (recht.inc.php): Inhalt der Webseite, Tailwind inline ---------- */
.recht { width: 100%; }
.recht .pt-28, .recht .md\:pt-32 { padding-top: 1.5rem !important; }
.btn-sm { padding: 8px 12px; font-size: .875rem; }

[hidden] { display: none !important; }

/* ---------- Animationen ---------- */
@keyframes ping  { 75%, 100% { transform: scale(2.4); opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* ---------- Druck: Eingangsbestätigung der Vertragsformulare hell und ohne Rahmen der Seite ---------- */
@media print {
  .backdrop, .top, .foot, .no-print { display: none !important; }
  html, html.dark {
    --c-base: 255 255 255; --c-surface: 255 255 255; --c-surface-2: 255 255 255; --c-line: 200 200 200;
    --c-strong: 0 0 0; --c-body: 30 30 30; --c-muted: 90 90 90; --c-accent-soft: 10 110 143;
  }
  html, body { background: #fff !important; }
  .recht .text-white { color: #000 !important; }
  .recht .text-green-300, .recht .text-green-400 { color: #15803d !important; }
}

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