.cookie-banner[hidden],
.cookie-modal[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9990;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: none;
  padding: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.cookie-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.menu-open .cookie-banner {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cookie-banner__card {
  pointer-events: auto;
  margin-inline: auto;
  width: min(80rem, 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  font-family: "Montserrat", system-ui, sans-serif;
}

.cookie-banner__text {
  flex: 1 1 28rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #475569;
}

.cookie-banner__title {
  display: inline;
  margin-right: 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.cookie-banner__text a {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.cookie-banner__text a:hover {
  color: #0d9488;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
  gap: 0.6rem;
}

@media (min-width: 768px) {
  .cookie-banner__card {
    flex-wrap: nowrap;
  }
}

.cookie-banner__card .cookie-btn--secondary {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.22);
  color: #1e293b;
}

.cookie-banner__card .cookie-btn--secondary:hover {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.35);
}

.cookie-banner__card .cookie-btn--ghost {
  color: #334155;
}

.cookie-banner__card .cookie-btn--ghost:hover {
  color: #0f172a;
}

.cookie-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  padding: 0.6rem 1.15rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.cookie-btn--primary {
  background: var(--btn, #1e4d7a);
  color: #fff;
}

.cookie-btn--primary:hover {
  background: var(--btn-hover, #2863a0);
  box-shadow: 0 8px 18px rgba(30, 77, 122, 0.35);
}

.cookie-btn--secondary {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(110, 200, 255, 0.22);
  color: #dce4ff;
}

.cookie-btn--secondary:hover {
  border-color: rgba(110, 200, 255, 0.4);
  background: rgba(110, 200, 255, 0.06);
}

.cookie-btn--ghost {
  background: transparent;
  color: #9fb1cd;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  padding-inline: 0.5rem;
}

.cookie-btn--ghost:hover {
  color: #dce4ff;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: "Montserrat", system-ui, sans-serif;
}

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

.cookie-modal__card {
  width: min(34rem, 100%);
  max-height: min(85vh, 42rem);
  display: flex;
  flex-direction: column;
  border-radius: 1.1rem;
  border: 1px solid rgba(110, 200, 255, 0.18);
  background: #0b1524;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(0.75rem);
  transition: transform 0.25s ease;
}

.cookie-modal.is-visible .cookie-modal__card {
  transform: translateY(0);
}

.cookie-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.35rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cookie-modal__header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.cookie-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9fb1cd;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.cookie-modal__close:hover {
  color: #fff;
}

.cookie-modal__body {
  overflow-y: auto;
  padding: 0.75rem 1.35rem;
  display: grid;
  gap: 0.55rem;
}

.cookie-modal__intro {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.6;
  color: #b9c4d9;
}

.cookie-modal__intro a {
  color: #9ec8ff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.95rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.cookie-category h3 {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #eef4ff;
}

.cookie-category p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #9fb1cd;
}

.cookie-category__badge {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7ddba4;
  border: 1px solid rgba(125, 219, 164, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

.cookie-switch {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  width: 2.9rem;
  height: 1.6rem;
  display: inline-block;
}

.cookie-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.cookie-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cookie-switch__track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #cfd8ea;
  transform: translateY(-50%);
  transition: left 0.2s ease, background 0.2s ease;
}

.cookie-switch input:checked + .cookie-switch__track {
  background: var(--btn, #1e4d7a);
  border-color: rgba(110, 200, 255, 0.4);
}

.cookie-switch input:checked + .cookie-switch__track::after {
  left: calc(100% - 1.35rem);
  background: #fff;
}

.cookie-switch input:focus-visible + .cookie-switch__track {
  outline: 2px solid #6ec8ff;
  outline-offset: 2px;
}

.cookie-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.75rem 1.35rem 0.95rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

form button[type="submit"],
form button:not([type]) {
  scroll-margin-bottom: calc(var(--cookie-h) + 1rem);
}

@media (max-width: 640px) {
  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__actions .cookie-btn--ghost {
    flex: 1 0 100%;
  }

  .cookie-banner__actions .cookie-btn--primary,
  .cookie-banner__actions .cookie-btn--secondary {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-modal,
  .cookie-modal__card {
    transition: none;
  }
}

html[data-theme="light"] .cookie-banner__card {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .cookie-banner__text {
  color: #475569;
}

html[data-theme="light"] .cookie-banner__title {
  color: #0f172a;
}

html[data-theme="light"] .cookie-banner__text a {
  color: #0f766e;
}

html[data-theme="light"] .cookie-banner__text a:hover {
  color: #0d9488;
}

html[data-theme="light"] .cookie-btn--secondary {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.15);
  color: #334155;
}

html[data-theme="light"] .cookie-btn--secondary:hover {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.28);
}

html[data-theme="light"] .cookie-btn--ghost {
  color: #64748b;
}

html[data-theme="light"] .cookie-btn--ghost:hover {
  color: #0f172a;
}

html[data-theme="light"] .cookie-modal {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-theme="light"] .cookie-modal__card {
  border-color: rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

html[data-theme="light"] .cookie-modal__header {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .cookie-modal__header h2 {
  color: #0f172a;
}

html[data-theme="light"] .cookie-modal__close {
  color: #64748b;
}

html[data-theme="light"] .cookie-modal__close:hover {
  color: #0f172a;
}

html[data-theme="light"] .cookie-modal__intro {
  color: #475569;
}

html[data-theme="light"] .cookie-modal__intro a {
  color: #0f766e;
}

html[data-theme="light"] .cookie-modal__intro a:hover {
  color: #0d9488;
}

html[data-theme="light"] .cookie-category {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .cookie-category h3 {
  color: #0f172a;
}

html[data-theme="light"] .cookie-category p {
  color: #64748b;
}

html[data-theme="light"] .cookie-category__badge {
  color: #15803d;
  border-color: rgba(21, 128, 61, 0.28);
  background: #f0fdf4;
}

html[data-theme="light"] .cookie-switch__track {
  background: rgba(15, 23, 42, 0.15);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .cookie-switch__track::after {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

html[data-theme="light"] .cookie-switch input:checked + .cookie-switch__track {
  border-color: rgba(43, 108, 176, 0.45);
}

html[data-theme="light"] .cookie-switch input:focus-visible + .cookie-switch__track {
  outline-color: #93c5fd;
}

html[data-theme="light"] .cookie-modal__footer {
  border-top-color: rgba(15, 23, 42, 0.08);
}
