/* مودال ورود — شیشه‌ای، وسط صفحه */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-auth-modal, 1200);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.auth-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 16, 0.45);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

.auth-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  box-shadow:
    0 24px 64px rgba(16, 32, 22, 0.22),
    0 0 0 1px rgba(129, 176, 97, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-modal.is-open .auth-modal-dialog {
  transform: translateY(0) scale(1);
}

.auth-modal-close {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-muted, #5c6560);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.auth-modal-close:hover {
  background: #fff;
  color: var(--text, #1a2420);
  transform: scale(1.05);
}

.auth-modal-inner {
  padding: 1.25rem 1.15rem 1.15rem;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.auth-modal-eyebrow {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text, #1a2420);
  text-align: center;
}

.auth-modal .auth-box {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.auth-modal .auth-form-title,
.auth-modal .auth-lead {
  display: none;
}

.auth-modal .auth-steps-viewport {
  min-height: 0;
  overflow: hidden;
}

.auth-modal .auth-mode-switch {
  margin-bottom: 0.9rem;
}

/* ورودی‌ها و برچسب‌ها — وسط‌چین در مودال */
.auth-modal .auth-field {
  text-align: center;
}

.auth-modal .auth-field__label {
  text-align: center;
  justify-self: center;
}

.auth-modal .auth-field__input {
  text-align: center;
}

.auth-modal .auth-password-field .auth-field__input--password {
  padding-inline: 3rem;
}

.auth-modal .auth-otp-hint,
.auth-modal .auth-otp-label,
.auth-modal .auth-step-switch,
.auth-modal .auth-resend-line {
  text-align: center;
}

.auth-modal .auth-form--otp .auth-otp-digit {
  flex: 0 0 2.85rem;
  width: 2.85rem;
  height: 3.2rem;
  font-size: 1.3rem;
  line-height: 3.2rem;
}

.auth-modal .auth-otp-row {
  gap: 0.45rem;
}

.auth-modal .auth-submit-btn {
  margin-top: 0.95rem;
}

.auth-modal .auth-submit-btn.is-loading {
  opacity: 0.62;
}

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

@media (max-width: 420px) {
  .auth-modal-dialog {
    border-radius: 18px;
  }

  .auth-modal-inner {
    padding: 1.15rem 1rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-modal-dialog {
    transition: none;
  }
}
