/* ============================================================
   CarFit B2B-Portal – Design-System (CI: dunkles Nachtblau)
   Referenz: CICarfitHamburg.md + Konzept §13
   Farben/Abstände/Radien nur über diese Variablen verwenden.
   ============================================================ */

@font-face {
  font-family: 'Montserrat'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/fonts/Montserrat-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Montserrat'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/fonts/Montserrat-Bold.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('/fonts/inter-700.woff2') format('woff2');
}

:root {
  /* Flächen */
  --bg-0: #0A1420;
  --bg-1: #0F2033;
  --panel: #13253A;
  --panel-tief: #0D1B2B;
  --line: #23384F;

  /* Text */
  --text-hi: #FFFFFF;
  --text: #9DB0C0;
  --text-dim: #5E7488;

  /* Akzente – sparsam einsetzen */
  --cyan: #00B4D8;
  --cyan-hover: #17C4E8;
  --cyan-ink: #04121E;          /* Text AUF Cyan-Flächen */
  --highlight: #8AC5EC;

  /* Status */
  --ok: #2ECC71;
  --warn: #F5B942;
  --info: #4AA8FF;
  --err: #FF5D5D;

  /* Form */
  --radius: 14px;
  --radius-s: 9px;
  --schatten: 0 10px 30px rgba(0, 0, 0, .35);

  /* Abstände */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  --font-head: 'Montserrat', Arial, sans-serif;
  --font-text: 'Inter', Calibri, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; background: var(--bg-0); }

body {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg-0) 0%, var(--bg-1) 100%) fixed;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--text-hi); line-height: 1.25; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: .01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-hover); text-decoration: underline; }

.dim { color: var(--text-dim); font-size: .88rem; }
.hi { color: var(--text-hi); }

/* ---------- Karten & Flächen ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
}

.trennlinie { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-family: var(--font-text); font-size: .95rem; font-weight: 600;
  background: var(--cyan); color: var(--cyan-ink);
  border: 0; border-radius: var(--radius-s);
  padding: 11px 20px; cursor: pointer;
  transition: background .15s ease;
  min-height: 44px; /* mobil gut treffbar */
}
.btn:hover { background: var(--cyan-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--panel-tief); color: var(--text-hi); }

.btn-klein { padding: 6px 12px; min-height: 34px; font-size: .85rem; }

/* ---------- Formulare ---------- */

.feld { margin-bottom: var(--s4); }
.feld label {
  display: block; margin-bottom: var(--s1);
  font-size: .82rem; font-weight: 600; color: var(--text);
  letter-spacing: .02em;
}
.feld input, .feld select, .feld textarea {
  width: 100%;
  font-family: var(--font-text); font-size: 1rem; color: var(--text-hi);
  background: var(--panel-tief);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 11px 13px;
  min-height: 44px;
}
.feld input:focus, .feld select:focus, .feld textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, .18);
}
.feld input::placeholder { color: var(--text-dim); }

/* ---------- Status-Chips ---------- */

.chip {
  display: inline-block; padding: 3px 10px;
  font-size: .74rem; font-weight: 600; letter-spacing: .04em;
  border-radius: 999px; white-space: nowrap;
}
.chip-ok   { background: rgba(46, 204, 113, .14); color: var(--ok); }
.chip-warn { background: rgba(245, 185, 66, .14); color: var(--warn); }
.chip-info { background: rgba(74, 168, 255, .14); color: var(--info); }
.chip-err  { background: rgba(255, 93, 93, .14); color: var(--err); }
.chip-neutral { background: rgba(157, 176, 192, .12); color: var(--text); }

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

.meldung {
  border-radius: var(--radius-s); padding: var(--s3) var(--s4);
  font-size: .92rem; margin-bottom: var(--s4);
  border: 1px solid transparent;
}
.meldung-fehler { background: rgba(255, 93, 93, .1); color: var(--err); border-color: rgba(255, 93, 93, .35); }
.meldung-ok { background: rgba(46, 204, 113, .1); color: var(--ok); border-color: rgba(46, 204, 113, .35); }
.meldung-hinweis { background: rgba(74, 168, 255, .08); color: var(--text); border-color: rgba(74, 168, 255, .3); }

/* ============================================================
   Auth-Seiten (Login, Passwort setzen)
   ============================================================ */

.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s5);
}
.auth-logo { width: 150px; margin-bottom: var(--s6); }
.auth-card { width: 100%; max-width: 420px; box-shadow: var(--schatten); }
.auth-card h1 { font-size: 1.3rem; margin-bottom: var(--s2); }
.auth-card .untertitel { margin-bottom: var(--s5); }
.auth-fuss { margin-top: var(--s5); font-size: .82rem; color: var(--text-dim); text-align: center; }

