/* ============================================================
   JuridicAlly Consent Banner
   Farben & Typografie nach frontend_styleguide.md
   Primary: #1E4D6B  Accent: #B87333  Muted: #5A6B7A
   ============================================================ */

/* ── Scroll-Lock (solange ein blockierendes Layer offen ist) ── */

.jur-no-scroll {
  overflow: hidden !important;
}

/* ── Banner (zentriertes, blockierendes Popup) ───────────── */

.jur-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  z-index: 9020;
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(30, 77, 107, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  overscroll-behavior: contain;
}

.jur-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.jur-banner-inner {
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.jur-banner-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1E4D6B;
  letter-spacing: -0.02em;
}

.jur-banner-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #5A6B7A;
}

.jur-banner-text a {
  color: #1E4D6B;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jur-banner-text a:hover {
  color: #B87333;
}

.jur-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jur-banner-buttons {
  display: flex;
  gap: 10px;
}

.jur-banner-buttons .jur-btn {
  flex: 1;
}

/* Settings-Link (gleichwertig sichtbar, aber sekundär) */
.jur-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  align-self: center;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #5A6B7A;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: color 0.15s ease;
}

.jur-link-btn:hover {
  color: #1E4D6B;
}

/* ── Buttons ─────────────────────────────────────────────── */

.jur-btn {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
              background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  line-height: 1;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jur-btn--primary {
  background: #1E4D6B;
  color: #ffffff;
  border-color: #1E4D6B;
}

.jur-btn--primary:hover {
  background: #153a52;
  border-color: #153a52;
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(30, 77, 107, 0.18);
}

.jur-btn--outline {
  background: transparent;
  color: #1E4D6B;
  border-color: rgba(30, 77, 107, 0.30);
}

.jur-btn--outline:hover {
  background: #f8f6f2;
  border-color: #1E4D6B;
}

/* ── Backdrop ────────────────────────────────────────────── */

.jur-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9010;
  background: rgba(15, 20, 25, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.jur-backdrop.is-visible {
  opacity: 1;
}

/* ── Modal ───────────────────────────────────────────────── */

.jur-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  z-index: 9020;
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(30, 77, 107, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  overscroll-behavior: contain;
}

.jur-modal.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.jur-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(30, 77, 107, 0.10);
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.jur-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #1E4D6B;
  letter-spacing: -0.02em;
}

.jur-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #5A6B7A;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
  margin: -4px -8px -4px 0;
}

.jur-modal-close:hover {
  color: #1E4D6B;
  background: #f8f6f2;
}

.jur-modal-body {
  padding: 16px 24px;
}

.jur-modal-intro {
  font-size: 13px;
  color: #5A6B7A;
  margin: 0 0 16px;
  line-height: 1.6;
}

/* ── Kategorien ──────────────────────────────────────────── */

.jur-cat {
  padding: 14px 0;
  border-bottom: 1px solid rgba(30, 77, 107, 0.08);
}

.jur-cat:last-child {
  border-bottom: none;
}

.jur-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.jur-cat-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.jur-cat-name {
  font-size: 14px;
  font-weight: 600;
  color: #1E4D6B;
}

.jur-cat-desc {
  font-size: 12px;
  color: #5A6B7A;
  margin: 0;
  line-height: 1.55;
}

.jur-cat-desc a,
.jur-modal-intro a {
  color: #1E4D6B;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.jur-cat-desc a:hover,
.jur-modal-intro a:hover {
  color: #B87333;
}

/* ── Badge "Immer aktiv" ─────────────────────────────────── */

.jur-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #B87333;
  background: rgba(184, 115, 51, 0.10);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Toggle Switch ───────────────────────────────────────── */

.jur-toggle {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  background: #d1d9e3;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.jur-toggle.is-on {
  background: #1E4D6B;
}

.jur-toggle.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.jur-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: left 0.2s ease;
  display: block;
  pointer-events: none;
}

.jur-toggle.is-on .jur-toggle-knob {
  left: 22px;
}

/* ── Modal Footer ────────────────────────────────────────── */

.jur-modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(30, 77, 107, 0.10);
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: #ffffff;
}

/* ── Floating Re-Open Button ─────────────────────────────── */

.jur-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 8900;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  color: #1E4D6B;
  border: 1.5px solid rgba(30, 77, 107, 0.22);
  border-radius: 20px;
  padding: 8px 14px 8px 10px;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(30, 77, 107, 0.10);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  line-height: 1;
}

.jur-reopen:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(30, 77, 107, 0.16);
  border-color: rgba(30, 77, 107, 0.45);
}

.jur-reopen svg {
  flex-shrink: 0;
  color: #B87333;
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .jur-banner {
    max-height: calc(100dvh - 20px);
    border-radius: 12px 12px 0 0;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(20px);
  }

  .jur-banner.is-visible {
    transform: translateY(0);
  }

  .jur-banner-buttons {
    flex-direction: column;
  }

  .jur-banner-buttons .jur-btn {
    width: 100%;
    padding: 12px 16px;
  }

  .jur-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 12px 12px 0 0;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(20px);
  }

  .jur-modal.is-visible {
    transform: translateY(0);
  }

  .jur-reopen {
    bottom: 16px;
    left: 16px;
  }
}
