/* ═══════════════════════════════════════════════════════════════
   MyOstad — Auth Page Styles v3.1
   صفحه ورود / ثبت‌نام — بهینه‌شده برای روانشناسی فروش و اعتماد
   ═══════════════════════════════════════════════════════════════ */

/* ── Auth Shell ─────────────────────────────────────────────── */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--navy-950);
  position: relative;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Decorative Background ──────────────────────────────────── */
.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.auth-bg-orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle,
    rgba(37,99,235,0.22) 0%,
    rgba(37,99,235,0.06) 60%,
    transparent 100%);
  top: -180px; right: -130px;
  animation: float 9s ease-in-out infinite;
}

.auth-bg-orb-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle,
    rgba(212,160,23,0.16) 0%,
    rgba(212,160,23,0.04) 60%,
    transparent 100%);
  bottom: -120px; left: -100px;
  animation: float 11s ease-in-out infinite reverse;
}

.auth-bg-orb-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle,
    rgba(6,182,212,0.1) 0%,
    transparent 70%);
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  animation: float 7s ease-in-out infinite 1.5s;
}

/* Geometric grid overlay */
.auth-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black, transparent);
}

/* ── Auth Header ────────────────────────────────────────────── */
.auth-header {
  width: 100%;
  max-width: var(--max-app);
  padding: max(var(--sp-8), env(safe-area-inset-top)) var(--sp-6) var(--sp-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ── Logo Mark ──────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.auth-logo-mark {
  width: 80px; height: 80px;
  background: linear-gradient(145deg, #3b82f6 0%, #1e3a8a 100%);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 36px rgba(37,99,235,0.42),
    0 2px 8px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.15);
  position: relative;
  animation: pulse-blue 2.8s ease-out infinite;
}

.auth-logo-mark svg { width: 42px; height: 42px; }

.auth-logo-name {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.72) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  line-height: 1;
  text-align: center;
}

.auth-logo-tagline {
  font-size: 0.8125rem;
  color: var(--gold-400);
  margin-top: 3px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
}

/* ── Trust Row ──────────────────────────────────────────────── */
.auth-trust-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: center;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.52);
}

.trust-item svg {
  width: 14px; height: 14px;
  color: var(--gold-400);
  flex-shrink: 0;
}

.trust-dot {
  width: 3px; height: 3px;
  background: var(--border-mid);
  border-radius: 50%;
}

/* ── Stats Row ──────────────────────────────────────────────── */
.auth-stats {
  display: flex;
  gap: var(--sp-3);
  width: 100%;
  max-width: var(--max-app);
  padding: 0 var(--sp-5);
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-4);
}

.stat-pill {
  flex: 1;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-3);
  text-align: center;
  transition: all var(--dur-mid) var(--ease-out);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-pill::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,160,23,0.35), transparent);
}

.stat-pill:hover {
  background: var(--surface-2);
  border-color: var(--border-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-size: 1.25rem;
  font-weight: 900;
  color: white;
  line-height: 1.2;
  display: block;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.45);
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

/* ── Auth Card ──────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: var(--max-app);
  padding: 0 var(--sp-5);
  position: relative;
  z-index: 1;
  flex: 1;
}

.auth-card-inner {
  background: rgba(8, 20, 40, 0.88);
  backdrop-filter: blur(32px) saturate(1.3);
  -webkit-backdrop-filter: blur(32px) saturate(1.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow:
    var(--shadow-xl),
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset;
}

/* ── Auth Tab Switcher ──────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: var(--surface-0);
  border-radius: var(--r-full);
  padding: 4px;
  margin-bottom: var(--sp-6);
  border: 1px solid var(--border-subtle);
}

.auth-tab-btn {
  flex: 1;
  height: 40px;
  border: none;
  background: none;
  border-radius: var(--r-full);
  font-family: var(--font-fa);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all var(--dur-mid) var(--ease-out);
}

.auth-tab-btn.active {
  background: linear-gradient(145deg, var(--navy-500), var(--navy-700));
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37,99,235,0.4);
}

/* ── Auth Panels ────────────────────────────────────────────── */
.auth-panel {
  display: none;
  flex-direction: column;
  gap: var(--sp-4);
  animation: fade-up var(--dur-mid) var(--ease-out);
}

.auth-panel.active { display: flex; }

/* ── OTP Panel ──────────────────────────────────────────────── */
.otp-panel { text-align: center; }

.otp-icon-wrap {
  width: 72px; height: 72px;
  background: linear-gradient(145deg, rgba(37,99,235,0.2), rgba(212,160,23,0.1));
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-4);
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

.otp-sent-info {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  line-height: 1.5;
}

.otp-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.45);
  margin-top: var(--sp-3);
}