/* ============================================================
   App-Gerüst (Topbar + Inhalt)
   ============================================================ */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: rgba(10, 20, 32, .85);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar-logo { height: 34px; display: block; }
.topbar-rechts { display: flex; align-items: center; gap: var(--s4); min-width: 0; }
.topbar-nutzer { font-size: .88rem; color: var(--text); text-align: right; min-width: 0; }
.topbar-nutzer .name { color: var(--text-hi); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.inhalt { max-width: 1080px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s7); }

.seitenkopf { margin-bottom: var(--s6); }
.seitenkopf .kicker {
  font-family: var(--font-head); font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: var(--s2);
}

/* Modul-Kacheln (Dashboard) */
.kacheln {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-top: var(--s5);
}
.kachel { position: relative; }
.kachel h3 { margin-bottom: var(--s2); }
.kachel p { font-size: .88rem; margin-bottom: var(--s3); }
.kachel .chip { position: static; }
.kachel.inaktiv { opacity: .65; }

/* Firmenliste (Admin) */
.firma-block { margin-bottom: var(--s4); }
.firma-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.firma-kopf .meta { font-size: .85rem; color: var(--text-dim); }

.nutzer-zeile {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) 0; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.nutzer-zeile .wer { min-width: 0; }
.nutzer-zeile .wer .mail { font-size: .84rem; color: var(--text-dim); word-break: break-all; }
.nutzer-aktionen { display: flex; gap: var(--s2); flex-wrap: wrap; }

