/* =========================================================
   MILO — CONSENT MODAL
   ========================================================= */

.milo-consent[hidden],
.milo-consent__view[hidden] {
  display: none !important;
}

.milo-consent {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: inherit;
}

.milo-consent__overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 25, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.milo-consent__dialog {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: min(820px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid rgba(116, 102, 255, 0.16);
  border-radius: 28px;
  background: #ffffff;
  color: #090d25;
  box-shadow: 0 34px 90px rgba(4, 8, 28, 0.3);
}

.milo-consent__view {
  display: flex;
  max-height: min(820px, calc(100dvh - 48px));
  flex-direction: column;
}

.milo-consent__header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 88px;
  padding: 24px 34px 18px;
  border-bottom: 1px solid #edf0f7;
}

.milo-consent__header--advanced {
  justify-content: space-between;
}

.milo-consent__logo {
  display: block;
  width: 116px;
  height: auto;
  object-fit: contain;
}

.milo-consent__logo--small {
  width: 98px;
}

.milo-consent__content {
  overflow-y: auto;
  padding: 34px;
  overscroll-behavior: contain;
}

.milo-consent__content--advanced {
  padding-bottom: 28px;
}

.milo-consent__title {
  margin: 0;
  color: #090d25;
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.milo-consent__description {
  max-width: 720px;
  margin: 18px 0 0;
  color: #5f6880;
  font-size: 16px;
  line-height: 1.65;
}

.milo-consent__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 24px;
}

.milo-consent__link {
  color: #594ff0;
  font-size: 14px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(89, 79, 240, 0.34);
  text-underline-offset: 4px;
}

.milo-consent__link:hover {
  color: #3e37c7;
}

.milo-consent__link:focus-visible,
.milo-consent__button:focus-visible,
.milo-consent__back:focus-visible,
.milo-consent__switch:focus-visible {
  outline: 3px solid rgba(87, 94, 255, 0.32);
  outline-offset: 3px;
}

.milo-consent__legal-note {
  margin: 24px 0 0;
  padding: 14px 16px;
  border-radius: 13px;
  background: #f7f7fc;
  color: #777d90;
  font-size: 12px;
  line-height: 1.55;
}

.milo-consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(240px, 1.45fr);
  gap: 12px;
  flex: 0 0 auto;
  padding: 20px 34px 28px;
  border-top: 1px solid #edf0f7;
  background: rgba(255, 255, 255, 0.98);
}

.milo-consent__button {
  min-height: 50px;
  padding: 13px 17px;
  border-radius: 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.milo-consent__button:hover {
  transform: translateY(-1px);
}

.milo-consent__button--primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #735cff, #4c61ee);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(98, 91, 255, 0.22);
}

.milo-consent__button--primary:hover {
  box-shadow: 0 14px 30px rgba(98, 91, 255, 0.28);
}

.milo-consent__button--secondary {
  border: 1px solid #cfd5e7;
  background: #ffffff;
  color: #1b2440;
}

.milo-consent__button--secondary:hover {
  border-color: #9387ff;
  background: #faf9ff;
}

.milo-consent__button--ghost {
  border: 1px solid #e2e5ef;
  background: #f6f7fa;
  color: #4f5870;
}

.milo-consent__button--ghost:hover {
  border-color: #cfd4e2;
  background: #f0f2f7;
}

.milo-consent__back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #424b64;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.milo-consent__back:hover {
  color: #594ff0;
}

.milo-consent__categories {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.milo-consent__category {
  padding: 20px;
  border: 1px solid #e5e8f1;
  border-radius: 17px;
  background: #ffffff;
}

.milo-consent__category-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.milo-consent__category-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.milo-consent__category-title {
  margin: 0;
  color: #11162d;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
}

.milo-consent__category-description {
  margin: 7px 0 0;
  color: #6a7186;
  font-size: 13px;
  line-height: 1.5;
}

.milo-consent__badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eeecff;
  color: #5549d7;
  font-size: 11px;
  font-weight: 750;
}

.milo-consent__switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #cdd2df;
  border-radius: 999px;
  background: #dfe3ec;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.milo-consent__switch[aria-checked="true"] {
  border-color: #6659f5;
  background: #6659f5;
}

.milo-consent__switch:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.milo-consent__switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 21, 45, 0.22);
  transition: transform 160ms ease;
}

.milo-consent__switch[aria-checked="true"] .milo-consent__switch-thumb {
  transform: translateX(20px);
}

body.milo-consent__body-locked {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 760px) {
  .milo-consent {
    align-items: end;
    padding: 12px;
  }

  .milo-consent__dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .milo-consent__view {
    max-height: calc(100dvh - 24px);
  }

  .milo-consent__header {
    min-height: 72px;
    padding: 18px 20px 14px;
  }

  .milo-consent__logo {
    width: 102px;
  }

  .milo-consent__logo--small {
    width: 86px;
  }

  .milo-consent__content {
    padding: 24px 20px;
  }

  .milo-consent__title {
    font-size: clamp(25px, 8vw, 32px);
  }

  .milo-consent__description {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.58;
  }

  .milo-consent__actions {
    grid-template-columns: 1fr;
    padding: 16px 20px 20px;
  }

  .milo-consent__button--primary {
    grid-row: 1;
  }

  .milo-consent__actions--advanced .milo-consent__button--primary {
    grid-row: auto;
  }

  .milo-consent__category {
    padding: 17px;
  }

  .milo-consent__category-header {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .milo-consent__button,
  .milo-consent__switch,
  .milo-consent__switch-thumb {
    transition: none;
  }
}
