/*!
 * NumaraConsent v1.0.0 — Styles
 * Theming über CSS-Variablen auf .nc-root (oder global auf :root überschreiben):
 *   --nc-accent, --nc-bg, --nc-fg, --nc-muted, --nc-border, --nc-radius, --nc-z
 */

.nc-root {
  --nc-bg: #ffffff;
  --nc-fg: #111827;
  --nc-muted: #6b7280;
  --nc-accent: #10b981;
  --nc-accent-fg: #ffffff;
  --nc-border: #e5e7eb;
  --nc-radius: 14px;
  --nc-z: 2147483000;
  --nc-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--nc-fg);
}

@media (prefers-color-scheme: dark) {
  .nc-root {
    --nc-bg: #16181d;
    --nc-fg: #f3f4f6;
    --nc-muted: #9ca3af;
    --nc-border: #2b2f36;
    --nc-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] .nc-root {
  --nc-bg: #16181d;
  --nc-fg: #f3f4f6;
  --nc-muted: #9ca3af;
  --nc-border: #2b2f36;
  --nc-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] .nc-root {
  --nc-bg: #ffffff;
  --nc-fg: #111827;
  --nc-muted: #6b7280;
  --nc-border: #e5e7eb;
  --nc-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.nc-root *,
.nc-root *::before,
.nc-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Banner (Ebene 1) ---------- */

.nc-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: var(--nc-z);
  padding: 16px;
  pointer-events: none;
}

/* Optionaler Overlay-Modus: <NumaraConsent blocking> */
.nc-root.nc-blocking::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: calc(var(--nc-z) - 1);
  background: rgba(0, 0, 0, 0.45);
}

.nc-banner-inner {
  pointer-events: auto;
  max-width: 720px;
  margin-inline: auto;
  background: var(--nc-bg);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  box-shadow: var(--nc-shadow);
  padding: 20px 22px;
}

.nc-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.nc-text {
  color: var(--nc-muted);
  font-size: 14px;
}

.nc-links {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.nc-link {
  color: var(--nc-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nc-link:hover {
  color: var(--nc-fg);
}

.nc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Akzeptieren & Ablehnen bewusst GLEICH gestaltet (DSGVO: gleichwertige Wahl) */
.nc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: calc(var(--nc-radius) - 6px);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}
.nc-btn:focus-visible {
  outline: 2px solid var(--nc-accent);
  outline-offset: 2px;
}

.nc-btn-primary {
  background: var(--nc-accent);
  color: var(--nc-accent-fg);
}
.nc-btn-primary:hover {
  filter: brightness(0.92);
}

.nc-btn-ghost {
  background: transparent;
  color: var(--nc-fg);
  border-color: var(--nc-border);
}
.nc-btn-ghost:hover {
  background: color-mix(in srgb, var(--nc-fg) 6%, transparent);
}

/* ---------- Modal (Ebene 2) ---------- */

.nc-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--nc-z) + 1);
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.nc-modal {
  background: var(--nc-bg);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-radius);
  box-shadow: var(--nc-shadow);
  width: 100%;
  max-width: 560px;
  max-height: min(85vh, 720px);
  overflow-y: auto;
  padding: 22px;
}

.nc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.nc-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--nc-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}
.nc-close:hover {
  color: var(--nc-fg);
}

.nc-cats {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.nc-cat {
  border: 1px solid var(--nc-border);
  border-radius: calc(var(--nc-radius) - 4px);
  padding: 14px 16px;
}

.nc-cat-desc {
  margin-top: 6px;
  color: var(--nc-muted);
  font-size: 13px;
}

.nc-services {
  margin-top: 6px;
  font-size: 12px;
  color: var(--nc-muted);
}
.nc-services span {
  font-weight: 600;
}

/* Toggle-Switch */
.nc-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.nc-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.nc-slider {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--nc-border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.nc-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.nc-switch input:checked + .nc-slider {
  background: var(--nc-accent);
}
.nc-switch input:checked + .nc-slider::after {
  transform: translateX(18px);
}
.nc-switch input:disabled + .nc-slider {
  opacity: 0.55;
  cursor: not-allowed;
}
.nc-switch input:focus-visible + .nc-slider {
  outline: 2px solid var(--nc-accent);
  outline-offset: 2px;
}
.nc-cat-label {
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Zwei-Klick-Facade (ConsentEmbed) ---------- */

.nc-embed {
  position: relative;
  width: 100%;
  aspect-ratio: var(--nc-embed-ratio, 16 / 9);
  border-radius: var(--nc-radius, 14px);
  overflow: hidden;
  background: #1f2937 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nc-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.nc-embed-facade {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.72);
  color: #f9fafb;
}
.nc-embed-facade p {
  font-size: 13px;
  max-width: 40ch;
  color: #d1d5db;
}
.nc-embed-facade .nc-btn {
  background: var(--nc-accent, #10b981);
  color: #fff;
}

@media (max-width: 480px) {
  .nc-actions {
    flex-direction: column;
  }
  .nc-btn {
    width: 100%;
  }
}