.otp-timer-count {
  font-weight: 800;
  color: var(--gold-400);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  min-width: 3.5ch;
  display: inline-block;
  text-align: center;
}

.otp-resend-btn {
  background: none;
  border: none;
  color: var(--navy-400);
  font-family: var(--font-fa);
  font-size: 0.875rem;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--dur-fast);
}

.otp-resend-btn:hover { color: var(--navy-300); }

.otp-resend-btn:disabled {
  color: rgba(255,255,255,0.28);
  text-decoration: none;
  cursor: default;
}

/* ── Role Selection ─────────────────────────────────────────── */
.auth-role-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.auth-role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3);
  background: var(--surface-1);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--dur-mid) var(--ease-spring);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-role-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gold-glow);
  opacity: 0;
  transition: opacity var(--dur-mid);
}

.auth-role-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.auth-role-card.selected {
  border-color: var(--gold-400);
  background: rgba(212,160,23,0.06);
  box-shadow: 0 0 0 4px var(--gold-glow);
  transform: translateY(-2px);
}

.auth-role-card.selected::before { opacity: 1; }

.auth-role-card__icon {
  width: 50px; height: 50px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.625rem;
  transition: transform var(--dur-mid) var(--ease-spring);
  position: relative;
  z-index: 1;
}

.auth-role-card.selected .auth-role-card__icon { transform: scale(1.12) rotate(-3deg); }

.auth-role-card--student .auth-role-card__icon { background: rgba(37,99,235,0.14); }
.auth-role-card--teacher .auth-role-card__icon { background: rgba(212,160,23,0.14); }
.auth-role-card--general .auth-role-card__icon { background: rgba(16,185,129,0.14); }

.auth-role-card__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
}

.auth-role-card__desc {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.42);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

/* Selected checkmark */
.role-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px; height: 20px;
  background: var(--gold-400);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--dur-mid) var(--ease-spring);
}

.auth-role-card.selected .role-check {
  opacity: 1;
  transform: scale(1);
}

/* ── Social Proof Footer ────────────────────────────────────── */
.auth-proof {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  width: 100%;
  max-width: var(--max-app);
  position: relative;
  z-index: 1;
}

.proof-avatars { display: flex; }
.proof-avatars .avatar {
  margin-left: -10px;
  border: 2px solid var(--navy-900);
  box-shadow: 0 0 0 1px var(--border-subtle);
}
.proof-avatars .avatar:first-child { margin-left: 0; }

.proof-text {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.52);
  line-height: 1.5;
}
.proof-text strong { color: white; font-weight: 700; }

/* Stars rating */
.proof-stars {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.proof-stars span {
  font-size: 0.75rem;
  color: var(--gold-400);
}

/* ── Guest Bar ──────────────────────────────────────────────── */
.auth-guest-bar {
  width: 100%;
  max-width: var(--max-app);
  padding: var(--sp-4) var(--sp-6) max(var(--sp-8), env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
  text-align: center;
}

.guest-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  transition: all var(--dur-fast) var(--ease-out);
  border: 1px solid transparent;
}

.guest-cta:hover {
  color: rgba(255,255,255,0.65);
  border-color: var(--border-subtle);
  background: var(--surface-0);
}

.guest-cta strong { color: var(--navy-400); font-weight: 700; }

/* ── Helper — Password toggle ───────────────────────────────── */
.pass-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.38);
  padding: 4px;
  border-radius: var(--r-sm);
  transition: color var(--dur-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pass-toggle:hover { color: rgba(255,255,255,0.75); }

/* ── Forgot Password Link ───────────────────────────────────── */
.forgot-link {
  background: none;
  border: none;
  color: var(--navy-400);
  font-family: var(--font-fa);
  font-size: 0.8125rem;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
  text-decoration: none;
  transition: color var(--dur-fast);
}
.forgot-link:hover { color: var(--navy-300); }

/* ── Terms text ─────────────────────────────────────────────── */
.terms-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.32);
  text-align: center;
  line-height: 1.6;
  margin-top: var(--sp-3);
}
.terms-text a { color: var(--navy-400); font-weight: 600; }

