/* Cookie consent UI shared by app pages and standalone landing. */

.cookie-banner,
.cookie-banner *,
.cookie-modal-shell,
.cookie-modal-shell * {
  box-sizing: border-box;
}

.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 100%;
  padding: 1rem max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.cookie-banner.cookie-banner--visible {
  display: block;
}

.cookie-banner-inner {
  width: min(100%, 880px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.cookie-banner-text {
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #2b2b2b;
  overflow-wrap: anywhere;
}

.cookie-banner-text a {
  color: inherit;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  width: 100%;
  min-width: 0;
  gap: 0.75rem;
  justify-content: stretch;
}

.cookie-banner-actions .skip-btn,
.cookie-banner-actions .next-btn,
.cookie-modal-footer .skip-btn,
.cookie-modal-footer .next-btn {
  min-height: 44px;
  border: none;
  border-radius: 14px;
  padding: 10px 18px;
  width: 100%;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: normal;
  cursor: pointer;
}

.cookie-banner-actions .skip-btn,
.cookie-modal-footer .skip-btn {
  background: #f1ebf9;
  color: #5e2cc6;
}

.cookie-banner-actions .next-btn,
.cookie-modal-footer .next-btn {
  background: #5e2cc6;
  color: #fff;
}

.cookie-modal-shell[hidden] {
  display: none !important;
}

.cookie-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1060;
  background: rgba(0, 0, 0, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal-dialog {
  width: min(680px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.cookie-modal {
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
}

.cookie-modal-header {
  border-bottom: none;
  padding: 1rem 1.5rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.cookie-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: var(--LUVIO-font-h2, 600);
  color: #1f1f1f;
}

.cookie-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 1.5rem 0.75rem;
}

.cookie-modal-intro {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #333;
}

.cookie-pref-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cookie-pref-item:last-child {
  border-bottom: none;
}

.cookie-pref-text {
  flex: 1 1 220px;
  min-width: 0;
}

.cookie-pref-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: #1f1f1f;
}

.cookie-pref-desc {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.65);
}

.cookie-pref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.8);
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  padding-top: 2px;
}

.cookie-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: none;
}

.cookie-modal-footer .skip-btn,
.cookie-modal-footer .next-btn {
  min-height: 48px;
  padding: 12px 18px;
  font-size: 1rem;
  line-height: 1.25;
  flex: 1 1 min(100%, 180px);
}

.cookie-close {
  appearance: none;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.06);
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
}

.cookie-close::before,
.cookie-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background: rgba(0, 0, 0, 0.7);
  transform-origin: center;
}

.cookie-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.cookie-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.cookie-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (min-width: 720px) {
  .cookie-banner-inner {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: center;
  }

  .cookie-banner-actions {
    justify-self: end;
  }

  .cookie-pref-item {
    flex-wrap: nowrap;
  }

  .cookie-pref-toggle {
    width: auto;
    min-width: 110px;
    justify-content: flex-end;
  }
}

@media (max-width: 767.98px) {
  .cookie-modal-shell {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    overflow: hidden;
  }

  .cookie-modal-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    overflow: hidden;
  }

  .cookie-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    width: 100%;
    max-width: 100%;
  }

  .cookie-modal-header,
  .cookie-modal-footer {
    flex: 0 0 auto;
  }

  .cookie-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .cookie-modal-footer {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 479.98px) {
  .cookie-banner {
    padding-top: 0.875rem;
    padding-bottom: calc(0.875rem + env(safe-area-inset-bottom));
  }

  .cookie-banner-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .cookie-modal-header,
  .cookie-modal-body,
  .cookie-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
