:root {
  --consent-navy: #02162b;
  --consent-blue: #06284b;
  --consent-green: #1d963a;
  --consent-green-dark: #126f2a;
  --consent-mint: #8ddd9a;
  --consent-white: #fff;
  --consent-text: #102033;
  --consent-muted: #526273;
  --consent-line: rgba(16, 32, 51, .14);
  --consent-shadow: 0 24px 80px rgba(2, 22, 43, .24);
}

.cookie-consent[hidden],
.cookie-preferences[hidden] {
  display: none !important;
}

.cookie-consent,
.cookie-preferences {
  font-family: inherit;
}

.cookie-consent {
  position: fixed;
  z-index: 9998;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 18px;
  display: flex;
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
  padding: clamp(20px, 2.5vw, 30px);
  color: var(--consent-white);
  background:
    radial-gradient(circle at 92% 12%, rgba(141, 221, 154, .16), transparent 30%),
    var(--consent-navy);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px 7px 20px 7px;
  box-shadow: var(--consent-shadow);
  gap: clamp(22px, 4vw, 52px);
  align-items: center;
}

.cookie-consent__copy {
  min-width: 0;
  flex: 1 1 520px;
}

.cookie-consent__eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--consent-mint);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.cookie-consent__copy h2,
.cookie-preferences__panel h2 {
  margin: 0;
  color: inherit;
  letter-spacing: -.03em;
}

.cookie-consent__copy h2 {
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.cookie-consent__copy p {
  max-width: 68ch;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .76);
  font-size: .9rem;
  line-height: 1.55;
}

.cookie-consent__copy a {
  color: var(--consent-white);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: var(--consent-mint);
  text-underline-offset: 3px;
}

.cookie-consent__actions {
  display: grid;
  min-width: min(100%, 500px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  flex: 0 1 500px;
}

.cookie-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  color: var(--consent-white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 9px 3px 9px 3px;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.cookie-button:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .7);
}

.cookie-button--primary {
  color: var(--consent-white);
  background: var(--consent-green);
  border-color: var(--consent-green);
}

.cookie-button--primary:hover {
  background: var(--consent-green-dark);
  border-color: var(--consent-green-dark);
}

.cookie-button--wide {
  grid-column: 1 / -1;
}

.cookie-button:focus-visible,
.cookie-settings-link:focus-visible,
.cookie-preferences__close:focus-visible,
.cookie-toggle input:focus-visible + span {
  outline: 3px solid var(--consent-mint);
  outline-offset: 3px;
}

.cookie-preferences {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  padding: 20px;
  background: rgba(2, 17, 32, .72);
  place-items: center;
  overflow-y: auto;
}

.cookie-preferences__panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  padding: clamp(24px, 4vw, 40px);
  color: var(--consent-text);
  background: var(--consent-white);
  border-radius: 22px 7px 22px 7px;
  box-shadow: var(--consent-shadow);
  overflow-y: auto;
}

.cookie-preferences__panel h2 {
  padding-right: 42px;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
}

.cookie-preferences__intro {
  margin: 12px 0 24px;
  color: var(--consent-muted);
  font-size: .92rem;
  line-height: 1.6;
}

.cookie-preferences__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  color: var(--consent-navy);
  background: #eef4ef;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  place-items: center;
}

.cookie-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--consent-line);
  align-items: start;
}

.cookie-category strong {
  display: block;
  color: var(--consent-navy);
  font-size: 1rem;
}

.cookie-category p {
  margin: 5px 0 0;
  color: var(--consent-muted);
  font-size: .82rem;
  line-height: 1.5;
}

.cookie-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.cookie-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cookie-toggle span {
  position: relative;
  display: block;
  width: 48px;
  height: 27px;
  background: #bcc6ce;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.cookie-toggle span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(2, 22, 43, .22);
  content: "";
  transition: transform .2s ease;
}

.cookie-toggle input:checked + span {
  background: var(--consent-green);
}

.cookie-toggle input:checked + span::after {
  transform: translateX(21px);
}

.cookie-toggle input:disabled + span {
  cursor: not-allowed;
  opacity: .72;
}

.cookie-preferences__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.cookie-preferences__actions .cookie-button:not(.cookie-button--primary) {
  color: var(--consent-navy);
  border-color: rgba(2, 22, 43, .25);
}

.cookie-preferences__actions .cookie-button:not(.cookie-button--primary):hover {
  background: #eef4ef;
  border-color: rgba(2, 22, 43, .45);
}

.cookie-preferences__note {
  margin: 16px 0 0;
  color: var(--consent-muted);
  font-size: .74rem;
  line-height: 1.5;
}

.cookie-settings-link {
  appearance: none;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.cookie-settings-link:hover {
  color: #fff;
}

body.cookie-banner-visible .mobile-contact-bar {
  opacity: 0;
  pointer-events: none;
}

body.cookie-preferences-open {
  overflow: hidden;
}

@media (max-width: 780px) {
  .cookie-consent {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
  }

  .cookie-consent__copy,
  .cookie-consent__actions {
    flex-basis: auto;
  }

  .cookie-consent__actions {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .cookie-consent {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-bottom));
    padding: 18px;
    border-radius: 16px 5px 16px 5px;
    overflow-y: auto;
  }

  .cookie-consent__copy p {
    font-size: .82rem;
  }

  .cookie-consent__actions,
  .cookie-preferences__actions {
    grid-template-columns: 1fr;
  }

  .cookie-button--wide {
    grid-column: 1;
  }

  .cookie-preferences {
    padding: 8px;
    align-items: end;
  }

  .cookie-preferences__panel {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
    border-radius: 18px 6px 18px 6px;
  }

  .cookie-category {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-button,
  .cookie-toggle span,
  .cookie-toggle span::after {
    transition: none;
  }
}
