/**
 * Notfall-Button und Popup.
 *
 * Farben und Formen folgen der Website: dunkles Panel, ein Rot (#ed2f28),
 * Pfirsich als Akzent. Nichts hier hängt von einem Theme ab.
 */

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

.sb-nf {
  --sb-nf-bg: #0b0b0b;
  --sb-nf-panel: #141414;
  --sb-nf-line: rgba(255, 255, 255, 0.12);
  --sb-nf-ink: #ffffff;
  --sb-nf-soft: #c9c9c9;
  --sb-nf-mute: #8d8d8d;
  --sb-nf-red: #ed2f28;
  --sb-nf-red-dark: #b8231c;
  --sb-nf-peach: #ffbc7d;
  --sb-nf-radius: 18px;
  font-family: "Archivo", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ------------------------------------------------------------------ Button */

.sb-nf-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 22px;
  border: 1px solid rgba(237, 47, 40, 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sb-nf-red) 0%, #c8231d 100%);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 18px 40px -22px rgba(237, 47, 40, 0.9);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.sb-nf-trigger:hover,
.sb-nf-trigger:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #f4483f 0%, var(--sb-nf-red-dark) 100%);
  box-shadow: 0 22px 44px -20px rgba(237, 47, 40, 0.95);
}

.sb-nf-trigger-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  display: block;
}

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

.sb-nf-dialog {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sb-nf-dialog[hidden] { display: none; }

.sb-nf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.72);
  backdrop-filter: blur(6px);
  animation: sb-nf-fade 0.22s ease both;
}

html.sb-nf-open,
html.sb-nf-open body { overflow: hidden; }

.sb-nf-sheet {
  position: relative;
  width: min(var(--sb-nf-width, 640px), 100%);
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sb-nf-panel);
  color: var(--sb-nf-ink);
  border: 1px solid var(--sb-nf-line);
  border-radius: calc(var(--sb-nf-radius) + 4px);
  box-shadow: 0 60px 120px -60px rgba(0, 0, 0, 0.95);
  animation: sb-nf-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ------------------------------------------------------------------ Kopf */

.sb-nf-head {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--sb-nf-line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(237, 47, 40, 0.2) 0%, transparent 55%),
    var(--sb-nf-bg);
}

.sb-nf-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sb-nf-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sb-nf-peach);
}

.sb-nf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sb-nf-red);
  box-shadow: 0 0 0 4px rgba(237, 47, 40, 0.22);
  animation: sb-nf-pulse 2.4s ease-in-out infinite;
}

.sb-nf-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--sb-nf-line);
  background: transparent;
  color: var(--sb-nf-soft);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.sb-nf-x svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.sb-nf-x:hover,
.sb-nf-x:focus-visible {
  color: #fff;
  border-color: rgba(237, 47, 40, 0.7);
}

.sb-nf-title {
  margin: 14px 0 0;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: normal;
  hyphens: none;
}

.sb-nf-progress {
  margin: 12px 0 8px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sb-nf-mute);
}

.sb-nf-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.sb-nf-bar span {
  display: block;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--sb-nf-red), var(--sb-nf-peach));
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ Inhalt */

.sb-nf-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.sb-nf-body {
  padding: 22px 26px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sb-nf-body::-webkit-scrollbar,
.sb-nf-sheet::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sb-nf-step {
  margin: 0;
  padding: 0;
  border: 0;
  display: none;
}

.sb-nf-step.is-active {
  display: block;
  animation: sb-nf-slide-next 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sb-nf-step.is-active.is-back {
  animation-name: sb-nf-slide-back;
}

.sb-nf-legend {
  padding: 0;
  margin: 0 0 16px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sb-nf-ink);
  overflow-wrap: normal;
  hyphens: none;
}

.sb-nf-field {
  display: block;
  margin-bottom: 16px;
}

.sb-nf-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--sb-nf-soft);
}

.sb-nf-opt {
  font-weight: 400;
  color: var(--sb-nf-mute);
}

.sb-nf-field input[type="text"],
.sb-nf-field input[type="tel"],
.sb-nf-field input[type="email"],
.sb-nf-field select,
.sb-nf-field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--sb-nf-line);
  background: #0e0e0e;
  color: var(--sb-nf-ink);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sb-nf-field textarea { resize: vertical; min-height: 104px; }

.sb-nf-field input:focus,
.sb-nf-field select:focus,
.sb-nf-field textarea:focus {
  outline: none;
  border-color: rgba(237, 47, 40, 0.85);
  box-shadow: 0 0 0 3px rgba(237, 47, 40, 0.18);
}

