/* Auth modal styles ------------------------------------------------------- */
/* Подключается на всех страницах с всплывающими окнами регистрации/логина. */
.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(10px);
  z-index: 900;
}

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

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
}

.auth-modal__dialog {
  position: relative;
  width: min(880px, 100%);
  border-radius: 32px;
  padding: 3.25rem 3rem 3rem;
  background: radial-gradient(120% 160% at 100% 0%, rgba(99, 102, 241, 0.28), rgba(13, 18, 38, 0.95));
  box-shadow: 0 32px 72px rgba(8, 10, 24, 0.45);
  overflow: hidden;
}

.auth-modal__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8ff;
  font-size: 1.25rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-modal__close:hover,
.auth-modal__close:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 40px rgba(99, 102, 241, 0.35);
}

.auth-modal__content {
  display: grid;
  gap: 2rem;
}

.auth-modal__tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-modal__tab {
  border: none;
  background: transparent;
  color: rgba(226, 232, 255, 0.75);
  padding: 0.55rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-modal__tab.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(56, 189, 248, 0.6));
  color: #fff;
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.35);
}

.auth-modal__panel {
  display: grid;
  gap: 1.25rem;
  max-width: 520px;
}

.auth-modal__panel[hidden] {
  display: none;
}

.auth-modal__panel h2 {
  margin: 0;
  font-size: 1.75rem;
  color: #f8faff;
}

.auth-modal__hint {
  margin: 0;
  color: rgba(224, 231, 255, 0.8);
  line-height: 1.6;
}

.auth-modal__field {
  display: grid;
  gap: 0.45rem;
}

.auth-modal__field span {
  font-weight: 600;
  color: rgba(236, 239, 255, 0.92);
}

.auth-modal__field input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 255, 0.35);
  background: rgba(8, 13, 31, 0.78);
  padding: 0.85rem 1rem;
  color: #f8faff;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-modal__field input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: var(--field-shadow-focus);
  background: rgba(12, 16, 36, 0.9);
}

.auth-modal__meta {
  margin: 0;
  color: rgba(214, 220, 255, 0.75);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-modal__meta .btn--link {
  text-decoration: underline;
}

.auth-modal .form-feedback {
  margin: 0;
}

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

@media (max-width: 768px) {
  .auth-modal {
    padding: 1.5rem;
  }

  .auth-modal__dialog {
    padding: 2.75rem 2rem 2.25rem;
    border-radius: 26px;
  }

  .auth-modal__tabs {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .auth-modal__dialog {
    padding: 2.5rem 1.5rem 2rem;
  }

  .auth-modal__close {
    top: 1rem;
    right: 1rem;
  }

  .auth-modal__tabs {
    flex-direction: column;
    gap: 0.35rem;
  }

  .auth-modal__tab {
    width: 100%;
    text-align: center;
  }
}
