/* ── ورود / ثبت‌نام با شماره موبایل ── */

.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 16px 64px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 8px 30px rgba(27, 36, 48, 0.07);
  text-align: center;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: #1b2430;
  margin: 0 0 8px;
}

.auth-sub {
  font-size: 14px;
  line-height: 2;
  color: #5a6b7b;
  margin: 0 0 24px;
}

.auth-phone {
  color: #1b2430;
  letter-spacing: 0.5px;
  direction: ltr;
  display: inline-block;
}

.auth-change-form {
  display: inline;
}

/* دکمه است نه لینک (سشن را پاک می‌کند، پس POST)؛ اما باید مثل لینک دیده شود */
.auth-change {
  display: inline-block;
  margin-inline-start: 6px;
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.auth-error {
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: #a02525;
  font-size: 13px;
  line-height: 1.9;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  text-align: right;
}

.auth-label {
  display: block;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #3a4756;
  margin-bottom: 8px;
}

.auth-input {
  width: 100%;
  height: 48px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  color: #1b2430;
  background: #fbfcfd;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary--30);
}

.auth-input--phone {
  direction: ltr;
  text-align: center;
  letter-spacing: 2px;
  font-weight: 600;
}

/* ── خانه‌های کد ── */
/* اینپوت نامرئی فقط روی خودِ خانه‌ها می‌افتد (نه کل فرم) تا دکمه ارسال آزاد بماند */
.auth-code-field {
  position: relative;
  margin-bottom: 4px;
}

.auth-code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 16px; /* جلوگیری از زوم خودکار سافاری موبایل */
}

.auth-code-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  direction: ltr;
}

.auth-code-box {
  width: 46px;
  height: 54px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  background: #fbfcfd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #1b2430;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-code-box.is-filled {
  background: #fff;
  border-color: var(--color-primary--10);
}

.auth-code-box.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary--30);
  background: #fff;
}

/* ── دکمه‌ها ── */
.auth-btn {
  width: 100%;
  height: 48px;
  margin-top: 20px;
  border: 0;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-btn:hover { background: var(--color-primary--90); }
.auth-btn:active { background: var(--color-primary); }

.auth-resend {
  margin-top: 18px;
}

.auth-link-btn {
  background: none;
  border: 0;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 6px;
}

.auth-link-btn:disabled {
  color: #9aa4b1;
  cursor: default;
}

/* :not([hidden]) لازم است: هر قاعده display در استایل‌شیتِ خودِ سایت بر
   [hidden] در استایل‌شیت مرورگر غلبه می‌کند، پس بدون این، timer.hidden = true
   در auth.js هیچ اثری ندارد و شمارنده بعد از تمام‌شدن روی صفحه می‌ماند. */
.auth-resend-timer:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-resend-bar {
  width: 140px;
  height: 4px;
  border-radius: 2px;
  background: #e6e8ef;
  overflow: hidden;
}

.auth-resend-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--color-primary);
  transition: width 1s linear;
}

.auth-resend-text {
  margin: 0;
  font-size: 13px;
  color: #8b96a3;
}

.auth-resend-text strong {
  color: #5a6b7b;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

.auth-note {
  margin: 22px 0 0;
  font-size: 12px;
  line-height: 2;
  color: #8b96a3;
}

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

@media (max-width: 420px) {
  .auth-card { padding: 26px 18px; }
  .auth-code-box { width: 40px; height: 48px; font-size: 19px; }
  .auth-code-boxes { gap: 6px; }
}
