/**
 * Age and cookie consent modal for the dev homepage.
 */

.age-consent,
.age-consent * {
  box-sizing: border-box;
}

body.age-consent-open {
  overflow: hidden !important;
}

body.age-consent-open > :not(#ageConsentModal) {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  overflow: hidden !important;
}

.age-consent[hidden] {
  display: none;
}

.age-consent {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  color: var(--ci-text-color, #000);
}

.age-consent__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(242, 90, 115, 0.8);
  background-color: rgba(18, 18, 18, 0.3);
  pointer-events: none;
}

.age-consent__panel {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: clamp(24px, 4vw, 38px);
  background-color: rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(8px);
  border: none !important;
}

.age-consent__panel:focus {
  outline: none;
  border: none !important;
}

.age-consent__title,
.age-consent__copy,
.age-consent__privacy p,
.age-consent__privacy h2,
.age-consent__privacy h3 {
  margin: 0;
}

.age-consent__title {
  margin-bottom: 14px;
  color: var(--ci-text-color, #000);
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1;
}

.age-consent__copy,
.age-consent__privacy p {
  font-size: 1rem;
  line-height: 1.5;
}

.age-consent__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.age-consent__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

.age-consent__input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--ci-text-color, #000);
  font: inherit;
  background-color: #fff;
  border: 2px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
}

.age-consent__input:focus {
  outline: none;
  border-color: var(--ci-background-color, #f25a73);
}

.age-consent__error {
  margin: 0;
  padding: 10px 12px;
  color: #b00028;
  font-size: 0.92rem;
  line-height: 1.35;
  background-color: rgba(176, 0, 40, 0.08);
  border-radius: 6px;
}

.age-consent__privacy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.16);
}

.age-consent__privacy h2,
.age-consent__privacy h3 {
  color: var(--ci-text-color, #000);
  font-size: 1.05rem;
  font-weight: 700;
}

.age-consent__check {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-size: 0.95rem;
  line-height: 1.35;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 6px;
  cursor: pointer;
}

.age-consent__check input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--ci-background-color, #f25a73);
}

.age-consent__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.age-consent__button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--ci-text-color, #000);
  font: inherit;
  font-weight: 700;
  background-color: var(--ci-highlight-color, #5aff15);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease;
}

.age-consent__button:hover {
  filter: brightness(0.96);
}

.age-consent__button:active {
  transform: scale(0.98);
}

.age-consent__reject {
  padding: 2px;
  color: #777;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: center;
  text-decoration: underline;
  background: transparent !important;
  
  border: 0;
  cursor: pointer;
}

.age-consent__reject:hover {
  color: #444;
}

.privacy-consent-trigger {
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  background: transparent;
  border: 0;
  cursor: pointer;
}

@media (max-width: 520px) {
  .age-consent {
    align-items: flex-end;
    padding: 12px;
  }

  .age-consent__panel {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 380px), (max-height: 620px) {
  .age-consent {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .age-consent__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-radius: 0;
    box-shadow: none;
  }

  .age-consent__title {
    margin-bottom: 10px;
    font-size: clamp(1.45rem, 9vw, 2rem);
  }

  .age-consent__copy,
  .age-consent__privacy p {
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .age-consent__form {
    gap: 12px;
    margin-top: 16px;
  }

  .age-consent__privacy {
    gap: 8px;
    padding-top: 12px;
  }

  .age-consent__privacy h2,
  .age-consent__privacy h3 {
    font-size: 0.98rem;
  }

  .age-consent__check,
  .age-consent__button {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .age-consent__reject,
  .age-consent__error {
    font-size: 0.84rem;
  }
}
