/* صفحات ورود — ریسپانسیو */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 80%, rgba(99, 102, 241, 0.15), transparent 55%),
              radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.12), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.auth-page--admin .auth-bg {
  background: radial-gradient(ellipse at 30% 70%, rgba(79, 70, 229, 0.2), transparent 55%),
              radial-gradient(ellipse at 70% 30%, rgba(139, 92, 246, 0.15), transparent 50%);
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.auth-logo .logo { justify-content: center; }
.auth-logo .logo-img--wordmark {
  height: 60px;
  max-width: min(320px, 94vw);
}
@media (min-width: 400px) {
  .auth-logo .logo-img--wordmark {
    height: 72px;
    max-width: 360px;
  }
}

.auth-card__foot {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.auth-card__enamad {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1rem;
}

.auth-card__enamad .footer-enamad {
  margin: 0;
  padding: 0;
  width: 100%;
  justify-content: center;
}

.auth-card__enamad .footer-enamad a {
  margin: 0 auto;
  max-width: min(150px, 42vw);
}

.auth-card__enamad .footer-enamad img {
  min-height: 0;
  max-height: 110px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  margin-bottom: 1rem;
}

.auth-page--admin .auth-badge {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
}

.auth-card h1 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.auth-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.auth-alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.auth-alert--info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.auth-alert--success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #16a34a;
}

.auth-form .form-group {
  margin-bottom: 1.1rem;
}

.auth-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.auth-form input[type="text"],
.auth-form input[type="tel"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-footer-link {
  text-align: center;
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--primary);
}

.auth-footer-link span {
  margin: 0 0.35rem;
  opacity: 0.5;
}

/* OTP — یک فیلد واحد (پایدار روی موبایل) */
.otp-single {
  width: 100%;
  padding: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5em;
  font-family: var(--font);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

.otp-single:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.otp-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

.auth-step { display: none; }
.auth-step.active { display: block; }
.auth-step[hidden] { display: none !important; }

.auth-panel.is-hidden {
  display: none !important;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.auth-tab {
  flex: 1;
  border: 2px solid transparent;
  background: transparent;
  padding: 0.7rem 0.5rem;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.auth-tab:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.06);
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.auth-panel .form-group,
.auth-step .form-group {
  margin-bottom: 1rem;
}

.auth-panel label,
.auth-step label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.auth-panel input[type="tel"],
.auth-panel input[type="password"],
.auth-panel input[type="text"],
.auth-step input[type="tel"],
.auth-step input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.15rem;
  }

  .auth-card h1 {
    font-size: 1.2rem;
  }

  .otp-single {
    font-size: 1.25rem;
    letter-spacing: 0.35em;
    padding: 0.85rem;
  }
}
