dialog {
  margin: auto !important;
  padding: 0;
  border: none;
}

/* #25384a */

dialog.polyfilled {
  position: absolute;
  left: 0;
  right: 0;
  width: -moz-fit-content;
  width: -webkit-fit-content;
  width: fit-content;
  height: -moz-fit-content;
  height: -webkit-fit-content;
  height: fit-content;
  margin: auto;
  border: solid;
  padding: 1em;
  background: #fff;
  color: #000;
  display: block;

  &:not([open]) {
    display: none;
  }

  &.fixed {
    position: fixed;
    top: 50%;
    transform: translate(0, -50%);
  }

  &+.backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.1);
  }
}

._dialog_overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

dialog.cookie-consent .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.focus-styles:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
}

dialog.cookie-consent {
  &:focus-visible {
    outline: none;
  }
}

dialog.cookie-consent::backdrop {
  background: rgba(0, 0, 0, 0.9);
  opacity: 0.9;
}

dialog.cookie-consent .container {
  background-color: #25384a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  color: white;
  max-width: calc(70ch + 40px);
  overflow: hidden;
  padding: 0;
}

dialog.cookie-consent .container .top {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: none;

  &:focus-visible {
    outline: none;
  }

  @supports (max-height: calc(90dvh - 255px)) {
    max-height: calc(90dvh - 255px);
  }
}

dialog.cookie-consent .container .top .intro {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;

  &:focus-visible {
    outline: none;
  }

  >div {
    display: flex;
    flex-direction: column;
    ;
    align-items: center;
    gap: 10px;
  }

  .icon {
    width: 20px;
    height: 20px;
  }
}

dialog.cookie-consent .container .top .intro h2 {
  color: white;
  font-size: 18px;
  font-weight: 600;
}

dialog.cookie-consent .container .top .intro a {
  color: white;
  text-decoration: underline;
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

dialog.cookie-consent .container .prefs {
  display: none;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

dialog.cookie-consent .container .prefs:focus {
  outline: none;
}

dialog.cookie-consent .container .prefs .consent-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper h3 {
  color: white;
  font-weight: 600;
  font-family: "ProximaNova-Semibold", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  margin: 0;
  font-size: 1rem;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper label {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 0;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper input:focus+.toggle {
  outline: 2px solid #3182ce;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper input:checked+.toggle {
  background-color: #3182ce;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper input:focus+.toggle {
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5);
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper input:checked+.toggle::after {
  transform: translateX(100%);
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper .toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #ccc;
  border-radius: 9999px;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper .toggle.disabled {
  opacity: 50%;
  cursor: not-allowed;
}

dialog.cookie-consent .container .prefs .consent-item .toggle-wrapper .toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 9999px;
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

dialog.cookie-consent .container .buttons {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #25384a;
  transition: all 0.25s ease-in-out;
}

dialog.cookie-consent .container .buttons button:focus {
  outline: none;
}

dialog.cookie-consent .container .buttons::before {
  content: '';
  position: absolute;
  top: -21px;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(to top, #25384a, transparent);
}

dialog.cookie-consent .container .buttons .reject {
  text-decoration: underline;
  background: none;
  border: none;
  color: white;
  padding: 0;
}

dialog.cookie-consent .container .buttons .secondary {
  border: 2px solid white;
  padding: 12px 16px;
  background: transparent;
  color: white;
}

dialog.cookie-consent .container .buttons .secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

dialog.cookie-consent .container .buttons .accept {
  padding: 12px 16px;
  background-color: #3f76b0;
  color: white;
  border: none;
}

dialog.cookie-consent .container .buttons .button-wrapper {
  display: flex;
  flex-direction: column-reverse;
  gap: 20px;
}

dialog.cookie-consent .container .buttons .button-wrapper button.hidden {
  display: none;
}

@media (min-width: 768px) {
  dialog.cookie-consent .container .buttons {
    height: 100px;
    flex-direction: row-reverse;
  }

  dialog.cookie-consent .container .buttons .button-wrapper {
    flex-direction: row-reverse;
  }
}