/* =========================================================
   WillkommVision – Oberfläche
   CI verbindlich: Primärgrün #00694C · Akzentgelb #F6B600
   Schriften: Fraunces (Display) + Manrope (UI) – selbst gehostet
   Gestaltungsidee: heller, ruhiger Rahmen für die Lesbarkeit im
   Freien; dunkelgrüne Bühne, damit die Fotos leuchten. Das Bild
   ist der Held, die Bedienung tritt zurück.
   ========================================================= */

:root {
  --gruen: #00694C;
  --gruen-tief: #063019;
  --gruen-nacht: #04210F;
  --gruen-hell: #e8f0e2;
  --gelb: #F6B600;
  --gelb-tief: #d9a100;
  --beige: #f7f5ef;
  --weiss: #ffffff;
  --text: #1a1a1a;
  --text-leise: #5c5c5c;
  --telegrau: #8D9295;
  --grenze: #e6e3da;

  --radius: 20px;
  --radius-klein: 12px;
  --maxw: 940px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --schatten: 0 1px 2px rgba(6, 48, 25, 0.04), 0 8px 24px rgba(6, 48, 25, 0.06);
  --schatten-hoch: 0 2px 4px rgba(6, 48, 25, 0.06), 0 18px 48px rgba(6, 48, 25, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Muss vor allen Layout-Regeln stehen: display:grid/flex hier im Stylesheet
   schlägt sonst das hidden-Attribut, und versteckte Bereiche wären sichtbar. */
[hidden] { display: none !important; }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--beige);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; display: block; }

h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
em { font-style: italic; }

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
}

/* === KOPF ============================================== */
.kopf {
  background: var(--weiss);
  border-bottom: 1px solid var(--grenze);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
}
.kopf-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.kopf-logo { height: 34px; width: auto; }
.kopf-wort {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  color: var(--gruen);
  letter-spacing: -0.01em;
  padding-left: 12px;
  border-left: 1px solid var(--grenze);
  line-height: 1;
}

/* === BÜHNE ============================================= */
.buehne {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 0%, #0b4526 0%, var(--gruen-tief) 55%, var(--gruen-nacht) 100%);
  color: var(--weiss);
  min-height: 58vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* Das Wellen-Motiv aus der Bildmarke, sehr zurückgenommen – gibt der dunklen
   Fläche Tiefe, ohne mit dem Foto zu konkurrieren. */
.buehne::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -2%;
  height: 30%;
  background: url('../assets/wellen.svg') no-repeat center bottom / 150% auto;
  opacity: 0.05;
  filter: blur(0.4px);
  pointer-events: none;
  z-index: 0;
}
.zustand, .arbeit, .zugang { position: relative; z-index: 1; }
.zustand { width: 100%; }

/* Startzustand */
.zustand-start {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 60px;
  text-align: center;
  animation: auf 0.6s var(--ease) both;
}
.zustand-start .eyebrow { color: var(--gelb); margin-bottom: 18px; }
.zustand-start h1 {
  font-size: clamp(2.3rem, 8vw, 3.8rem);
  margin-bottom: 18px;
}
.lead {
  max-width: 30rem;
  margin: 0 auto 32px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
}
.start-aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Foto- und Ergebniszustand.
   Die Breite richtet sich nach dem Bild (fit-content), damit Schaltflächen
   am Bildrand kleben und nicht am Bildschirmrand. */
.zustand-foto, .zustand-ergebnis {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}
.zustand-foto img, .vergleich img { width: 100%; height: auto; }
.bild-tausch {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: rgba(4, 33, 15, 0.72);
  backdrop-filter: blur(8px);
  color: var(--weiss);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.zustand-video { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; }
.zustand-video video { max-height: 74vh; width: auto; max-width: 100%; display: block; background: #000; }

/* === VORHER/NACHHER ==================================== */
.vergleich {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  line-height: 0; /* sonst entsteht unter dem Bild eine Textzeilen-Lücke */
}
/* Das Entwurfsbild bestimmt die Größe der Box – nur so sitzen Trenner und
   Beschriftungen am Bildrand statt am Bildschirmrand. */
#img-nachher { max-height: 74vh; width: auto; max-width: 100%; }
.vorher-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  clip-path: inset(0 50% 0 0);
}
.vorher-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trenner {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--weiss);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.griff {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--weiss);
  box-shadow: var(--schatten-hoch);
  display: grid;
  place-items: center;
}
.griff::before,
.griff::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-block: 6px solid transparent;
}
.griff::before {
  left: 14px;
  border-right: 8px solid var(--gruen);
}
.griff::after {
  right: 14px;
  border-left: 8px solid var(--gruen);
}
.marke {
  position: absolute;
  top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(4, 33, 15, 0.66);
  backdrop-filter: blur(8px);
  color: var(--weiss);
  pointer-events: none;
}
.marke-vorher { left: 14px; }
.marke-nachher { right: 14px; background: var(--gruen); }
/* Der Regler liegt unsichtbar über dem Bild – so lässt sich überall ziehen. */
#slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
#slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 64px;
  height: 100vh;
  cursor: ew-resize;
}
#slider::-moz-range-thumb {
  width: 64px;
  height: 100vh;
  border: 0;
  background: transparent;
}

