/* ===== Cookie consent bar and preferences panel =====
   Frosted crystal-acrylic surfaces, same tokens as the rest of the site. */

/* [hidden] has to win over the flex/grid displays set below. */
.cookie-bar[hidden],
.cookie-panel-wrap[hidden] { display: none !important; }

.cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.90);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-top: 1px solid rgba(168, 221, 245, 0.65);
  box-shadow: 0 -8px 40px rgba(36, 87, 197, 0.14);
}

.cookie-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.cookie-bar-copy { flex: 1 1 auto; min-width: 0; }

.cookie-bar-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.01em;
}

.cookie-bar-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--text-light);
  max-width: 74ch;
}

.cookie-bar-text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.cookie-bar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-bar .btn {
  padding: 11px 20px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.cookie-btn-reject,
.cookie-btn-settings {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(36, 87, 197, 0.34);
}

.cookie-btn-reject:hover,
.cookie-btn-settings:hover {
  background: rgba(57, 125, 224, 0.08);
  border-color: var(--primary-light);
}

.cookie-panel-wrap {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cookie-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 45, 107, 0.46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.cookie-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 30px 32px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #FFFFFF 0%, #F4FAFF 100%);
  border: 1px solid rgba(168, 221, 245, 0.7);
  box-shadow: var(--shadow-lg);
}

.cookie-panel-title {
  margin: 0 0 10px;
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--primary-dark);
  padding-right: 40px;
}

.cookie-panel-text {
  margin: 0 0 18px;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-light);
}

.cookie-panel-text a { color: var(--primary); font-weight: 600; text-decoration: underline; }

.cookie-panel-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(57, 125, 224, 0.10);
  color: var(--primary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.cookie-panel-close:hover { background: rgba(57, 125, 224, 0.20); }

.cookie-table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(168, 221, 245, 0.6);
  border-radius: var(--radius);
  background: #FFFFFF;
}

.cookie-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.78rem;
  color: var(--text);
}

.cookie-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--primary-dark);
  background: rgba(168, 221, 245, 0.18);
  border-bottom: 1px solid rgba(168, 221, 245, 0.6);
  white-space: nowrap;
}

.cookie-table td {
  padding: 12px;
  line-height: 1.6;
  border-bottom: 1px solid rgba(36, 87, 197, 0.07);
  vertical-align: middle;
}

.cookie-table tbody tr:last-child td { border-bottom: none; }

.cookie-table td:nth-child(2) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
}

.cookie-tag-required {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(36, 87, 197, 0.10);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Analytics switch */
.cookie-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
}

.cookie-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #CBD8E8;
  transition: var(--transition);
}

.cookie-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(12, 45, 107, 0.35);
  transition: var(--transition);
}

.cookie-switch input:checked + .cookie-slider { background: var(--primary); }
.cookie-switch input:checked + .cookie-slider::before { transform: translateX(18px); }
.cookie-switch input:focus-visible + .cookie-slider { box-shadow: 0 0 0 3px rgba(57, 125, 224, 0.35); }
.cookie-switch-text { font-weight: 600; color: var(--text-light); white-space: nowrap; }

.cookie-panel-state {
  margin: 14px 0 0;
  font-size: 0.76rem;
  color: var(--text-light);
}

.cookie-panel-state strong { color: var(--primary-dark); }

.cookie-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(168, 221, 245, 0.6);
}

.cookie-panel-actions .btn { padding: 11px 20px; font-size: 0.84rem; }
.cookie-panel-reject,
.cookie-panel-accept {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(36, 87, 197, 0.34);
}
.cookie-panel-reject:hover,
.cookie-panel-accept:hover { background: rgba(57, 125, 224, 0.08); }

/* Footer entry point, so the choice can always be revisited. Normally appended inline to
   the copyright line; the standalone row is only used on the print manual. */
.cookie-footer-sep { opacity: 0.5; margin: 0 7px; }

.cookie-footer-entry {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.78rem;
}

.cookie-footer-link {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-footer-link:hover { color: var(--accent-light); }

/* The data-lang spans are already handled by the language rules in style.css. */

@media (max-width: 900px) {
  .cookie-bar { padding: 16px 18px; }
  .cookie-bar-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .cookie-bar-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .cookie-bar .btn { justify-content: center; width: 100%; }
  .cookie-panel { padding: 24px 20px 20px; }
  .cookie-panel-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media print {
  .cookie-bar,
  .cookie-panel-wrap,
  .cookie-footer-entry { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-bar *,
  .cookie-panel * { transition: none !important; }
}
