/**
 * MobileAuth — standalone full-screen login page (Digikala-inspired clean style).
 * @license https://opensource.org/licenses/AFL-3.0
 */
/* پالتِ صفحهٔ اصلیِ آروان دما (arvandama-home-redesign.scss) — صفحهٔ ورود
   قبلاً قرمزِ دیجی‌کالا داشت و کنارِ بقیهٔ سایت بیگانه بود. */
:root {
  --ma-accent: #a71f27;       /* $av-brand */
  --ma-accent-d: #8c1a21;     /* $av-brand-strong */
  --ma-accent-tint: #fbe9ea;  /* $av-brand-tint */
  --ma-ink: #22303f;          /* $av-ink */
  --ma-muted: #7a8496;        /* $av-muted */
  --ma-line: #e3e7ed;         /* $av-line */
  --ma-line-strong: #c4ccd6;  /* $av-line-card */
  --ma-bg: #f4f6f8;           /* $av-tile */
  --ma-ok: #188a4f;           /* $av-green */
  --ma-err: #e03131;          /* قرمزِ خطا جدا از قرمزِ برند بماند */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IRANYekanX", Tahoma, Arial, sans-serif;
  color: var(--ma-ink);
  background: var(--ma-bg);
}

.ma-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ma-card {
  position: relative;
  width: 100%;
  max-width: 384px;
  background: #fff;
  border: 1px solid var(--ma-line);
  border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 8px 40px rgba(34, 48, 63, 0.10);
  overflow: hidden;
  animation: ma-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ma-pop {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.ma-brand {
  text-align: center;
  margin-bottom: 24px;
}
.ma-logo { max-height: 52px; max-width: 70%; object-fit: contain; }
.ma-brand-name { font-weight: 700; font-size: 1.1rem; color: var(--ma-ink); }

.ma-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}
.ma-sub {
  margin: 0 0 20px;
  color: var(--ma-muted);
  font-size: 0.82rem;
}

.ma-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ma-line);
  border-radius: 10px;
  font-size: 0.98rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 14px;
  background: #f7f9fb;
}
.ma-input:focus {
  border-color: var(--ma-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(167, 31, 39, 0.14);
}

.ma-btn {
  width: 100%;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  background: var(--ma-accent);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
}
.ma-btn:hover { background: var(--ma-accent-d); }
.ma-btn:active { transform: scale(0.99); }
/* حالتِ «در حالِ انجام»: متنِ دکمه در JS عوض می‌شود و اینجا اسپینر می‌گیرد،
   تا کلیک‌خوردن قابلِ انکار نباشد. */
.ma-btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.ma-btn.is-loading::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ma-spin 0.7s linear infinite;
}
@keyframes ma-spin { to { transform: rotate(360deg); } }

/* پیامِ خنثای «در حال …» — نه سبزِ موفقیت، نه قرمزِ خطا */
.ma-msg.is-busy {
  background: #eef1f6;
  color: #55606f;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ma-msg.is-busy::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid #c3ccd8;
  border-top-color: #55606f;
  border-radius: 50%;
  animation: ma-spin 0.7s linear infinite;
}

/* مرحلهٔ کد: تا برگشتنِ پاسخ، خانه‌ها قفل و کم‌رنگ‌اند */
.ma-otp.is-busy { opacity: 0.55; pointer-events: none; }

.ma-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: 0;
  color: var(--ma-accent);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.ma-link:disabled { color: var(--ma-muted); cursor: default; }
.ma-back { color: var(--ma-muted); }

/* کپسولِ کم‌رنگ به‌جای لینکِ خالی: خودش را به‌عنوان «راهِ خروج» معرفی می‌کند
   ولی از دکمهٔ اصلیِ فرم وزنِ کمتری دارد. */
.ma-back-site {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px auto 0;
  padding: 9px 16px;
  border: 1px solid var(--ma-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ma-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ma-back-site__ic { width: 16px; height: 16px; flex: none; }
.ma-back-site__go {
  width: 13px;
  height: 13px;
  flex: none;
  opacity: 0.75;
  transition: transform 0.2s;
}
.ma-back-site:hover {
  color: var(--ma-accent);
  border-color: var(--ma-accent);
  background: var(--ma-accent-tint);
}
/* فلش در RTL به سمتِ چپ می‌رود، یعنی همان جهتِ «خروج از این صفحه» */
.ma-back-site:hover .ma-back-site__go { transform: translateX(-3px); }

/* جداکنندهٔ بالای دکمه روی خودِ ظرف می‌نشیند تا کپسول وسط بماند */
.ma-back-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ma-line);
  text-align: center;
}

.ma-msg {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
/* ‎.is-busy‎ زیر ‎display:flex‎ می‌گیرد و آن بر خاصیتِ ‎hidden‎ غلبه می‌کند؛
   بدونِ این قاعده پیامِ «در حال ارسال کد…» بعد از رسیدنِ کد هم می‌ماند. */
.ma-msg[hidden] { display: none !important; }
.ma-msg.is-error { background: #fdecec; color: var(--ma-err); }
.ma-msg.is-ok { background: #e8f5ee; color: var(--ma-ok); }

.ma-step { display: none; animation: ma-slide 0.3s ease; }
.ma-step.is-active { display: block; }
@keyframes ma-slide {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

/* OTP boxes */
.ma-otp {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-bottom: 16px;
}
.ma-otp input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid var(--ma-line);
  border-radius: 10px;
  outline: none;
  background: #f7f9fb;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ma-otp input:focus {
  border-color: var(--ma-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(167, 31, 39, 0.14);
}
.ma-otp input.is-filled { border-color: var(--ma-accent); background: #fff; }
.ma-otp.is-error input { border-color: var(--ma-err); }

.ma-shake { animation: ma-shake 0.4s; }
@keyframes ma-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

/* Success overlay */
.ma-success {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.ma-success.is-on { opacity: 1; pointer-events: auto; }
.ma-success p { font-weight: 700; font-size: 1.1rem; color: var(--ma-ok); margin: 0; }

.ma-check { width: 84px; height: 84px; }
.ma-check-circle {
  stroke: var(--ma-ok); stroke-width: 3;
  stroke-dasharray: 151; stroke-dashoffset: 151;
}
.ma-check-mark {
  stroke: var(--ma-ok); stroke-width: 4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
}
.ma-success.is-on .ma-check-circle { animation: ma-draw 0.5s ease forwards; }
.ma-success.is-on .ma-check-mark { animation: ma-draw 0.4s 0.45s ease forwards; }
@keyframes ma-draw { to { stroke-dashoffset: 0; } }

/* آروان‌دما: نوارِ زمینه وقتی کاربر از مسیرِ سبد/پرداخت به ورود آمده */
.ma-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--ma-line);
  border-radius: 10px;
  background: #f7f9fb;
  color: #3d4a5c;
  font-size: 0.82rem;
  line-height: 1.9;
  text-align: right;
}

.ma-context svg {
  flex: 0 0 auto;
  color: var(--ma-accent);
}

.ma-context strong {
  display: block;
  color: var(--ma-ink);
  font-weight: 700;
}
