/* ============================================================
   GSP — فرم ورود/ثبت‌نام با موبایل (مطابق فیگما)
   ============================================================ */
.gsp-auth {
  font-family: YekanBakh, Vazirmatn, sans-serif;
  direction: rtl;
  display: flex;
  justify-content: center;
  width: 100%;
}

.gsp-auth-card {
  background: #f4f5f7;
  border-radius: 22px;
  padding: 34px 32px 30px;
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  text-align: center;
}

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

.gsp-auth-logo { margin-bottom: 18px; }
.gsp-auth-logo img { max-height: 70px; width: auto; }

.gsp-auth-title {
  font-size: 26px;
  font-weight: 700;
  color: #2a2f3a;
  margin: 0 0 26px;
}

.gsp-auth-label {
  display: block;
  text-align: right;
  font-size: 15px;
  color: #2a2f3a;
  margin: 0 0 10px;
}
.gsp-auth-label span { color: #e84545; }

/* اینپوت‌ها */
.gsp-auth-input-wrap { position: relative; }
.gsp-auth-input {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1.5px solid #e1e3e8;
  border-radius: 12px;
  padding: 16px 18px;
  font-family: inherit;
  font-size: 16px;
  color: #1a1f2e;
  text-align: right;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.gsp-auth-input::placeholder { color: #9ca3af; letter-spacing: 1px; }
.gsp-auth-input:focus {
  border-color: #386af6;
  box-shadow: 0 0 0 3px rgba(56, 106, 246, 0.12);
}
.gsp-auth-code { text-align: center; letter-spacing: 8px; font-size: 20px; transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s; }

/* کد صحیح: حالت سبز + ضربان ملایم */
.gsp-auth-code.gsp-code-success {
  border-color: #16a34a;
  background-color: rgba(22, 163, 74, 0.06);
  color: #15803d;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
  animation: gsp-code-pulse 0.55s ease;
}
.gsp-auth-code.gsp-code-success:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

/* کد اشتباه: حالت قرمز + لرزش */
.gsp-auth-code.gsp-code-error {
  border-color: #e84545;
  background-color: rgba(232, 69, 69, 0.05);
  animation: gsp-code-shake 0.4s ease;
}

@keyframes gsp-code-pulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes gsp-code-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.gsp-auth-clear {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
p.gsp-auth-timer.gsp-f-timer {
  margin-top: 12px !important;
}
p.gsp-auth-msg.hint {
  margin-top: 12px !important;
}
/* مرا به خاطر بسپار */
.gsp-auth-remember {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 14px 2px 0;
  font-size: 14px;
  color: #2a2f3a;
  cursor: pointer;
}
.gsp-auth-remember input { width: 18px; height: 18px; accent-color: #386af6; }

/* دکمه اصلی */
.gsp-auth-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  background: #3457f5;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.18s ease, opacity 0.18s ease;
}
.gsp-auth-btn:hover { background: #2745d8; }
.gsp-auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.gsp-auth-btn-ghost {
  display: inline-block;
  background: #fff;
  color: #374151;
  border: 1.5px solid #d9dde4;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 26px;
  cursor: pointer;
  text-decoration: none;
}
.gsp-auth-btn-ghost:hover { background: #f3f4f6; }

/* تایمر و پیام‌ها */
.gsp-auth-timer { font-size: 14px; color: #6b7280; margin: 16px 0 0; }
.gsp-auth-resend { margin: 10px 0 0; }
.gsp-auth-resend button {
  background: none; border: none; color: #386af6;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.gsp-auth-msg { font-size: 13px; margin: 12px 0 0; min-height: 18px; }
.gsp-auth-msg.error { color: #e84545; }
.gsp-auth-msg.success { color: #16a34a; }
.gsp-auth-msg.hint { color: #386af6; }

.gsp-auth-intro { font-size: 15px; color: #2a2f3a; line-height: 2; margin: 0 0 22px; }

/* مرحله خوش‌آمد */
.gsp-auth-welcome { }
.gsp-auth-brand { font-size: 26px; font-weight: 800; margin: 6px 0 2px; color: #2a2f3a; }
.gsp-auth-brand-sub { font-size: 14px; color: #6b7280; margin: 0 0 18px; }
.gsp-auth-check { margin: 8px 0 18px; }
.gsp-auth-welcome-text { font-size: 18px; font-weight: 700; color: #2a2f3a; margin: 0 0 22px; }
.gsp-auth-welcome-actions { display: flex; gap: 12px; justify-content: center; }
.gsp-auth-welcome-actions .gsp-auth-btn { width: auto; margin-top: 0; padding: 13px 28px; }

.gsp-auth-loggedin p { font-size: 16px; margin: 0 0 18px; }

@media (max-width: 480px) {
  .gsp-auth-card { padding: 26px 20px 24px; }
  .gsp-auth-title { font-size: 22px; }
}

/* ─── مودال سراسری لاگین ─── */
.gsp-auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: gsp-auth-fade 0.2s ease;
}
.gsp-auth-modal-overlay[hidden] { display: none !important; }
@keyframes gsp-auth-fade { from { opacity: 0; } to { opacity: 1; } }
.gsp-auth-modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;
  animation: gsp-auth-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gsp-auth-pop { from { opacity: 0; transform: scale(0.94) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.gsp-auth-modal-box .gsp-auth-card { box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.gsp-auth-modal-close {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.gsp-auth-modal-close:hover { color: #374151; }
