/* ============================================================================
   Design-System – dunkles "Leuchtreklame"-Thema (bewusst abgesetzt vom hellen
   Design des Schwesterprojekts Folien-/Digitaldruck-Konfigurator): dunkler
   Grund, warmer Amber-Akzent wie eine LED-Leuchtröhre, ruhige Flächen.
   ============================================================================ */

:root {
  --color-bg: #0b0d14;
  --color-surface: #161923;
  --color-surface-2: #1d212e;
  --color-border: #2a2f3d;
  --color-text: #f2f1ee;
  --color-text-muted: #9a9fb0;
  --color-primary: #ffb020;
  --color-primary-contrast: #14151b;
  --color-accent: #ffb020;
  --color-accent-soft: rgba(255, 176, 32, 0.14);
  --color-success: #5fd88a;
  --color-success-bg: #16311f;
  --color-danger: #ff6b6b;
  --color-danger-soft: rgba(255, 107, 107, 0.14);
  /* ---- Themenfarben (Icon-Orientierungssystem) ---------------------------
     Dasselbe Prinzip wie im Schwesterprojekt Folienkonfigurator (siehe
     dortige main.css): jeder inhaltliche Bereich bekommt eine eigene feste
     Farbfamilie, damit Icon + Farbe sofort erkennen lassen, worum es geht -
     hier an den dunklen "Leuchtreklame"-Grund angepasst (kräftige, klare
     Leuchttöne statt gedeckter Erdtöne):
       - primary/accent (Amber) - EIN Ton für "ausgewählt" UND für Preise/Geld
         (Gold = Wert - passt inhaltlich und ist zugleich die Kernfarbe der
         Marke "Leuchtbuchstabe", braucht daher keinen eigenen Preis-Ton)
       - font   (Zyan)   - Schriftart/Text
       - shape  (Violett) - Profiltyp/Bauform/Größe
       - light  (Rosé)   - Beleuchtungsart (bewusst NICHT amber/gelb, sonst
                            nicht von "ausgewählt" unterscheidbar)
       - addon  (Mint)   - Montage-Zubehör
       - admin  (Schiefergrau, hell) - Adminbereich-Systemfunktionen */
  --color-font: #4fb8e0;
  --color-font-soft: rgba(79, 184, 224, 0.16);
  --color-shape: #a78bfa;
  --color-shape-soft: rgba(167, 139, 250, 0.16);
  --color-light: #ff8fb1;
  --color-light-soft: rgba(255, 143, 177, 0.16);
  --color-addon: #4dd0b0;
  --color-addon-soft: rgba(77, 208, 176, 0.16);
  --color-admin: #9aa3bf;
  --color-admin-soft: rgba(154, 163, 191, 0.14);
  --transition-fast: 0.15s ease;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.35), 0 14px 34px rgba(0, 0, 0, 0.4);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -0.01em; margin: 0 0 var(--space-2); color: var(--color-text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 var(--space-3); color: var(--color-text-muted); }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--color-accent); }

/* ---- Layout ------------------------------------------------------------ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.app-header .brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: 1.05rem; }
.app-header .brand .brand-logo { width: 34px; height: 34px; flex-shrink: 0; }

/* ---- Icons ---------------------------------------------------------------
   Einheitliche, selbst gezeichnete Strich-Icons (siehe utils/icons.js) -
   .icon-badge ist die Standard-Darstellung: sanft eingefärbter, abgerundeter
   Hintergrund + Icon in derselben Themenfarbe (siehe --color-font/-shape/
   -light/-addon/-admin oben). */
.icon-svg { display: block; flex-shrink: 0; }
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}
.icon-badge--sm { width: 30px; height: 30px; border-radius: var(--radius-sm); }
.icon-badge--xs { width: 26px; height: 26px; border-radius: 8px; }
.icon-badge--primary { background: var(--color-accent-soft); color: var(--color-primary); }
.icon-badge--accent { background: var(--color-accent-soft); color: var(--color-accent); }
.icon-badge--success { background: var(--color-success-bg); color: var(--color-success); }
.icon-badge--danger { background: var(--color-danger-soft); color: var(--color-danger); }
.icon-badge--muted { background: var(--color-surface-2); color: var(--color-text-muted); }
.icon-badge--font { background: var(--color-font-soft); color: var(--color-font); }
.icon-badge--shape { background: var(--color-shape-soft); color: var(--color-shape); }
.icon-badge--light { background: var(--color-light-soft); color: var(--color-light); }
.icon-badge--addon { background: var(--color-addon-soft); color: var(--color-addon); }
.icon-badge--admin { background: var(--color-admin-soft); color: var(--color-admin); }
.icon-inline { display: inline-flex; flex-shrink: 0; vertical-align: -4px; opacity: 0.85; }

/* Echter Farbpunkt statt Icon (siehe utils/icons.js ColorBadge) - für
   Profilfarben/LED-Lichtfarben, wo die tatsächliche Farbe aussagekräftiger
   ist als ein Symbol. Eigener heller Rahmen, da z. B. Weiß auf dem dunklen
   Grund sonst kaum vom umgebenden Badge abzugrenzen wäre. */