.sb-nf-field input.sb-nf-invalid,
.sb-nf-field textarea.sb-nf-invalid,
.sb-nf-field select.sb-nf-invalid {
  border-color: var(--sb-nf-red);
  box-shadow: 0 0 0 3px rgba(237, 47, 40, 0.18);
}

.sb-nf-choice {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.sb-nf-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--sb-nf-line);
  border-radius: 12px;
  background: #0e0e0e;
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sb-nf-radio:hover { border-color: rgba(237, 47, 40, 0.45); }

.sb-nf-radio input { accent-color: var(--sb-nf-red); }

.sb-nf-radio:has(input:checked) {
  border-color: rgba(237, 47, 40, 0.8);
  background: rgba(237, 47, 40, 0.1);
}

.sb-nf-alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(237, 47, 40, 0.4);
  background: rgba(237, 47, 40, 0.1);
}

.sb-nf-alert p { margin: 0 0 10px; font-size: 0.86rem; }

.sb-nf-alert-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.sb-nf-consent {
  display: flex;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--sb-nf-line);
  border-radius: 12px;
  background: #0e0e0e;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--sb-nf-soft);
  cursor: pointer;
}

.sb-nf-consent input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--sb-nf-red);
  cursor: pointer;
}

.sb-nf-consent a { color: var(--sb-nf-peach); }

.sb-nf-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--sb-nf-mute);
}

.sb-nf-hint a,
.sb-nf-tel {
  color: var(--sb-nf-peach);
  text-decoration: none;
  font-weight: 600;
}

.sb-nf-hint a:hover { text-decoration: underline; }

/* Zusammenfassung */

.sb-nf-summary {
  margin: 0 0 16px;
  display: grid;
  gap: 10px;
}

.sb-nf-summary-row {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sb-nf-line);
  font-size: 0.88rem;
}

.sb-nf-summary-row dt {
  color: var(--sb-nf-mute);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sb-nf-summary-row dd {
  margin: 0;
  color: var(--sb-nf-ink);
  overflow-wrap: anywhere;
}

.sb-nf-summary-row button {
  border: 0;
  background: none;
  color: var(--sb-nf-peach);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  text-decoration: underline;
}

/* Danke */

.sb-nf-done { text-align: center; padding-top: 6px; }

.sb-nf-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(237, 47, 40, 0.14);
  border: 1px solid rgba(237, 47, 40, 0.45);
}

.sb-nf-check svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--sb-nf-peach);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sb-nf-thanks {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--sb-nf-soft);
}

.sb-nf-error {
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(237, 47, 40, 0.45);
  background: rgba(237, 47, 40, 0.12);
  font-size: 0.84rem;
  color: #ffd7d4;
}

.sb-nf-error[hidden] { display: none; }

/* ------------------------------------------------------------------ Fuß */

.sb-nf-foot {
  display: flex;
  gap: 10px;
  padding: 14px 26px 20px;
  border-top: 1px solid var(--sb-nf-line);
  background: var(--sb-nf-bg);
}

.sb-nf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sb-nf-btn--primary {
  flex: 1;
  background: var(--sb-nf-red);
  color: #fff;
}

.sb-nf-btn--primary:hover,
.sb-nf-btn--primary:focus-visible {
  background: var(--sb-nf-red-dark);
  transform: translateY(-1px);
}

.sb-nf-btn--ghost,
.sb-nf-btn--back {
  background: transparent;
  border-color: var(--sb-nf-line);
  color: var(--sb-nf-soft);
}

.sb-nf-btn--ghost:hover,
.sb-nf-btn--back:hover {
  border-color: rgba(237, 47, 40, 0.6);
  color: #fff;
}

.sb-nf-btn[hidden] { display: none; }

.sb-nf-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.sb-nf-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* ------------------------------------------------------------------ Mobil */

