/* ============================================================
   SV Internet — LEGAL-2 cookie consent banner + footer control
   Shell-wide sheet loaded by public-page-shell.js on every
   public page. Self-contained tokens (same oklch atlas palette
   as home-reference/contact/faq sheets) so the banner looks
   identical regardless of the page-level token prefix.
   Layer: z-index 1090 sits below the support chat launcher
   (1099) and its panel (1100); the mobile sheet floats above
   the right-edge contact rail instead of covering it.
   ============================================================ */

:root {
  --svc-onyx: oklch(0.17 0.015 50);
  --svc-panel: oklch(0.21 0.018 50 / 0.92);
  --svc-panel-2: oklch(0.24 0.02 51);
  --svc-line: oklch(0.8 0.11 82 / 0.22);
  --svc-gold: oklch(0.8 0.11 82);
  --svc-gold-hi: oklch(0.92 0.09 90);
  --svc-ember: oklch(0.68 0.17 48);
  --svc-ember-hi: oklch(0.74 0.17 48);
  --svc-text: oklch(0.95 0.02 85);
  --svc-muted: oklch(0.78 0.03 78);
  --svc-warn: oklch(0.78 0.15 35);
  --svc-serif: 'Cormorant Garamond', Georgia, 'Nirmala UI', serif;
  --svc-sans: Jost, 'Nirmala UI', Arial, sans-serif;
  --svc-mono: 'JetBrains Mono', 'Courier New', monospace;
}

.sv-consent-banner[hidden],
.sv-consent-settings[hidden],
.sv-consent-saved[hidden] { display: none !important; }

/* --- floating card / sheet carrier --------------------------------------- */
.sv-consent-banner {
  position: fixed;
  z-index: 1090;
  left: 24px;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--svc-text);
  font: 15px/1.55 var(--svc-sans);
  animation: sv-consent-arrive 0.28s ease-out both;
}

.sv-consent-card {
  position: relative;
  padding: 26px 26px 22px;
  border-radius: 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(158deg, oklch(0.27 0.025 52 / 0.92), oklch(0.16 0.017 48 / 0.94)) padding-box,
    linear-gradient(145deg, oklch(0.85 0.1 82 / 0.42), oklch(0.85 0.1 82 / 0.05) 38%, oklch(0.85 0.1 82 / 0) 62%, oklch(0.85 0.1 82 / 0.15)) border-box;
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
  box-shadow:
    inset 0 1px 0 oklch(0.97 0.03 88 / 0.12),
    0 22px 60px -20px oklch(0.05 0.01 45 / 0.85);
}

.sv-consent-title {
  margin: 0 0 10px;
  font-family: var(--svc-serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--svc-text);
}

.sv-consent-body {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--svc-muted);
}

.sv-consent-policy { margin: 0 0 16px; font-size: 13px; }

.sv-consent-policy-link {
  color: var(--svc-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sv-consent-policy-link:hover { color: var(--svc-gold-hi); }

/* --- actions -------------------------------------------------------------- */
.sv-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sv-consent-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--svc-line);
  background: oklch(0.24 0.02 51 / 0.6);
  color: var(--svc-text);
  font: 600 13px/1.2 var(--svc-sans);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sv-consent-button:hover { background: oklch(0.3 0.025 52 / 0.8); border-color: oklch(0.8 0.11 82 / 0.45); }
.sv-consent-button:active { transform: translateY(1px); }
.sv-consent-button:focus-visible {
  outline: 2px solid var(--svc-gold-hi);
  outline-offset: 2px;
}

.sv-consent-button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--svc-ember-hi), var(--svc-ember));
  color: oklch(0.98 0.01 90);
  box-shadow: 0 10px 26px -12px oklch(0.68 0.17 48 / 0.9);
}
.sv-consent-button-primary:hover {
  background: linear-gradient(135deg, oklch(0.78 0.17 48), oklch(0.72 0.17 48));
  border-color: transparent;
}

.sv-consent-button-ghost { background: transparent; }
.sv-consent-button-warn { color: var(--svc-warn); border-color: oklch(0.78 0.15 35 / 0.45); }
.sv-consent-button-warn:hover { background: oklch(0.78 0.15 35 / 0.14); }

/* --- granular settings region --------------------------------------------- */
.sv-consent-settings {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--svc-line);
}

.sv-consent-settings-title {
  margin: 0 0 12px;
  font-family: var(--svc-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--svc-gold);
}

.sv-consent-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.sv-consent-option + .sv-consent-option { border-top: 1px solid oklch(0.8 0.11 82 / 0.12); }
.sv-consent-option-copy { min-width: 0; }
.sv-consent-option-name {
  display: block;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--svc-text);
}
label.sv-consent-option-name { cursor: pointer; }
.sv-consent-option-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--svc-muted);
}

.sv-consent-always-on {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--svc-line);
  font: 600 11px/1.4 var(--svc-mono);
  letter-spacing: 1px;
  color: var(--svc-gold);
}

/* Accessible 44px switch built on the real checkbox. */
.sv-consent-toggle {
  appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 52px;
  height: 32px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--svc-line);
  background: oklch(0.12 0.015 48 / 0.8);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.sv-consent-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--svc-muted);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.sv-consent-toggle:checked {
  background: linear-gradient(135deg, var(--svc-ember-hi), var(--svc-ember));
  border-color: transparent;
}
.sv-consent-toggle:checked::after {
  transform: translateX(20px);
  background: oklch(0.98 0.01 90);
}
.sv-consent-toggle:focus-visible {
  outline: 2px solid var(--svc-gold-hi);
  outline-offset: 2px;
}

.sv-consent-settings-actions { margin-top: 16px; }

.sv-consent-saved {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--svc-gold-hi);
}

/* --- persistent footer control -------------------------------------------- */
.sv-consent-footer-row { margin: 0; }
.sv-consent-footer-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  /* Match the 44px footer-link touch tier, not the smaller inline-text size. */
  min-height: 44px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0.4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sv-consent-footer-button:hover { color: var(--svc-gold-hi); }
.sv-consent-footer-button:focus-visible {
  outline: 2px solid var(--svc-gold-hi);
  outline-offset: 3px;
  border-radius: 4px;
}

@keyframes sv-consent-arrive {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- responsive: full-width sheet that clears the contact rail ------------ */
@media (max-width: 720px) {
  .sv-consent-banner {
    left: 12px;
    right: 12px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 66px));
    width: auto;
  }
  .sv-consent-card { padding: 22px 20px 18px; border-radius: 18px; }
  .sv-consent-title { font-size: 23px; }
  .sv-consent-actions { flex-direction: column; }
  .sv-consent-button { width: 100%; }
  .sv-consent-settings-actions .sv-consent-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-consent-banner { animation: none; }
  .sv-consent-button,
  .sv-consent-toggle,
  .sv-consent-toggle::after { transition: none; }
}