.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* ---- Interaktive Icon-Zustände (Hover/Active/Selected/Disabled) --------
   Der Zustand des klickbaren Elternelements (Karte/Chip/Button) steuert den
   Badge-Zustand, damit alle Vorkommen automatisch konsistent bleiben. */
.option-card:hover .icon-badge, .chip:hover:not(.selected) .icon-badge, .btn:hover .icon-badge {
  transform: translateY(-1px) scale(1.05);
}
.option-card:active .icon-badge, .chip:active .icon-badge { transform: translateY(0) scale(0.98); }
/* Ausgewählte Karten/Chips leuchten bereits amber (siehe .selected unten) -
   das Badge bekäme sonst denselben Ton wie der Rahmen und würde optisch
   verschwinden. Stattdessen ein vollflächiger, satter Amber-Fleck mit
   dunklem Icon - ein klares "ausgewählt"-Signal, unabhängig von der
   Themenfarbe der Option. */
.option-card.selected .icon-badge, .chip.selected .icon-badge {
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  box-shadow: 0 0 14px rgba(255, 176, 32, 0.45);
}
.option-card.selected .color-dot, .chip.selected .color-dot { border-color: rgba(20, 21, 27, 0.65); }
.option-card:focus-visible, .chip:focus-visible, .btn:focus-visible, .stepper button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.icon-badge[disabled], .is-disabled .icon-badge, button:disabled .icon-badge, .option-card:disabled {
  opacity: 0.4;
  filter: grayscale(45%);
}
button:disabled, .option-card:disabled { cursor: not-allowed; }

/* "display:flex" bewusst HIER statt inline im style-Attribut des Install-
   Banners (siehe index.html-Kommentar) - eine Inline-style-Angabe hätte
   immer Vorrang vor der Browser-Standardregel "[hidden] { display: none }"
   und würde den Banner dauerhaft sichtbar machen. Über ":not([hidden])"
   greift "hidden" wieder normal. */
#install-banner:not([hidden]) { display: flex; }

.app-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-5);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  padding-bottom: 140px; /* Platz für sticky Preisleiste mobil */
}

@media (min-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; padding-bottom: var(--space-7); }
  .price-panel { position: sticky; top: 96px; }
}

.main-column { min-width: 0; }