/* ── Mobile input (LTR but RTL layout) ─────────────────────── */
.input-mobile {
  text-align: right;
  direction: ltr;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* ── Credential info card ───────────────────────────────────── */
.info-card {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

.info-card-icon {
  width: 32px; height: 32px;
  background: rgba(212,160,23,0.12);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
/* ═══════════════════════════════════════════════════════════════
   mo-auth-input — فیلدهای ورودی صفحه احراز هویت (modal)
   ═══════════════════════════════════════════════════════════════ */

/* Wrapper برای فیلد موبایل (پرچم + input) */
.mo-auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.mo-auth-input-wrap:focus-within {
  border-color: rgba(59,130,246,0.70);
  background: rgba(59,130,246,0.07);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

/* پرچم / prefix */
.mo-auth-input-flag {
  padding: 0 14px 0 10px;
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  border-left: 1.5px solid rgba(255,255,255,0.10);
  height: 100%;
  display: flex;
  align-items: center;
  min-width: 50px;
  justify-content: center;
}

/* فیلد ورودی اصلی */
.mo-auth-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 15px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: #fff;
  direction: ltr;
  text-align: left;
}

.mo-auth-input::placeholder {
  color: rgba(255,255,255,0.30);
  font-size: 0.9375rem;
}

/* فیلد standalone (بدون wrapper) */
.mo-auth-field {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 1rem;
  font-family: inherit;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.mo-auth-field::placeholder { color: rgba(255,255,255,0.30); }

.mo-auth-field:focus {
  border-color: rgba(59,130,246,0.70);
  background: rgba(59,130,246,0.07);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

/* فرم-گروه (label + input) */
.mo-auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mo-auth-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  padding-right: 4px;
}

/* خطا */
.mo-auth-field-error {
  font-size: 0.8125rem;
  color: var(--danger, #f87171);
  padding-right: 4px;
  display: none;
}
.mo-auth-field-error.is-visible { display: block; }

/* فیلد با direction فارسی */
.mo-auth-input[dir="rtl"],
.mo-auth-field[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Light mode */
[data-theme="light"] .mo-auth-input-wrap {
  background: rgba(15,32,68,0.05);
  border-color: rgba(15,32,68,0.15);
}
[data-theme="light"] .mo-auth-input-wrap:focus-within {
  border-color: rgba(37,99,235,0.60);
  background: rgba(37,99,235,0.05);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
[data-theme="light"] .mo-auth-input-flag {
  border-left-color: rgba(15,32,68,0.12);
}
[data-theme="light"] .mo-auth-input {
  color: rgba(10,22,50,0.92);
}
[data-theme="light"] .mo-auth-input::placeholder { color: rgba(10,22,50,0.35); }
[data-theme="light"] .mo-auth-field {
  background: rgba(15,32,68,0.05);
  border-color: rgba(15,32,68,0.15);
  color: rgba(10,22,50,0.92);
}
[data-theme="light"] .mo-auth-field::placeholder { color: rgba(10,22,50,0.35); }
[data-theme="light"] .mo-auth-field:focus {
  border-color: rgba(37,99,235,0.60);
  background: rgba(37,99,235,0.04);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
[data-theme="light"] .mo-auth-form-label { color: rgba(10,22,50,0.75); }

/* Auth modal sheet در light mode */
[data-theme="light"] .mo-auth-modal__sheet {
  background: rgba(240,245,255,0.98);
  border-color: rgba(15,32,68,0.10);
}
[data-theme="light"] .auth-shell {
  background: #f0f5ff;
}
