/* Shared auth / digit-input styles — Login page */

/* ---------- باکسِ واحدِ شمارهٔ موبایل (جادار و خوانا، به‌جای ۱۰ خانهٔ جدا) ---------- */
.phone-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  direction: ltr;
  margin-top: 6px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.phone-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: #fff;
}

.phone-field.error {
  border-color: var(--danger);
  background: #fff;
}

.phone-prefix {
  flex: 0 0 auto;
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1;
  user-select: none;
}

.phone-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  padding: 0;
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 4px;
  caret-color: var(--brand);
}

.phone-input::placeholder {
  color: #b6bdc6;
  font-weight: 600;
  letter-spacing: 2px;
}

.digit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 1.4vw, 7px);
  direction: ltr;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}

.digit-row--phone {
  margin-top: 6px;
}

.digit-prefix {
  flex-shrink: 0;
  font-size: clamp(16px, 4.5vw, 19px);
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1;
  user-select: none;
  margin-inline-end: 2px;
}

/* خانه‌های کادردار و واضح؛ با flex سهمِ مساوی از عرض می‌گیرند تا همیشه جا شوند و وسط بمانند */
.digit-cell {
  flex: 1 1 0;
  min-width: 0;
  max-width: 34px;
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  text-align: center;
  font-size: clamp(15px, 4.2vw, 19px);
  font-weight: 700;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  padding: 0;
  caret-color: var(--brand);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.digit-cell:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: #fff;
}

.digit-cell.filled {
  border-color: #b9cdc4;
  background: #fff;
}

.digit-cell.error {
  border-color: var(--danger);
}

.digit-row--captcha {
  justify-content: center;
  gap: clamp(12px, 5vw, 20px);
}

/* خانه‌های کدِ امنیتی فقط خطِّ زیر دارند (بدون کادرِ کامل) و رقم روی خط می‌نشیند */
.digit-row--captcha .digit-cell {
  flex: 0 0 auto;
  width: clamp(34px, 9vw, 40px);
  height: 44px;
  border: 0;
  border-bottom: 2.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: clamp(18px, 5vw, 22px);
}

.digit-row--captcha .digit-cell:focus {
  border-bottom-color: var(--brand);
  box-shadow: none;
  background: transparent;
}

.digit-row--captcha .digit-cell.filled {
  border-bottom-color: #b9cdc4;
  background: transparent;
}

.digit-row--captcha .digit-cell.error {
  border-bottom-color: var(--danger);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  width: 100%;
  min-width: 0;
}

.captcha-img-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #eef0ec;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.captcha-img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.captcha-refresh {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink-soft);
  flex: 0 0 auto;
  transition: transform .25s, border-color .15s;
}

.captcha-refresh:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.captcha-refresh.spin {
  transform: rotate(180deg);
}

.captcha-digit-label {
  margin-top: 16px;
}

.field-hint.captcha-hint {
  margin-top: 8px;
  min-height: 18px;
}

.field-hint.captcha-hint.error {
  color: var(--danger);
  font-weight: 600;
}

/* ---------- ریسپانسیو: روی صفحه‌های کوچک فاصله‌ها و اندازه‌ها کمی فشرده می‌شوند ---------- */
@media (max-width: 420px) {
  .digit-row--captcha {
    gap: clamp(14px, 7vw, 22px);
  }

  .digit-row--captcha .digit-cell {
    width: clamp(32px, 9vw, 40px);
    height: 44px;
  }

  .captcha-img-wrap {
    height: 48px;
  }

  .captcha-refresh {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 330px) {
  .digit-row--captcha .digit-cell {
    width: 30px;
    height: 42px;
    font-size: 16px;
  }
}
