/* =====================================================================
   Einwilligungs-Banner, Einstellungs-Dialog und Zwei-Klick-Platzhalter
   (gehört zu consent.js)
   ===================================================================== */

/* ---------- Gemeinsame Bausteine ---------- */

.fs-consent,
.fs-consent-panel {
  --cs-bg: var(--fs-asphalt-2, #22252a);
  --cs-line: rgba(255, 255, 255, .14);
  --cs-text: rgba(232, 234, 236, .82);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%),
    var(--cs-bg);
  border: 1px solid var(--cs-line);
  border-radius: var(--fs-radius, 18px);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .2);
  font-family: var(--fs-font-body, system-ui, sans-serif);
}
.fs-consent:focus,
.fs-consent-panel:focus { outline: none; }

.fs-consent-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.fs-consent-title {
  margin: 0; font-family: var(--fs-font-display, inherit); font-weight: 700;
  font-size: 1.15rem; line-height: 1.2; color: #fff;
}

/* Kleine Ampel als Motiv */
.fs-consent-light {
  display: inline-flex; flex-direction: column; gap: 3px; flex: none;
  padding: 4px; border-radius: 7px; background: #111316;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.fs-consent-light i { display: block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.fs-consent-light i:nth-child(1) { background: var(--fs-primary, #c8102e); box-shadow: 0 0 8px rgba(200, 16, 46, .9); }
.fs-consent-light i:nth-child(2) { background: rgba(255, 176, 32, .28); }
.fs-consent-light i:nth-child(3) { background: rgba(34, 193, 114, .28); }

.fs-consent-text { margin: 0 0 1rem; font-size: .9rem; line-height: 1.55; color: var(--cs-text); }
.fs-consent a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.fs-consent-panel a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.fs-consent a:hover,
.fs-consent-panel a:hover { color: var(--fs-primary-light, #ff8a95); }

/* Alle drei Knöpfe gleich gewichtet (keine Hervorhebung von „Akzeptieren“) */
.fs-consent-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.fs-consent-btn {
  min-height: 44px; padding: .55rem .8rem;
  border: 1.5px solid rgba(255, 255, 255, .55); border-radius: var(--fs-radius-pill, 999px);
  background: rgba(255, 255, 255, .06); color: #fff;
  font: inherit; font-size: .88rem; font-weight: 700; line-height: 1.2; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.fs-consent-btn:hover { background: var(--fs-primary, #c8102e); border-color: var(--fs-primary, #c8102e); }
.fs-consent-btn:focus-visible,
.fs-consent-x:focus-visible,
.fs-consent-switch input:focus-visible + .fs-consent-track {
  outline: 3px solid var(--fs-primary-light, #ff8a95); outline-offset: 2px;
}

/* ---------- Banner (unten, kein Vollbild-Wall) ---------- */

.fs-consent {
  position: fixed; z-index: 1080;
  left: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  width: min(34rem, calc(100vw - 2.5rem));
  max-height: calc(100vh - 2.5rem); overflow: auto;
  padding: 1.15rem 1.25rem 1.25rem;
  border-top: 4px solid var(--fs-primary, #c8102e);
  opacity: 0; transform: translateY(24px);
  transition: opacity .25s ease, transform .3s var(--fs-ease-out, ease);
}
.fs-consent.is-visible { opacity: 1; transform: none; }
.fs-consent[hidden] { display: none; }

/* WhatsApp-Button und „Nach oben“ ausblenden, solange der Banner offen ist */
body.fs-consent-open .fab,
body.fs-consent-open .to-top { opacity: 0 !important; visibility: hidden !important; pointer-events: none; }

@media (max-width: 575.98px) {
  .fs-consent {
    left: .6rem; right: .6rem; width: auto;
    bottom: calc(.6rem + env(safe-area-inset-bottom, 0px));
    padding: 1rem 1rem 1.05rem;
  }
  .fs-consent-text { font-size: .86rem; }
  .fs-consent-actions { grid-template-columns: 1fr 1fr; }
  .fs-consent-actions .fs-consent-btn:last-child { grid-column: 1 / -1; }
}

/* ---------- Einstellungs-Dialog ---------- */

.fs-consent-modal {
  position: fixed; inset: 0; z-index: 1090;
  display: grid; place-items: center; padding: 1rem;
}
.fs-consent-modal[hidden] { display: none; }
.fs-consent-backdrop { position: absolute; inset: 0; background: rgba(14, 16, 19, .62); }
.fs-consent-panel {
  position: relative; width: min(36rem, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  padding: 1.25rem 1.35rem 1.1rem; border-top: 4px solid var(--fs-primary, #c8102e);
}
.fs-consent-modal.is-visible .fs-consent-panel { animation: fs-consent-pop .25s var(--fs-ease-out, ease) both; }
@keyframes fs-consent-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

html.fs-consent-locked { overflow: hidden; }

.fs-consent-x {
  margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--cs-line); border-radius: 50%; background: transparent; color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.fs-consent-x:hover { background: rgba(255, 255, 255, .1); }

.fs-consent-cat {
  margin-bottom: .75rem; padding: .85rem 1rem;
  border: 1px solid var(--cs-line); border-radius: var(--fs-radius-sm, 12px);
  background: rgba(255, 255, 255, .03);
}
.fs-consent-cat-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.fs-consent-cat-name { font-weight: 700; font-size: .95rem; cursor: pointer; }
.fs-consent-cat-desc { margin: .4rem 0 0; font-size: .83rem; line-height: 1.5; color: var(--cs-text); }
.fs-consent-panel .fs-consent-actions { margin-top: 1rem; }
.fs-consent-foot { margin: .9rem 0 0; font-size: .8rem; text-align: center; }

/* Schalter */
.fs-consent-switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.fs-consent-switch input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.fs-consent-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  transition: background-color .2s ease;
}
.fs-consent-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); transition: transform .2s var(--fs-ease-out, ease);
}
.fs-consent-switch input:checked + .fs-consent-track { background: var(--fs-green, #22c172); }
.fs-consent-switch input:checked + .fs-consent-track::after { transform: translateX(22px); }
.fs-consent-switch.is-locked input { cursor: not-allowed; }
.fs-consent-switch.is-locked .fs-consent-track { opacity: .6; }

@media (max-width: 575.98px) {
  .fs-consent-panel .fs-consent-actions { grid-template-columns: 1fr; }
}

/* ---------- Footer-/Text-Link „Cookie-Einstellungen“ ---------- */

.consent-link { cursor: pointer; }

/* ---------- Zwei-Klick-Platzhalter (Google Maps) ---------- */

.consent-embed { position: relative; min-height: 320px; background: #eef0ec; }
.consent-embed.is-loaded { min-height: 0; background: none; }
.consent-placeholder[hidden] { display: none; }
.consent-placeholder {
  position: relative; display: grid; place-items: center; min-height: 320px; padding: 1.5rem 1.25rem;
  overflow: hidden; isolation: isolate; text-align: center;
  /* Stilisierte Karte – nur CSS, kein externes Bild */
  background:
    /* Fluss */
    linear-gradient(118deg, transparent 0 61%, #b9d4ea 61% 64.5%, transparent 64.5%),
    /* Hauptstraßen */
    linear-gradient(32deg, transparent 0 43%, #fff 43% 45.5%, transparent 45.5%),
    linear-gradient(-20deg, transparent 0 56%, #ffe7a8 56% 58.6%, transparent 58.6%),
    /* Parks */
    radial-gradient(ellipse 18% 14% at 18% 24%, #cfe5c3 0 98%, transparent 100%),
    radial-gradient(ellipse 14% 18% at 84% 78%, #cfe5c3 0 98%, transparent 100%),
    /* Straßenraster */
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, .95) 46px 49px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(255, 255, 255, .95) 38px 41px),
    #e9ebe5;
}
.consent-placeholder::before {
  /* Leichter Schleier für Lesbarkeit */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 70% 75% at 50% 50%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .15));
}
.consent-placeholder-card {
  max-width: 24rem; padding: 1.1rem 1.15rem 1rem;
  border-radius: var(--fs-radius-sm, 12px);
  background: rgba(28, 31, 36, .94); color: #fff;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
}
.consent-placeholder-pin {
  display: grid; place-items: center; width: 42px; height: 42px; margin: -2.2rem auto .55rem;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--fs-primary, #c8102e); box-shadow: 0 8px 18px -6px rgba(200, 16, 46, .8);
}
.consent-placeholder-pin i { transform: rotate(45deg); font-size: 1.1rem; }
.consent-placeholder-text { margin: 0 0 .85rem; font-size: .86rem; line-height: 1.5; color: rgba(232, 234, 236, .86); }
.consent-placeholder-text a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.consent-placeholder-text a:hover { color: var(--fs-primary-light, #ff8a95); }
.consent-placeholder-btn {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .55rem 1.2rem;
  border: 0; border-radius: 999px; background: var(--fs-primary, #c8102e); color: #fff;
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease;
}
.consent-placeholder-btn:hover { background: var(--fs-primary-dark, #a30d25); }
.consent-placeholder-btn:focus-visible,
.consent-placeholder-always input:focus-visible {
  outline: 3px solid var(--fs-primary-light, #ff8a95); outline-offset: 2px;
}
.consent-placeholder-always {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  margin-top: .7rem; font-size: .82rem; color: rgba(232, 234, 236, .8); cursor: pointer;
}
.consent-placeholder-always input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--fs-primary, #c8102e); cursor: pointer; }

/* ---------- Weniger Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  .fs-consent,
  .fs-consent-btn,
  .fs-consent-track,
  .fs-consent-track::after,
  .consent-placeholder-btn { transition: none; }
  .fs-consent { transform: none; }
  .fs-consent-modal.is-visible .fs-consent-panel { animation: none; }
}

/* ---------- Druck ---------- */

@media print {
  .fs-consent, .fs-consent-modal { display: none !important; }
}
