/* ==========================================================================
   ماژول استایل احراز هویت، ورود، ثبت‌نام، OTP، دانلود اپ و آنبوردینگ
   متناظر با packages/web/public/ui/authModal.js
   ========================================================================== */

/* ==========================================================================
   طراحی لاگین و ورود کد OTP — ترندهای UX/UI 2026 (Modern Velvet Glass)
   ========================================================================== */
.auth-modern-card {
  position: relative;
  background: #151926;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 38px 34px 34px;
  width: 440px;
  max-width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: authCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f2f3f6;
}

/* گروه‌بندی فیلدهای ورودی در فرم Onboarding */
.auth-input-group {
  text-align: right;
  margin-bottom: 14px;
}

.auth-input-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #a8adbd;
  margin-bottom: 6px;
}

.auth-text-input {
  width: 100%;
  background: #12151f;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-text-input:focus {
  border-color: var(--gold);
  background: #161a27;
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.2);
}

.auth-input-hint {
  font-size: 11px;
  color: #8b90a0;
  margin-top: 4px;
  display: block;
}

/* استایل‌های ویرایش مشخصات در پنل پروفایل من */
.mp-fields-box {
  background: #12151f;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px;
  margin: 14px 0;
  text-align: right;
}

.mp-field-row {
  margin-bottom: 10px;
}

.mp-field-row:last-child {
  margin-bottom: 0;
}

.mp-field-label {
  display: block;
  font-size: 12px;
  color: #8b90a0;
  margin-bottom: 4px;
  font-weight: 600;
}

.mp-field-input {
  width: 100%;
  background: #1c2030;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 8px 12px;
  color: #f2f3f6;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.mp-field-input:focus {
  border-color: #f4c542;
}

@keyframes authCardFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 99px;
  box-shadow: 0 0 14px rgba(244, 197, 66, 0.6);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 197, 66, 0.12);
  border: 1px solid rgba(244, 197, 66, 0.3);
  padding: 5px 16px;
  border-radius: 999px;
  color: var(--gold);
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: #f2f3f6;
  margin: 6px 0 6px;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  color: #8b90a0;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 24px;
}

/* ورودی کپسولی شماره موبایل */
.auth-phone-field {
  display: flex;
  align-items: center;
  direction: ltr;
  background: #12151f;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  transition: all 0.22s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25);
}

.auth-phone-field:focus-within {
  border-color: var(--gold);
  background: #161a27;
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.2), inset 0 2px 4px rgba(0,0,0,0.25);
}

.auth-phone-prefix {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8b90a0;
  font-size: 14px;
  font-weight: 700;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  user-select: none;
}

.auth-phone-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f2f3f6;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 12px 10px;
  text-align: left;
}

.auth-phone-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.04em;
  font-size: 14px;
  font-weight: 500;
}

