/* ==========================================================================
   COOKIE SETTINGS (OPT-OUT, no banner): modal only
   Copied from the 2xN reference kit (css/opt-out-cookie.css), re-skinned to the
   Professor Tet Yap design system. Pairs with scripts/cookie-consent.js.

   Re-skin: map these design-system variables (or define them):
     --ink (panel background), --paper (panel text), --accent, --accent-ink,
     --font-display, --radius-lg, --ease, --speed
   and adjust the --cookie-* colour hooks on .cookie below. The panel stays
   dark in both themes so it reads as chrome rather than page content.
   ========================================================================== */
.cookie {
  --ink: #082A43;
  --paper: #F3EEE4;
  --accent: #BC9B5D;
  --accent-ink: #032035;
  --font-display: 'Red Hat Display', system-ui, sans-serif;
  --radius-lg: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --speed: .18s;
  --cookie-muted: #FFFFFF;
  --cookie-dim: #FFFFFF;
  --cookie-accent-hover: #CDB07A;
  --cookie-border: rgba(188, 155, 93, .55);
  --cookie-backdrop: rgba(1, 18, 31, .72);
  --cookie-line: rgba(188, 155, 93, .35);
  --cookie-line-strong: rgba(188, 155, 93, .6);
  --cookie-track: rgba(243, 238, 228, .14);
  font-family: 'Red Hat Text', system-ui, sans-serif;
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: flex-end; justify-content: flex-start;
  padding: clamp(16px, 4vw, 32px);
  pointer-events: none;
}
.cookie[hidden] { display: none; }
.cookie--modal { align-items: center; justify-content: center; }

.cookie__backdrop {
  position: fixed; inset: 0;
  background: var(--cookie-backdrop);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: cookieFadeIn .26s ease both;
  pointer-events: auto;
}
.cookie__backdrop[hidden] { display: none; }
@keyframes cookieFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cookieFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes cookiePanelIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cookiePanelOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px); } }

.cookie__panel {
  position: relative; pointer-events: auto;
  width: 100%; max-width: 420px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--cookie-border);
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .7);
  border-radius: var(--radius-lg);
  padding: 26px 26px 24px;
}
.cookie--modal .cookie__panel { max-width: 540px; }
.cookie.is-in .cookie__panel { animation: cookiePanelIn .34s var(--ease) forwards; }
.cookie.is-out .cookie__panel { animation: cookiePanelOut .22s ease forwards; }
.cookie.is-out .cookie__backdrop { animation: cookieFadeOut .22s ease both; }

.cookie__view[hidden] { display: none !important; }


.cookie__title {
  font-family: var(--font-display); font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase; letter-spacing: .1em;
  font-size: 13px; margin: 0 0 8px; color: var(--paper);
}
.cookie__copy { font-size: 15px; line-height: 1.6; color: var(--cookie-muted); margin: 0; text-wrap: pretty; }
.cookie__copy a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.cookie__copy a:hover { color: var(--accent); }

.cookie__actions {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 20px;
}
.cookie__btn {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  min-height: 48px; padding: 12px 22px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; transition: background var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.cookie__btn--primary { background: var(--accent); color: var(--accent-ink); min-width: 120px; }
.cookie__btn--primary:hover { background: var(--cookie-accent-hover); }

.cookie__prefs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.cookie__close {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: transparent; border: 1px solid var(--cookie-line-strong); cursor: pointer;
  transition: border-color var(--speed) var(--ease);
}
.cookie__close:hover { border-color: var(--accent); }
.cookie__close span { position: absolute; top: 50%; left: 50%; width: 13px; height: 1.5px; background: var(--cookie-muted); }
.cookie__close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.cookie__close span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

.cookie__cats { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; }
.cookie__cat {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--cookie-line);
}
.cookie__cat:first-child { border-top: none; }
.cookie__cat-text { min-width: 0; }
.cookie__cat-name { display: block; font-size: 15px; font-weight: 700; color: var(--paper); margin-bottom: 4px; }
.cookie__cat-desc { display: block; font-size: 14px; line-height: 1.55; color: var(--cookie-dim); text-wrap: pretty; }
.cookie__always {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  padding: 4px 9px; margin-top: 2px; border-radius: 999px;
}

.cookie__switch { position: relative; flex: none; width: 46px; height: 26px; cursor: pointer; }
.cookie__switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cookie__track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--cookie-track); border: 1px solid var(--cookie-line-strong);
  transition: background .22s ease, border-color .22s ease;
}
.cookie__track::after {
  content: ""; position: absolute; top: 50%; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--cookie-muted);
  transform: translateY(-50%);
  transition: transform .22s var(--ease), background .22s ease;
}
.cookie__switch input:checked ~ .cookie__track { background: var(--accent); border-color: var(--accent); }
.cookie__switch input:checked ~ .cookie__track::after { transform: translateY(-50%) translateX(20px); background: var(--ink); }
.cookie__switch input:focus-visible ~ .cookie__track { outline: 2px solid var(--accent); outline-offset: 2px; }

.cookie__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cookie__actions--prefs { margin-top: 24px; }

@media (max-width: 540px) {
  .cookie { padding: 14px; }
  .cookie__panel { max-width: none; }
  .cookie__actions { flex-direction: column-reverse; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie__panel, .cookie.is-in .cookie__panel, .cookie__backdrop,
  .cookie__track, .cookie__track::after { animation: none; transition: none; }
}