/* === ARBEITSANZEIGE ==================================== */
.arbeit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 33, 15, 0.82);
  backdrop-filter: blur(6px);
  z-index: 5;
  animation: auf 0.3s var(--ease) both;
}
.arbeit-box { text-align: center; padding: 24px; }
.puls { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.puls span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gelb);
  animation: huepf 1.1s infinite var(--ease);
}
.puls span:nth-child(2) { animation-delay: 0.16s; }
.puls span:nth-child(3) { animation-delay: 0.32s; }
.arbeit-text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35rem;
  color: var(--weiss);
  margin-bottom: 6px;
}
.arbeit-klein { color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; }

@keyframes huepf {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(-9px); opacity: 1; }
}
@keyframes auf {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Zugangsdialog – ersetzt das blockierende prompt() des Browsers */
.zugang { z-index: 10; }
.zugang-box {
  background: var(--weiss);
  color: var(--text);
  border-radius: var(--radius);
  padding: 28px 26px;
  width: min(360px, calc(100vw - 44px));
  box-shadow: var(--schatten-hoch);
  display: grid;
  gap: 14px;
  text-align: left;
}
.zugang-box h2 { font-size: 1.4rem; }
.zugang-box p { font-size: 0.9rem; color: var(--text-leise); }
.zugang-feld {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--grenze);
  border-radius: var(--radius-klein);
  font: inherit;
  font-size: 1rem;
}
.zugang-feld:focus {
  outline: none;
  border-color: var(--gruen);
  box-shadow: 0 0 0 3px rgba(0, 105, 76, 0.12);
}

/* === BUTTONS =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
}
.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.btn-gross { padding: 16px 30px; min-height: 58px; }
.btn-breit { width: 100%; }
.btn-gelb { background: var(--gelb); color: var(--text); box-shadow: var(--schatten); }
.btn-gelb:hover:not(:disabled) { background: var(--gelb-tief); transform: translateY(-2px); }
.btn-gruen { background: var(--gruen); color: var(--weiss); }
.btn-gruen:hover { background: var(--gruen-tief); transform: translateY(-2px); }
.btn-linie {
  background: transparent;
  color: currentColor;
  border: 1.5px solid currentColor;
}
.buehne .btn-linie { color: var(--weiss); }
.buehne .btn-linie:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.aktionen .btn-linie { color: var(--gruen); border-color: var(--gruen); }
.aktionen .btn-linie:hover { background: var(--gruen-hell); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--gruen); outline-offset: 3px; }

/* === ERGEBNIS-AKTIONEN ================================= */
.aktionen {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* === STIMMUNGEN ======================================== */
.stimmungen {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.stimmungen-titel { font-size: 0.86rem; color: var(--text-leise); }
.stimmung-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stimmung-chip {
  background: var(--weiss);
  border: 1.5px solid var(--grenze);
  border-radius: 999px;
  padding: 9px 16px;
  min-height: 44px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.stimmung-chip:hover:not(:disabled) { border-color: var(--gruen); transform: translateY(-1px); }
.stimmung-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.stimmung-chip small { display: block; font-weight: 500; color: var(--text-leise); font-size: 0.76rem; }

/* === PULT (Steuerung) ================================== */
.pult {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 8px;
  display: grid;
  gap: 22px;
}
.block { animation: auf 0.5s var(--ease) both; }
.block-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.ziffer {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gruen);
  color: var(--weiss);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.block-kopf h2 { font-size: 1.25rem; }
.optional {
  font-family: 'Manrope', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--telegrau);
  letter-spacing: 0;
}

/* Stil-Kacheln */
.stil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
}
.stil-kachel {
  position: relative;
  text-align: left;
  background: var(--weiss);
  border: 1.5px solid var(--grenze);
  border-radius: var(--radius-klein);
  padding: 14px 14px 14px 16px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease),
              transform 0.22s var(--ease);
  overflow: hidden;
}
.stil-kachel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--ton, var(--gruen));
}
.stil-kachel:hover { border-color: var(--telegrau); transform: translateY(-2px); }
.stil-kachel strong { display: block; font-size: 0.98rem; margin-bottom: 2px; }
.stil-kachel small { color: var(--text-leise); font-size: 0.82rem; line-height: 1.4; display: block; }
.stil-kachel.aktiv {
  border-color: var(--gruen);
  background: var(--gruen-hell);
  box-shadow: var(--schatten);
}
.stil-kachel.aktiv strong { color: var(--gruen); }
.stil-kachel.aktiv::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gruen);
  color: var(--weiss);
  font-size: 13px;
  display: grid;
  place-items: center;
}

/* Bereiche: Kacheln oben, Materialien gesammelt darunter */
.block-hinweis { color: var(--text-leise); font-size: 0.86rem; margin: -6px 0 12px; }

