/* Cookie consent banner and preferences (shared by every page). Loaded with js/consent.js. */
/* ==========================================
   COOKIE BANNER
========================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border, #E7ECF3);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 220px;
}

.cookie-banner-text p {
  font-size: 0.875rem;
  color: var(--grey-cool, #535E6B);
  line-height: 1.6;
}

.cookie-banner-text a {
  color: var(--purple-text, #6338E6);
  font-weight: 500;
  text-decoration: none;
}

.cookie-banner-text a:hover {
  text-decoration: underline;
}

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

.btn-cookie {
  border: none;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-cookie:active { transform: scale(0.97); }

.btn-cookie-reject {
  background: transparent;
  color: var(--grey-mid, #5F6A77);
  border: 1.5px solid var(--grey-light, #D3D8DF);
}

.btn-cookie-reject:hover {
  border-color: var(--grey-mid, #5F6A77);
  color: var(--ink, #0F1624);
}

.btn-cookie-manage {
  background: transparent;
  color: var(--purple-text, #6338E6);
  border: 1.5px solid var(--purple, #7D52FF);
}

.btn-cookie-manage:hover {
  background: rgba(125, 82, 255, 0.06);
}

.btn-cookie-accept {
  background: var(--purple, #7D52FF);
  color: #fff;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 10px rgba(125, 82, 255, 0.25);
}

.btn-cookie-accept:hover {
  background: var(--deep-purple, #693EEB);
  box-shadow: 0 4px 16px rgba(125, 82, 255, 0.35);
}

/* ==========================================
   COOKIE MODAL
========================================== */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 36, 0.45);
  z-index: 9100;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.cookie-modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal-box {
  position: fixed;
  z-index: 9200;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 20px));
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  background: var(--surface, #FFFFFF);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  pointer-events: none;
}

.cookie-modal-box.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.cookie-modal-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink, #0F1624);
}

.cookie-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-mid, #5F6A77);
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.cookie-modal-close:hover {
  background: var(--bg, #F5FAFF);
  color: var(--ink, #0F1624);
}

.cookie-modal-intro {
  font-size: 0.875rem;
  color: var(--grey-cool, #535E6B);
  line-height: 1.65;
  padding: 14px 28px 0;
}

.cookie-categories {
  padding: 20px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cookie-category {
  border: 1px solid var(--border, #E7ECF3);
  border-radius: 16px;
  padding: 18px 20px;
  background: var(--bg, #F5FAFF);
}

.cookie-category-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cookie-category-info {
  flex: 1;
}

.cookie-category-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink, #0F1624);
  margin-bottom: 4px;
}

.cookie-category-desc {
  font-size: 0.8125rem;
  color: var(--grey-cool, #535E6B);
  line-height: 1.55;
}

/* Toggle pill */
.toggle-pill {
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle-pill input[type="checkbox"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.toggle-pill label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: var(--grey-light, #D3D8DF);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.toggle-pill input:checked + label .toggle-track {
  background: var(--purple, #7D52FF);
}

.toggle-pill input:checked + label .toggle-track::after {
  transform: translateX(20px);
}

[dir="rtl"] .toggle-pill input:checked + label .toggle-track::after {
  transform: translateX(-20px);
}

.toggle-pill input:focus-visible + label .toggle-track {
  outline: 2px solid var(--purple, #7D52FF);
  outline-offset: 2px;
}

.toggle-always-on {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1A6B3A;
  background: rgba(86, 213, 118, 0.15);
  border-radius: 100px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.cookie-modal-footer {
  padding: 20px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border, #E7ECF3);
  margin-top: 12px;
}


@media (max-width: 560px) {
  /* Cookie banner stacks on mobile */
  .cookie-banner-inner {
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
  }

  .cookie-banner-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cookie-banner-actions .btn-cookie {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.75rem;
  }

  .cookie-modal-header { padding: 20px 20px 0; }
  .cookie-modal-intro  { padding: 12px 20px 0; }
  .cookie-categories   { padding: 16px 20px 6px; }
  .cookie-modal-footer { padding: 16px 20px 20px; }
}
