/* Transfereko Cookie Consent — glassmorphism, accent violet + lime (charte) */

.tk-cookie-banner {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 12000;
  width: min(920px, calc(100vw - 24px));
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, #0a0a0c 72%, transparent);
  color: #fff;
  box-shadow:
    0 24px 64px -20px rgba(0, 0, 0, 0.65),
    0 0 0 1px color-mix(in srgb, var(--lime) 18%, transparent),
    0 0 40px -12px rgba(var(--accent-rgb), 0.55);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  overflow: hidden;
  animation: tk-cookie-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

:root:not([data-theme="dark"]) .tk-cookie-banner {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  box-shadow:
    0 24px 64px -24px rgba(var(--accent-rgb), 0.35),
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.tk-cookie-banner[hidden],
.tk-cookie-overlay[hidden],
.tk-cookie-modal[hidden],
.tk-cookie-fab[hidden] {
  display: none !important;
}

.tk-cookie-banner-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(var(--accent-rgb), 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(var(--lime-rgb), 0.18), transparent 50%);
  pointer-events: none;
}

.tk-cookie-banner-inner {
  position: relative;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tk-cookie-banner-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.tk-cookie-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-lime);
  background: var(--lime);
  font-family: var(--font-mono);
}

.tk-cookie-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.tk-cookie-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: color-mix(in srgb, #fff 78%, transparent);
}

:root:not([data-theme="dark"]) .tk-cookie-body {
  color: var(--text-dim);
}

.tk-cookie-body p { margin: 0 0 10px; }
.tk-cookie-body ul {
  margin: 0 0 10px;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tk-cookie-body li { margin: 0; }
.tk-cookie-legal {
  margin: 0 !important;
  font-size: 0.82rem;
  opacity: 0.9;
}
.tk-cookie-legal a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tk-cookie-legal a:hover { color: var(--lime); }

.tk-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tk-cookie-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--radius-sm, 12px);
  font: 600 0.88rem var(--font-body);
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.tk-cookie-btn:hover { transform: translateY(-1px); }
.tk-cookie-btn:active { transform: translateY(1px) scale(0.99); }

.tk-cookie-btn-primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--on-accent);
  box-shadow: 0 10px 28px -12px rgba(var(--accent-rgb), 0.7);
}
.tk-cookie-btn-primary:hover { filter: brightness(1.06); }

.tk-cookie-btn-secondary {
  background: color-mix(in srgb, #fff 10%, transparent);
  color: inherit;
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
}
:root:not([data-theme="dark"]) .tk-cookie-btn-secondary {
  background: var(--surface-raised);
  border-color: var(--border);
  color: var(--text);
}

.tk-cookie-btn-ghost {
  background: transparent;
  color: inherit;
  border: 1px dashed color-mix(in srgb, var(--lime) 45%, transparent);
}
.tk-cookie-btn-ghost:hover {
  background: color-mix(in srgb, var(--lime) 12%, transparent);
}

/* Preferences modal */
.tk-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 12010;
  background: color-mix(in srgb, #000 62%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tk-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 12020;
  display: grid;
  place-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.tk-cookie-modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, #121214 88%, transparent);
  color: #fff;
  box-shadow: var(--shadow-lg, 0 24px 48px rgba(0, 0, 0, 0.4));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px 20px 18px;
  animation: tk-cookie-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

:root:not([data-theme="dark"]) .tk-cookie-modal-card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
}

.tk-cookie-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.tk-cookie-modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.tk-cookie-modal-lead {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: color-mix(in srgb, #fff 72%, transparent);
}
:root:not([data-theme="dark"]) .tk-cookie-modal-lead {
  color: var(--text-dim);
}

.tk-cookie-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  background: color-mix(in srgb, #fff 8%, transparent);
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.tk-cookie-icon-btn:hover {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

.tk-cookie-cats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.tk-cookie-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
  background: color-mix(in srgb, #fff 5%, transparent);
}
:root:not([data-theme="dark"]) .tk-cookie-cat {
  border-color: var(--border);
  background: var(--surface-raised);
}

.tk-cookie-cat-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 0.95rem;
}
.tk-cookie-cat-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: color-mix(in srgb, #fff 68%, transparent);
}
:root:not([data-theme="dark"]) .tk-cookie-cat-desc {
  color: var(--text-dim);
}

.tk-cookie-pill {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 22%, transparent);
  color: var(--lime);
  border: 1px solid color-mix(in srgb, var(--lime) 40%, transparent);
  white-space: nowrap;
}

.tk-cookie-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  cursor: pointer;
}
.tk-cookie-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tk-cookie-switch-ui {
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 18%, transparent);
  border: 1px solid color-mix(in srgb, #fff 20%, transparent);
  transition: background 0.2s ease;
  position: relative;
}
.tk-cookie-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.tk-cookie-switch input:checked + .tk-cookie-switch-ui {
  background: var(--accent);
  border-color: transparent;
}
.tk-cookie-switch input:checked + .tk-cookie-switch-ui::after {
  transform: translateX(20px);
}
.tk-cookie-switch input:focus-visible + .tk-cookie-switch-ui {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.tk-cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

/* Persistent reopen control */
.tk-cookie-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 11900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, #121214 80%, transparent);
  color: var(--accent-bright);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
:root:not([data-theme="dark"]) .tk-cookie-fab {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--accent);
}
.tk-cookie-fab:hover {
  transform: translateY(-2px) scale(1.04);
  background: var(--accent);
  color: var(--on-accent);
}

body.tk-cookie-open .tk-cookie-fab,
body.tk-cookie-prefs-open .tk-cookie-fab {
  opacity: 0;
  pointer-events: none;
}

.tk-cookie-manage-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent-bright);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tk-cookie-manage-link:hover { color: var(--lime); }

.footer-cookie-row {
  margin: 10px 0 0;
  font-size: 0.82rem;
}

@keyframes tk-cookie-in {
  from { opacity: 0; transform: translateX(-50%) translateY(18px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 640px) {
  .tk-cookie-banner {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
    bottom: max(12px, env(safe-area-inset-bottom));
    border-radius: 18px;
  }
  @keyframes tk-cookie-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .tk-cookie-actions { flex-direction: column; align-items: stretch; }
  .tk-cookie-btn { width: 100%; }
  .tk-cookie-modal-actions { flex-direction: column-reverse; }
  .tk-cookie-modal-actions .tk-cookie-btn { width: 100%; }
  .tk-cookie-fab {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tk-cookie-banner,
  .tk-cookie-modal-card {
    animation: none;
  }
}