/* ---- Step Nav ------------------------------------------------------------ */
.step-nav {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-5);
  scrollbar-width: none;
}
.step-nav::-webkit-scrollbar { display: none; }
.step-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.step-nav-item .num {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-border); color: var(--color-text); font-size: 0.72rem; font-weight: 700;
}
.step-nav-item { transition: border-color var(--transition-fast), color var(--transition-fast); }
.step-nav-item.active { border-color: var(--color-primary); color: var(--color-primary); font-weight: 650; }
.step-nav-item.active .num { background: var(--color-primary); color: var(--color-primary-contrast); }
.step-nav-item.done .num { background: var(--color-success); color: #0b0d14; }

/* ---- Cards / Panels ------------------------------------------------------ */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-5);
}
.panel-header { margin-bottom: var(--space-4); display: flex; align-items: flex-start; gap: var(--space-3); }
.panel-header .panel-header-text { min-width: 0; }
.panel-header .eyebrow { color: var(--color-accent); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-1); }
.admin-section-heading { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.admin-section-heading h2 { margin: 0; }

/* ---- Zusammengelegte Schritte: mehrere Abschnitte in einem Panel --------- */
.step-section-heading { margin-top: var(--space-5); margin-bottom: var(--space-3); color: var(--color-text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; display: flex; align-items: center; gap: 8px; }
.step-section-heading:first-of-type { margin-top: 0; }
.step-section-divider { border-top: 1px solid var(--color-border); margin: var(--space-5) 0 0; }

/* ---- Auswahlkarten (Schrift/Profil/Beleuchtung/Optionen) ------------------ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.option-card {
  text-align: left;
  cursor: pointer;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 84px;
  color: var(--color-text);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.option-card:hover { border-color: #454b5e; box-shadow: var(--shadow-card-hover); transform: translateY(-1px); }
.option-card.selected { border-color: var(--color-primary); background: rgba(255, 176, 32, 0.08); box-shadow: 0 0 0 1px var(--color-primary) inset, 0 0 18px rgba(255, 176, 32, 0.18); }
.option-card .icon-badge { margin-bottom: var(--space-1); }
.option-card .icon { font-size: 1.6rem; }
.option-card .title { font-weight: 650; font-size: 0.98rem; }
.option-card .desc { color: var(--color-text-muted); font-size: 0.84rem; }
.option-card .price-hint { color: var(--color-accent); font-size: 0.8rem; font-weight: 650; margin-top: auto; }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.88rem;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}
.chip:hover { border-color: #454b5e; box-shadow: var(--shadow-card); }
.chip.selected { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-contrast); font-weight: 600; }
.chip .desc { display: block; font-size: 0.72rem; opacity: 0.75; }

/* ---- Formulare ------------------------------------------------------------ */
.field { margin-bottom: var(--space-4); }
.field label { display: block; font-size: 0.85rem; font-weight: 650; margin-bottom: var(--space-2); color: var(--color-text); }
.field .hint, .hint { font-size: 0.78rem; color: var(--color-text-muted); margin-top: var(--space-1); }
.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  min-height: 48px;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

.area-display {
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: var(--space-3);
}
.area-display .label { font-size: 0.85rem; color: var(--color-text-muted); }
.area-display .value { font-size: 1.3rem; font-weight: 700; color: var(--color-accent); }

.stepper { display: flex; align-items: center; gap: var(--space-3); }
.stepper button {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border); background: var(--color-surface-2);
  font-size: 1.3rem; cursor: pointer; color: var(--color-text);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.stepper button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.stepper input { text-align: center; max-width: 100px; }
.qty-presets { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
  border: 1.5px solid transparent;
  min-height: 50px;
}
.btn { transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast); }
.btn-primary { background: var(--color-primary); color: var(--color-primary-contrast); box-shadow: 0 0 0 rgba(255, 176, 32, 0); }
.btn-primary:hover { opacity: 0.92; box-shadow: 0 0 20px rgba(255, 176, 32, 0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #4a4d55; color: #9a9fb0; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-secondary { background: var(--color-surface-2); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-block { width: 100%; }
.btn-text { background: none; border: none; color: var(--color-text-muted); font-weight: 600; cursor: pointer; padding: 8px 4px; transition: color var(--transition-fast); }
.btn-text:hover { color: var(--color-primary); }

.nav-buttons { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }

.alert { border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); font-size: 0.88rem; margin-bottom: var(--space-3); display: flex; align-items: flex-start; gap: 10px; }
.alert-error { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-info { background: var(--color-accent-soft); color: var(--color-accent); }

.field-error { color: var(--color-danger); font-size: 0.8rem; margin-top: 4px; }

details.more-options { margin-top: var(--space-4); border-top: 1px solid var(--color-border); padding-top: var(--space-4); }
details.more-options summary { cursor: pointer; font-weight: 650; font-size: 0.92rem; list-style: none; display: flex; align-items: center; gap: 6px; color: var(--color-text); }
details.more-options summary::-webkit-details-marker { display: none; }
details.more-options summary::before { content: '▸'; transition: transform 0.15s; }
details.more-options[open] summary::before { transform: rotate(90deg); }
details.more-options .content { padding-top: var(--space-4); }

/* ---- Preisübersicht -------------------------------------------------------- */
.price-panel .panel { margin-bottom: 0; }
.price-total { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-3); }
.price-total .amount { font-size: 1.8rem; font-weight: 750; color: var(--color-accent); text-shadow: 0 0 18px rgba(255, 176, 32, 0.35); }
.price-total .vat-note { font-size: 0.76rem; color: var(--color-text-muted); }
.price-lines { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; }
.price-line { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--color-text-muted); }
.price-line.discount { color: var(--color-success); }
.price-line span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.price-min-note { font-size: 0.78rem; color: var(--color-accent); margin-top: var(--space-2); }
.price-empty { color: var(--color-text-muted); font-size: 0.88rem; }

.sticky-price-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
}
.sticky-price-bar .amount { font-size: 1.25rem; font-weight: 750; color: var(--color-accent); }
.sticky-price-bar .label { font-size: 0.72rem; color: var(--color-text-muted); }
@media (min-width: 900px) { .sticky-price-bar { display: none; } }

/* ---- Summary / Kundendaten -------------------------------------------------- */
.summary-list { display: flex; flex-direction: column; gap: var(--space-2); }
.summary-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.summary-row .k { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text-muted); flex-shrink: 0; }
.summary-row .v { font-weight: 600; text-align: right; }

.confirmation { text-align: center; padding: var(--space-6) var(--space-4); }
.confirmation .check { margin: 0 auto var(--space-3); }
.confirmation .req-id { display: inline-block; margin: var(--space-3) 0; padding: 10px 20px; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-accent); font-weight: 700; font-size: 1.1rem; }

/* ---- Admin ------------------------------------------------------------------ */
.admin-wrap { max-width: 960px; margin: 0 auto; padding: var(--space-5); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.admin-table th { color: var(--color-text-muted); font-weight: 650; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-table tbody tr { transition: background var(--transition-fast); }
.admin-table tbody tr:hover { background: var(--color-surface-2); }
.admin-table input { width: 100px; padding: 8px; border: 1.5px solid var(--color-border); border-radius: 6px; font-size: 0.9rem; background: var(--color-surface-2); color: var(--color-text); transition: border-color var(--transition-fast); }
.admin-table input:focus { border-color: var(--color-primary); outline: none; }
.admin-table-scroll { overflow-x: auto; }
.admin-actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); flex-wrap: wrap; align-items: center; }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--color-accent-soft); color: var(--color-accent); font-size: 0.72rem; padding: 4px 10px; border-radius: 999px; font-weight: 650; margin-bottom: var(--space-4); }
.save-toast { position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 8px; background: var(--color-primary); color: var(--color-primary-contrast); padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.88rem; box-shadow: 0 10px 32px rgba(255, 176, 32, 0.25), var(--shadow-card); z-index: 60; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