/* دکمه ارسال مدرن با افکت بازتاب */
.auth-submit-btn {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: linear-gradient(160deg, #f9dd8a 0%, #f4c542 35%, #b8862a 100%);
  color: #241a04;
  box-shadow: 0 8px 22px rgba(184, 134, 42, 0.35);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  font-family: inherit;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(184, 134, 42, 0.45);
  filter: brightness(1.04);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── فیلدهای پشتِ‌سرِهمِ ورود/ثبت‌نام ── */
.auth-modern-card .auth-phone-field { margin-bottom: 10px; }
.auth-pass-field {
  position: relative;
  margin-bottom: 10px;
}
.auth-pass-field .auth-text-input {
  padding-inline-end: 44px;   /* جا برای دکمهٔ چشم */
  direction: ltr;
  text-align: left;
}
.auth-pass-field .auth-text-input::placeholder { text-align: right; direction: rtl; }
.auth-pass-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent; border: none;
  font-size: 15px; line-height: 1;
  opacity: 0.5; cursor: pointer;
  transition: opacity 0.15s ease;
}
.auth-pass-toggle:hover { opacity: 0.85; }
.auth-pass-toggle.on { opacity: 1; filter: drop-shadow(0 0 4px rgba(244, 197, 66, 0.5)); }

/* ردیفِ لینک‌های جابه‌جایی بینِ ورود/ثبت‌نام/بازیابی */
.auth-switch-row {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  margin-top: 16px;
}
.auth-link-btn {
  background: none; border: none;
  color: var(--gold);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; padding: 4px 2px;
  transition: opacity 0.15s ease;
}
.auth-link-btn:hover { opacity: 0.75; text-decoration: underline; }
.auth-feedback-msg .auth-link-btn { margin-top: 6px; display: inline-block; }

/* ───── دکمه‌های دانلودِ اپ (زیرِ کارتِ ورود) ───── */
.auth-stack { display: flex; flex-direction: column; align-items: center; width: 100%; }
.dl-platforms {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin: 18px auto 0; width: 440px; max-width: 100%;
  animation: authCardFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.dl-btn {
  flex: 1 1 190px;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: 12px;
  font-family: inherit; text-decoration: none; text-align: right;
  color: #e7e9f0; cursor: pointer;
  background: #1c2030;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.dl-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  background: #252b40;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.dl-btn:active:not(.disabled) { transform: translateY(0); }
.dl-btn svg {
  flex-shrink: 0; width: 26px; height: 26px; padding: 7px; box-sizing: content-box;
  border-radius: 12px; color: var(--gold);
  background: rgba(244, 197, 66, 0.1); border: 1px solid rgba(244, 197, 66, 0.25);
}
.dl-btn .dl-tt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.dl-btn .dl-tt b { font-size: 13px; font-weight: 700; color: #f2f3f6; }
.dl-btn .dl-tt i { font-size: 10.5px; font-style: normal; color: #8b90a0; }
.dl-btn.disabled { opacity: 0.5; cursor: default; }
.dl-btn.android .dl-tt i { color: var(--gold); opacity: 0.8; }
@media (max-width: 480px) {
  .dl-platforms { width: 100%; }
  .dl-btn { flex-basis: 100%; }
}

/* سلول‌های کد ۵ رقمی OTP (2026 PIN Cells) */
.otp-cells-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  direction: ltr;
  margin: 20px 0 16px;
}

.otp-digit-cell {
  width: 52px;
  height: 60px;
  background: #12151f;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.18s ease;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
}

.otp-digit-cell:focus {
  border-color: var(--gold);
  background: #161a27;
  box-shadow: 0 0 18px rgba(244, 197, 66, 0.35), inset 0 0 6px rgba(244, 197, 66, 0.15);
  transform: translateY(-2px);
}

.otp-digit-cell.filled {
  border-color: rgba(244, 197, 66, 0.5);
  color: var(--gold);
}

/* وضعیت خطای ارتعاشی */
.auth-shake {
  animation: hapticShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes hapticShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* جعبه وضعیت و تایمر معکوس */
.otp-meta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #12151f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 16px 0 10px;
  font-size: 13px;
}

.otp-timer-text {
  color: #8b90a0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.otp-timer-num {
  color: var(--gold);
  font-weight: 700;
  font-family: monospace, sans-serif;
  font-size: 14px;
}

.otp-resend-btn {
  background: transparent;
  border: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: opacity 0.15s;
  padding: 0;
}

.otp-resend-btn.disabled {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  pointer-events: none;
}

.auth-change-phone-btn {
  background: transparent;
  border: none;
  color: #79a38f;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  transition: color 0.15s;
}

.auth-change-phone-btn:hover {
  color: #bce3d0;
}

.auth-feedback-msg {
  font-size: 12.5px;
  margin-top: 12px;
  min-height: 18px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.auth-feedback-msg.error {
  color: #ff7a7a;
}
.auth-feedback-msg.success {
  color: #36d399;
}

/* لودر چرخشی مدرن */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(38, 26, 0, 0.3);
  border-top-color: #261a00;
  border-radius: 50%;
  animation: authSpin 0.6s linear infinite;
  display: inline-block;
}

@keyframes authSpin {
  to { transform: rotate(360deg); }
}