@media (max-width: 640px) {
  .sb-nf-dialog {
    padding:
      max(14px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .sb-nf-sheet {
    width: 100%;
    max-height: min(86vh, 780px);
    border-radius: calc(var(--sb-nf-radius) + 2px);
  }

  .sb-nf-head { padding: 14px 18px 10px; }
  .sb-nf-body { padding: 14px 18px 12px; }
  .sb-nf-foot { padding: 10px 18px 14px; }
  .sb-nf-title { font-size: 1.1rem; line-height: 1.24; }
  .sb-nf-legend { margin-bottom: 12px; font-size: 0.98rem; }
  .sb-nf-field { margin-bottom: 12px; }
  .sb-nf-label { margin-bottom: 5px; }
  .sb-nf-field input[type="text"],
  .sb-nf-field input[type="tel"],
  .sb-nf-field input[type="email"],
  .sb-nf-field select,
  .sb-nf-field textarea { padding: 10px 12px; }
  .sb-nf-field textarea { min-height: 84px; }
  .sb-nf-radio { padding: 9px 12px; margin-bottom: 6px; }
  .sb-nf-choice { margin-bottom: 10px; }
  .sb-nf-hint { margin: 8px 0 0; }
  .sb-nf-media-empty { font-size: 12px; }
  .sb-nf-summary-row { grid-template-columns: 84px 1fr auto; padding: 8px 0; }
  .sb-nf-consent { padding: 11px 12px; }
}

/* ------------------------------------------------------- Schwebend */

.sb-nf--floating {
  position: fixed;
  z-index: 99990;
  bottom: max(18px, env(safe-area-inset-bottom));
}

.sb-nf--floating.sb-nf--right { right: 18px; }
.sb-nf--floating.sb-nf--left { left: 18px; }

.sb-nf--floating .sb-nf-trigger {
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Ab 981 px nur das Symbol in einer runden Taste: sie braucht wenig Platz und
   verdeckt am rechten Rand keine Schaltflächen. Die Beschriftung bleibt für
   Screenreader im Markup. Ohne Icon-Einstellung bleibt die breite Taste. */
@media (min-width: 981px) {
  .sb-nf--floating,
  .sb-nf--floating.sb-nf--right,
  .sb-nf--floating.sb-nf--left {
    bottom: 12px;
    right: 12px;
    left: auto;
  }
  .sb-nf--floating.sb-nf--left { left: 12px; right: auto; }
  .sb-nf--floating:has(.sb-nf-trigger-icon) .sb-nf-trigger {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .sb-nf--floating:has(.sb-nf-trigger-icon) .sb-nf-trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 640px) {
  .sb-nf--floating {
    bottom: calc(84px + env(safe-area-inset-bottom));
    right: 14px;
    left: auto;
  }
  .sb-nf--floating.sb-nf--left { left: 14px; }
  .sb-nf--floating .sb-nf-trigger { padding: 12px 18px; font-size: 0.86rem; }
}

/* ------------------------------------------------------- ohne Bewegung */

.sb-nf--still .sb-nf-sheet,
.sb-nf--still .sb-nf-backdrop,
.sb-nf--still .sb-nf-step.is-active,
.sb-nf--still .sb-nf-dot {
  animation: none !important;
}

.sb-nf--still .sb-nf-trigger,
.sb-nf--still .sb-nf-btn,
.sb-nf--still .sb-nf-bar span {
  transition: none !important;
}

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

@keyframes sb-nf-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sb-nf-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes sb-nf-slide-next {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

@keyframes sb-nf-slide-back {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: none; }
}

@keyframes sb-nf-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(237, 47, 40, 0.22); }
  50% { box-shadow: 0 0 0 7px rgba(237, 47, 40, 0.05); }
}

@media (prefers-reduced-motion: reduce) {
  .sb-nf-sheet,
  .sb-nf-backdrop,
  .sb-nf-step.is-active,
  .sb-nf-dot {
    animation: none !important;
  }

  .sb-nf-trigger,
  .sb-nf-btn,
  .sb-nf-bar span {
    transition: none !important;
  }
}

:where(.sb-nf) :focus-visible {
  outline: 2px solid var(--sb-nf-peach);
  outline-offset: 2px;
}

/* Fotos und Videos */
.sb-nf-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.sb-nf-media-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sb-nf-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sb-nf-media-btn:hover,
.sb-nf-media-btn:focus-visible {
  border-color: var(--sb-nf-red);
}

.sb-nf-media-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.sb-nf-media-btn--stop {
  background: var(--sb-nf-red);
  border-color: var(--sb-nf-red);
  color: #fff;
}

.sb-nf-cam video {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 12px;
  background: #000;
  object-fit: cover;
}

.sb-nf-media-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sb-nf-media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}

.sb-nf-media-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  overflow: hidden;
  background: #000;
}

.sb-nf-media-thumb img,
.sb-nf-media-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sb-nf-media-meta {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sb-nf-media-meta strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-nf-media-meta span {
  font-size: 12px;
  opacity: 0.65;
}

.sb-nf-media-del {
  padding: 6px;
  border: 0;
  background: none;
  color: var(--sb-nf-red);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.sb-nf-media-empty,
.sb-nf-media-status {
  margin: 0;
  font-size: 12.5px;
  opacity: 0.7;
}

[data-sb-nf] [hidden] {
  display: none !important;
}
