/* Cookie-consent panel. Non-blocking bottom banner; page stays usable behind it.
   Palette and button treatment intentionally reuse the site language
   (brand #2f5dab, hover #3e7ae0 + glow, 5px button radius, #ffbf47 focus). */

.cookie-consent-panel {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 27, 46, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.cookie-consent-panel.is-open {
  display: block;
}

.cookie-consent-card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 28px 24px;
  border: 1px solid #d7e0ec;
  border-top: 3px solid #2f5dab;
  border-radius: 16px;
  background: #fff;
  color: #26384d;
  box-shadow: 0 18px 48px rgba(15, 27, 46, 0.26);
}

.cookie-consent-panel.is-open .cookie-consent-card {
  animation: cookieConsentRise 0.28s ease-out both;
}

@keyframes cookieConsentRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cookie-consent-card h2 {
  margin: 0 44px 10px 0;
  color: #224f93;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cookie-consent-card p {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #45566a;
}

.cookie-consent-close {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6a7c92;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cookie-consent-close:hover {
  background: #eef2f8;
  color: #24364d;
}

/* ---- Action buttons ------------------------------------------------------ */

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cookie-consent-actions-primary {
  align-items: center;
}

.cookie-consent-button {
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid #2f5dab;
  border-radius: 5px;
  background: #fff;
  color: #2f5dab;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.cookie-consent-button:hover {
  background: #eef3fb;
}

.cookie-consent-button:focus-visible,
.cookie-consent-close:focus-visible,
.cookie-settings-button:focus-visible,
.cookie-consent-switch input[type="checkbox"]:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

/* Accept all and Reject optional stay visually identical (equal prominence). */
.cookie-consent-accept,
.cookie-consent-reject,
.cookie-consent-save {
  border-color: #2f5dab;
  background: #2f5dab;
  color: #fff;
}

.cookie-consent-accept:hover,
.cookie-consent-reject:hover,
.cookie-consent-save:hover {
  background: #3e7ae0;
  border-color: #3e7ae0;
  color: #fff;
  box-shadow: 0 0 10px -3px #2f5dab;
}

/* "Manage choices" is a lighter, secondary control. */
.cookie-consent-manage {
  border-color: #c3d0e2;
  background: transparent;
  color: #2f5dab;
}

.cookie-consent-manage:hover {
  background: #eef3fb;
  border-color: #9fb6d8;
}

/* ---- Details / categories ------------------------------------------------ */

.cookie-consent-details {
  margin-top: 20px;
  padding-top: 4px;
  border-top: 1px solid #e4eaf2;
}

.cookie-consent-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid #eef1f6;
}

.cookie-consent-category strong {
  font-size: 14.5px;
  color: #26384d;
}

.cookie-consent-category p {
  max-width: 620px;
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #66788d;
}

/* ---- Modern toggle switch (CSS-only; real checkbox kept for a11y) --------- */

.cookie-consent-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 12.5px;
  color: #66788d;
}

.cookie-consent-switch input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 0.25s ease;
}

.cookie-consent-switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 27, 46, 0.35);
  transition: transform 0.25s ease;
}

.cookie-consent-switch input[type="checkbox"]:checked {
  background: #2f5dab;
}

.cookie-consent-switch input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.cookie-consent-switch input[type="checkbox"]:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ---- Links / footer trigger ---------------------------------------------- */

.cookie-consent-links {
  margin-top: 18px !important;
  font-size: 12.5px;
  color: #66788d;
}

.cookie-consent-links a {
  color: #2f5dab;
  font-weight: 600;
}

.cookie-settings-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.external-content-placeholder {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid #cbd8e8;
  border-radius: 10px;
  background: #f5f8fc;
  color: #22344d;
}

/* ---- Mobile -------------------------------------------------------------- */

@media (max-width: 640px) {
  .cookie-consent-panel {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .cookie-consent-card {
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    padding: 20px 18px;
    border-radius: 14px;
  }

  .cookie-consent-actions,
  .cookie-consent-category {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-consent-category {
    gap: 12px;
  }

  .cookie-consent-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent-panel.is-open .cookie-consent-card {
    animation: none;
  }
}
