/*
 * Auth required modal — guest gate
 */

.auth-required-modal__dialog {
  max-width: 360px;
  padding: var(--space-32) var(--space-24) var(--space-24);
  border-radius: 16px;
  text-align: center;
  box-shadow:
    0 24px 48px rgb(44 48 56 / 16%),
    0 8px 16px rgb(44 48 56 / 8%);
  animation: auth-required-in 0.22s ease-out;
}

.auth-required-modal.is-open .popup__backdrop {
  animation: auth-required-backdrop-in 0.22s ease-out;
}

.auth-required-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-meta);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-required-modal__close:hover {
  color: var(--color-text);
  background: #f0f1f5;
}

.auth-required-modal__close:focus-visible {
  outline: 2px solid rgb(16 139 136 / 35%);
  outline-offset: 2px;
}

.auth-required-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-16);
  border-radius: 50%;
  background: #e8faf3;
  color: var(--color-button);
}

.auth-required-modal__title {
  margin: 0 0 var(--space-8);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

.auth-required-modal__text {
  margin: 0 0 var(--space-24);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-meta);
}

.auth-required-modal__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  width: 100%;
}

.auth-required-modal__btn {
  width: 100%;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-required-modal__btn.btn--secondary {
  border: 1px solid var(--color-button);
  background: #ffffff;
  color: var(--color-button);
}

.auth-required-modal__btn.btn--secondary:hover {
  background: rgb(16 139 136 / 6%);
}

@keyframes auth-required-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes auth-required-backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body.auth-required-open {
  overflow: hidden;
}

body.auth-required-open .popup__backdrop {
  backdrop-filter: blur(2px);
}

/* Hide controls marked for authenticated users only */
body.is-guest .auth-only,
body[data-authenticated="false"] .auth-only {
  display: none !important;
}
