/* website/css/site-consent.css — the consent banner, its preferences and click-to-load embeds
   (js/site-consent.js). Prefixed `kc-` to avoid any collision with main-site.css. Uses the site's
   tokens with fallbacks, so it renders the same on the one-pager, which declares its own.
   Accept and Decline share one style: refusing must be as easy and as visible as accepting.
   Logical properties (inline-start/end) keep it correct right-to-left without overrides. */

.kc-banner,
.kc-embed {
  --kc-surface: var(--bg-secondary, #111113);
  --kc-border: rgba(255, 255, 255, 0.12);
  --kc-text: var(--text-primary, #ffffff);
  --kc-muted: var(--text-secondary, #a1a1aa);
  --kc-button: var(--primary-dark, #4f46e5);       /* white on it: 6.3:1 */
  --kc-button-hover: #4338ca;
  --kc-link: #c7d2fe;                               /* on the surface: 13:1 */
  --kc-focus: #a5b4fc;
}

.kc-banner {
  position: fixed;
  inset-block-end: 16px;
  inset-inline-start: 16px;
  inset-inline-end: 16px;
  /* Above the preloader (10000) and the easter egg (10001), below the support widget (2147483000). */
  z-index: 10002;
  box-sizing: border-box;
  max-inline-size: 560px;
  max-block-size: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--kc-border);
  border-radius: 16px;
  background: var(--kc-surface);
  color: var(--kc-text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-family: var(--font-primary, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
  font-size: 15px;
  line-height: 1.5;
  text-align: start;
}

.kc-banner [hidden] { display: none !important; }

.kc-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--kc-text);
}

.kc-desc {
  margin: 0 0 14px;
  color: var(--kc-muted);
}

.kc-privacy {
  color: var(--kc-link);
  text-decoration: underline;
  white-space: nowrap;
}

.kc-prefs {
  margin: 0 0 14px;
  border-block-start: 1px solid var(--kc-border);
}

.kc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  border-block-end: 1px solid var(--kc-border);
}

.kc-cat strong { display: block; color: var(--kc-text); font-weight: 600; }
.kc-cat small { display: block; color: var(--kc-muted); font-size: 13px; }

.kc-always {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--kc-link);
}

.kc-switch {
  position: relative;
  flex-shrink: 0;
  inline-size: 44px;
  block-size: 24px;
  padding: 0;
  border: 1px solid var(--kc-muted);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.kc-thumb {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background: var(--kc-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.kc-switch[aria-checked="true"] { background: var(--kc-button); border-color: var(--kc-button); }
.kc-switch[aria-checked="true"] .kc-thumb { background: #ffffff; transform: translateX(20px); }
.kc-banner[dir="rtl"] .kc-switch[aria-checked="true"] .kc-thumb { transform: translateX(-20px); }

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

.kc-btn {
  min-block-size: 44px;
  padding: 0 22px;
  border: 1px solid var(--kc-button);
  border-radius: 10px;
  background: var(--kc-button);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.kc-btn:hover { background: var(--kc-button-hover); }

.kc-btn-quiet {
  min-block-size: 44px;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: var(--kc-link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.kc-banner :focus-visible,
.kc-embed :focus-visible,
button[data-consent-open]:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.kc-title:focus { outline: none; }
.kc-title:focus-visible { outline: 2px solid var(--kc-focus); }

/* The support widget sits in the same corner; lift its button, and its panel with it, above an open
   banner so none of them hides another (support-widget.css owns .kchat-*: the panel sits 12px above
   the 56px button, so it moves by the same offset). */
.kc-consent-open .kchat-fab {
  bottom: calc(var(--kc-consent-height, 0px) + 32px);
}

.kc-consent-open .kchat-panel {
  bottom: calc(var(--kc-consent-height, 0px) + 100px);
  max-height: calc(100vh - var(--kc-consent-height, 0px) - 128px);
}

@media (max-width: 600px) {
  .kc-banner { padding: 16px; font-size: 14px; }
  .kc-actions .kc-btn { flex: 1 1 auto; }
}

/* support-widget.css makes the panel full-screen here, above the banner; keep it that way. */
@media (max-width: 480px) {
  .kc-consent-open .kchat-panel { bottom: 0; max-height: 100%; }
}

/* ---------- "Cookie settings" controls in page footers ---------- */
button[data-consent-open] {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.footer-column button[data-consent-open] {
  display: block;
  padding: 0.25rem 0;
  color: var(--text-tertiary, #71717a);
  transition: color var(--transition-base, 300ms ease);
}

.footer-column button[data-consent-open]:hover { color: var(--primary, #6366f1); }

/* ---------- click-to-load embeds ([data-consent-embed]) ---------- */
/* The page sizes the embed box (the one-pager's .hero-video-inner keeps 16:9); the placeholder fills it. */
.kc-embed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 40%, rgba(99, 102, 241, 0.25), transparent 60%), var(--bg-secondary, #111113);
  color: var(--text-primary, #ffffff);
  text-align: center;
}

.kc-embed-notice {
  max-inline-size: 36em;
  margin: 0;
  color: var(--text-secondary, #a1a1aa);
  font-size: 15px;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .kc-thumb,
  .footer-column button[data-consent-open] { transition: none; }
}
