:root {
  --cookie-surface: #111827;
  --cookie-surface-raised: #192238;
  --cookie-border: rgba(148, 163, 184, 0.26);
  --cookie-text: #f8fafc;
  --cookie-muted: #b7c2d4;
  --cookie-accent: #8b5cf6;
  --cookie-accent-strong: #6d28d9;
}

.cookie-consent-banner,
.cookie-consent-dialog,
.cookie-legal-footer {
  font-family: "Segoe UI", sans-serif;
}

.cookie-consent-banner {
  position: fixed;
  z-index: 9998;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 40px));
  padding: 22px;
  border: 1px solid var(--cookie-border);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(25, 34, 56, 0.98), rgba(12, 18, 32, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  color: var(--cookie-text);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.cookie-consent-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-consent-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.cookie-consent-title::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid #c4b5fd;
  border-radius: 50%;
  box-shadow: 7px 3px 0 -4px #c4b5fd, -5px 6px 0 -4px #c4b5fd;
}

.cookie-consent-copy,
.cookie-preference-description,
.cookie-preference-note {
  margin: 0;
  color: var(--cookie-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.cookie-consent-copy a,
.cookie-legal-footer a,
.cookie-preference-description a {
  color: #c4b5fd;
  text-decoration: none;
}

.cookie-consent-copy a:hover,
.cookie-legal-footer a:hover,
.cookie-preference-description a:hover { text-decoration: underline; }

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.cookie-consent-button {
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--cookie-text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cookie-consent-button:hover { transform: translateY(-1px); }
.cookie-consent-button:focus-visible,
.cookie-toggle:focus-visible { outline: 3px solid rgba(196, 181, 253, 0.76); outline-offset: 2px; }
.cookie-consent-button.primary { background: linear-gradient(135deg, var(--cookie-accent), var(--cookie-accent-strong)); box-shadow: 0 8px 18px rgba(109, 40, 217, 0.3); }
.cookie-consent-button.secondary { border-color: var(--cookie-border); background: rgba(148, 163, 184, 0.08); }
.cookie-consent-button.text { color: #d8d2ff; padding-left: 4px; }

.cookie-consent-dialog-backdrop {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.cookie-consent-dialog-backdrop.is-open { opacity: 1; pointer-events: auto; }
.cookie-consent-dialog {
  width: min(680px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--cookie-border);
  border-radius: 8px;
  background: var(--cookie-surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  color: var(--cookie-text);
  transform: translateY(10px) scale(0.99);
  transition: transform 180ms ease;
}
.cookie-consent-dialog-backdrop.is-open .cookie-consent-dialog { transform: translateY(0) scale(1); }
.cookie-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 22px 22px 14px; border-bottom: 1px solid var(--cookie-border); }
.cookie-dialog-header h2 { margin: 0 0 6px; font-size: 1.15rem; }
.cookie-dialog-close { width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--cookie-text); font-size: 1.3rem; cursor: pointer; }
.cookie-dialog-close:hover { background: rgba(148, 163, 184, 0.12); }
.cookie-preferences { padding: 8px 22px 18px; }
.cookie-preference-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.15); }
.cookie-preference-row:last-child { border-bottom: 0; }
.cookie-preference-row h3 { margin: 0 0 5px; font-size: 0.95rem; }
.cookie-preference-note { margin-top: 14px; font-size: 0.8rem; }
.cookie-toggle { appearance: none; position: relative; width: 42px; height: 24px; margin: 3px 0 0; border: 1px solid rgba(148, 163, 184, 0.45); border-radius: 999px; background: #475569; cursor: pointer; transition: background 160ms ease; }
.cookie-toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; transition: transform 160ms ease; }
.cookie-toggle:checked { background: var(--cookie-accent); border-color: var(--cookie-accent); }
.cookie-toggle:checked::after { transform: translateX(18px); }
.cookie-toggle:disabled { cursor: not-allowed; opacity: 0.78; }
.cookie-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; padding: 16px 22px; border-top: 1px solid var(--cookie-border); }
.cookie-legal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding: 18px 20px max(18px, env(safe-area-inset-bottom)); color: rgba(203, 213, 225, 0.78); font-size: 0.78rem; }
.cookie-legal-footer button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }

@media (max-width: 560px) {
  .cookie-consent-banner { right: 12px; bottom: 12px; width: calc(100vw - 24px); padding: 18px; }
  .cookie-consent-actions { display: grid; grid-template-columns: 1fr; }
  .cookie-consent-button { width: 100%; }
  .cookie-consent-button.text { order: 3; }
  .cookie-dialog-header, .cookie-preferences, .cookie-dialog-actions { padding-left: 16px; padding-right: 16px; }
  .cookie-dialog-actions { display: grid; grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner, .cookie-consent-dialog-backdrop, .cookie-consent-dialog, .cookie-consent-button, .cookie-toggle, .cookie-toggle::after { transition: none; }
}