.bereich-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.bereich-kachel {
  background: var(--weiss);
  border: 1.5px solid var(--grenze);
  border-radius: var(--radius-klein);
  padding: 12px 8px;
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.bereich-kachel svg {
  width: 22px; height: 22px; fill: none; stroke: var(--telegrau);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.2s var(--ease);
}
.bereich-kachel:hover { border-color: var(--telegrau); transform: translateY(-2px); }
.bereich-kachel.aktiv { border-color: var(--gruen); background: var(--gruen-hell); color: var(--gruen); }
.bereich-kachel.aktiv svg { stroke: var(--gruen); }

.material-bloecke { display: grid; gap: 8px; margin-top: 12px; }
.material-block {
  background: var(--weiss);
  border: 1px solid var(--grenze);
  border-radius: var(--radius-klein);
  padding: 12px 14px;
  animation: auf 0.35s var(--ease) both;
}
.material-titel {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gruen);
  margin-bottom: 9px;
}
.material-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.material-chip {
  background: var(--weiss);
  border: 1.5px solid var(--grenze);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
}
.material-chip:hover { border-color: var(--telegrau); }
.material-chip.aktiv { background: var(--gruen); border-color: var(--gruen); color: var(--weiss); }

/* Wunsch-Freitext */
.wunsch {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--grenze);
  border-radius: var(--radius-klein);
  background: var(--weiss);
  font: inherit;
  font-size: 0.98rem;
  resize: vertical;
  min-height: 76px;
}
.wunsch::placeholder { color: var(--telegrau); }
.wunsch:focus { outline: none; border-color: var(--gruen); box-shadow: 0 0 0 3px rgba(0, 105, 76, 0.12); }

/* Auflösungs-Schalter */
.schalter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.schalter-teil { cursor: pointer; }
.schalter-teil input { position: absolute; opacity: 0; pointer-events: none; }
.schalter-inhalt {
  display: block;
  padding: 13px 16px;
  background: var(--weiss);
  border: 1.5px solid var(--grenze);
  border-radius: var(--radius-klein);
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.schalter-inhalt strong { display: block; font-size: 0.98rem; }
.schalter-inhalt small { color: var(--text-leise); font-size: 0.82rem; }
.schalter-teil input:checked + .schalter-inhalt {
  border-color: var(--gruen);
  box-shadow: 0 0 0 2px var(--gruen) inset;
}
.schalter-teil input:focus-visible + .schalter-inhalt { outline: 3px solid var(--gruen); outline-offset: 2px; }

.fehler {
  background: #fdeceb;
  border-left: 4px solid #c0392b;
  color: #8c2b20;
  padding: 12px 16px;
  border-radius: var(--radius-klein);
  font-size: 0.92rem;
}

/* === ARCHIV ============================================ */
.archiv {
  max-width: var(--maxw);
  margin: 30px auto 0;
  padding: 0 20px;
}
.archiv details {
  background: var(--weiss);
  border: 1px solid var(--grenze);
  border-radius: var(--radius);
  overflow: hidden;
}
.archiv summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
}
.archiv summary::-webkit-details-marker { display: none; }
.archiv-zahl { color: var(--telegrau); font-weight: 500; font-size: 0.9rem; }
.archiv-liste { list-style: none; padding: 0 20px; }
.archiv-liste li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--grenze);
  font-size: 0.92rem;
}
.archiv-liste a { color: var(--gruen); font-weight: 600; text-decoration: none; }
.archiv-liste a:hover { text-decoration: underline; }
.archiv-liste .datum { margin-left: auto; color: var(--telegrau); font-size: 0.85rem; }
.archiv-leer { color: var(--telegrau); padding: 4px 0 16px; font-size: 0.92rem; }
.archiv-loeschen {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 8px;
  border-radius: 8px;
  color: var(--telegrau);
}
.archiv-loeschen:hover { background: var(--beige); color: #c0392b; }
.archiv-hinweis {
  color: var(--telegrau);
  font-size: 0.82rem;
  padding: 12px 0 18px;
  border-top: 1px solid var(--grenze);
}

/* === FUSS ============================================== */
.fuss {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 20px 40px;
  text-align: center;
  color: var(--text-leise);
  font-size: 0.85rem;
  display: grid;
  gap: 8px;
}
.fuss strong { color: var(--gruen); }
.fuss-klein { color: var(--telegrau); font-size: 0.78rem; }
.link-btn {
  background: none;
  border: 0;
  color: var(--telegrau);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  justify-self: center;
  padding: 8px;
}

/* === GRÖSSERE BILDSCHIRME ============================== */
@media (min-width: 700px) {
  body { font-size: 17px; }
  .kopf-logo { height: 40px; }
  .kopf-wort { font-size: 23px; }
  .buehne { min-height: 62vh; }
  .zustand-foto img { max-height: 74vh; width: auto; max-width: 100%; }
  .pult { padding-top: 34px; gap: 26px; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