.link-box {
  display: flex; gap: var(--s2); align-items: center;
  background: var(--panel-tief); border: 1px dashed var(--line);
  border-radius: var(--radius-s); padding: var(--s2) var(--s3);
  margin-top: var(--s3);
}
.link-box code {
  flex: 1; font-size: .8rem; color: var(--highlight);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.formular-raster { display: grid; gap: 0 var(--s4); grid-template-columns: 1fr 1fr; }
.formular-raster .breit { grid-column: 1 / -1; }

/* ============================================================
   Öffentliche Seiten (Ersttermin)
   ============================================================ */

.public-wrap { min-height: 100vh; display: flex; flex-direction: column; padding: var(--s5); }
.public-kopf { display: flex; justify-content: center; padding: var(--s4) 0 var(--s6); }
.public-logo { width: 130px; }
.public-inhalt { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; }

/* Kanal-/Auswahl-Pills */
.pill-gruppe { display: flex; gap: var(--s2); flex-wrap: wrap; }
.pill {
  font-family: var(--font-text); font-size: .92rem; font-weight: 600;
  background: var(--panel-tief); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 18px; cursor: pointer; min-height: 42px;
}
.pill.aktiv { background: rgba(0, 180, 216, .15); color: var(--highlight); border-color: var(--cyan); }

/* Slot-Picker */
.tag-gruppe { margin-bottom: var(--s3); }
.tag-name { font-size: .82rem; font-weight: 600; color: var(--text-dim); margin-bottom: var(--s1); }
.slot-reihe { display: flex; gap: var(--s2); flex-wrap: wrap; }
.slot {
  font-family: var(--font-text); font-size: .9rem; font-weight: 600;
  background: var(--panel-tief); color: var(--text-hi);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 8px 14px; cursor: pointer; min-height: 40px;
}
.slot:hover { border-color: var(--cyan); }
.slot.aktiv { background: var(--cyan); color: var(--cyan-ink); border-color: var(--cyan); }

/* Honeypot: für Menschen unsichtbar */
.hp-feld { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.erfolg-kreis {
  width: 64px; height: 64px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(46, 204, 113, .15);
  color: var(--ok); font-size: 2rem; font-weight: 700;
}

/* ============================================================
   Admin: Reiter-Navigation & Lead-Liste
   ============================================================ */

.tabs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.tab {
  font-family: var(--font-head); font-size: .85rem; font-weight: 700; letter-spacing: .03em;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; cursor: pointer; min-height: 40px;
}
.tab:hover { color: var(--text); }
.tab.aktiv { background: rgba(0, 180, 216, .15); color: var(--highlight); border-color: var(--cyan); }

.lead-kopf { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.lead-meta { font-size: .86rem; color: var(--text-dim); margin-top: var(--s1); word-break: break-word; }
.lead-termin {
  margin-top: var(--s3); padding: var(--s3);
  background: var(--panel-tief); border-radius: var(--radius-s);
  font-size: .9rem;
}
.lead-aktionen { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); align-items: center; }

/* Fuhrpark */
.kennzeichen {
  display: inline-block;
  font-weight: 700; letter-spacing: .08em; color: var(--text-hi);
  background: var(--panel-tief);
  border: 1px solid var(--line); border-left: 4px solid var(--cyan);
  border-radius: 6px; padding: 3px 10px;
  white-space: nowrap;
}
.scan-box {
  display: flex; gap: var(--s4); align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  background: var(--panel-tief); border: 1px dashed var(--line);
  border-radius: var(--radius-s); padding: var(--s3) var(--s4);
}
.scan-box > div { flex: 1; min-width: 220px; }

/* Fuhrpark-Import: Drag & Drop + Vorschau */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: rgba(0, 180, 216, .04);
  padding: var(--s4) var(--s5); margin-bottom: var(--s4);
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.aktiv { border-color: var(--cyan); background: rgba(0, 180, 216, .1); }

.import-tabelle { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.import-tabelle table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.import-tabelle th, .import-tabelle td {
  padding: 7px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.import-tabelle th { color: var(--text-hi); background: var(--panel-tief); font-weight: 600; }
.import-tabelle tr:last-child td { border-bottom: 0; }

/* Schadenmeldung: Fotos + Schaden-Zeilen */
.foto-reihe { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.foto-reihe img {
  width: 92px; height: 92px; object-fit: cover;
  border-radius: var(--radius-s); border: 1px solid var(--line);
  display: block;
}
.foto-reihe a { position: relative; display: inline-block; }
.foto-label {
  position: absolute; left: 4px; bottom: 4px;
  font-size: .65rem; font-weight: 700; letter-spacing: .04em;
  background: rgba(10, 20, 32, .85); color: var(--highlight);
  padding: 2px 6px; border-radius: 4px;
}
.foto-weg {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--err); color: #fff; border: 0; cursor: pointer;
  font-size: .85rem; line-height: 1;
}
.schaden-zeile {
  display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap;
  padding: var(--s2) 0;
}
.schaden-zeile input {
  flex: 1; min-width: 150px;
  background: var(--panel-tief); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 9px 12px; color: var(--text-hi);
  font-family: var(--font-text); font-size: .92rem;
}
.schaden-zeile input:focus { outline: none; border-color: var(--cyan); }

/* Angebote */
.angebot-box {
  margin-top: var(--s3); padding: var(--s3) var(--s4);
  background: rgba(0, 180, 216, .06);
  border: 1px solid rgba(0, 180, 216, .3); border-radius: var(--radius-s);
}
.angebot-zeile {
  display: flex; justify-content: space-between; gap: var(--s3);
  padding: 4px 0; font-size: .92rem;
}
.angebot-zeile.summe {
  border-top: 1px solid var(--line); margin-top: var(--s2); padding-top: var(--s2);
  font-weight: 700; color: var(--text-hi);
}

/* Onboarding-Wizard: Schritt-Anzeige */
.wizard-punkte { display: flex; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.wizard-punkt { display: flex; align-items: center; gap: var(--s2); color: var(--text-dim); font-size: .85rem; font-weight: 600; }
.wizard-punkt .nummer {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-tief);
  font-size: .78rem;
}
.wizard-punkt.aktiv { color: var(--text-hi); }
.wizard-punkt.aktiv .nummer { border-color: var(--cyan); color: var(--highlight); background: rgba(0, 180, 216, .12); }
.wizard-punkt.erledigt { color: var(--text); }
.wizard-punkt.erledigt .nummer { color: var(--ok); border-color: rgba(46, 204, 113, .5); }
@media (max-width: 640px) { .wizard-punkt .wname { display: none; } .wizard-punkt.aktiv .wname { display: inline; } }

@media (max-width: 640px) {
  .inhalt { padding: var(--s5) var(--s4) var(--s6); }
  .formular-raster { grid-template-columns: 1fr; }
  .topbar { padding: var(--s3) var(--s4); }
  h1 { font-size: 1.35rem; }
}

/* Feinschliff: Fußzeile mit Rechtslinks (alle Seiten) + Rechtsseiten-Layout */
.fusszeile {
  max-width: 1080px; margin: 0 auto; padding: var(--s5);
  font-size: .82rem; color: var(--text-dim); text-align: center;
}
.fusszeile a { color: var(--text-dim); text-decoration: none; }
.fusszeile a:hover { color: var(--text-hi); }
.rechtsseite { max-width: 760px; }
.rechtsseite h2 { font-size: 1.05rem; color: var(--text-hi); margin: var(--s6) 0 var(--s3); }
.rechtsseite h2:first-of-type { margin-top: 0; }
.rechtsseite p, .rechtsseite li { color: var(--text); line-height: 1.65; margin-bottom: var(--s3); }
.rechtsseite ul { padding-left: 1.2rem; margin-bottom: var(--s3); }
.rechtsseite .adresse { line-height: 1.7; }
