/* ====================================================================
   assets/css/login.css — ورژن ۷
   - پیش‌فرض: ورود با رمز عبور
   - لودینگ نرم با اسپینر در تمام دکمه‌ها
   - فرم set-phone و فرم پروفایل با همین تم
   ==================================================================== */
:root{
  --hm-brand:#ef4056;
  --hm-brand-hov:#d9334a;
  --hm-brand-soft:rgba(239,64,86,.08);
  --hm-bg:#f0f0f1;
  --hm-card:#ffffff;
  --hm-text:#1a1a1a;
  --hm-muted:#6b6b6b;
  --hm-border:#e6e6e8;
  --hm-input-bg:#f7f7f7;
  --hm-success:#1cae7b;
  --hm-ok-bg:rgba(28,174,123,.10);
  --hm-radius:10px;
  --hm-shadow:0 8px 32px rgba(15,17,21,.06);
}

body, .hm-login-v4 { font-family: 'Vazirmatn','IRANSans','Tahoma',sans-serif; }

.hm-login-v4{
  direction: rtl;
  background: var(--hm-bg);
  min-height: calc(100vh - 200px);
  padding: 56px 16px;
  display: flex; align-items: center;
}
.hm-login-shell{ max-width: 420px; width: 100%; margin: 0 auto; }

.hm-brand{
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-bottom: 22px; text-decoration: none;
}
.hm-brand img{ height: 48px; width: auto; }
.hm-brand span{
  font-size: 15px; font-weight: 700;
  color: var(--hm-brand); letter-spacing: .3px;
}

.hm-card{
  background: var(--hm-card);
  border-radius: 14px;
  box-shadow: var(--hm-shadow);
  padding: 26px 26px 22px;
  animation: hmFade .25s ease;
}
@keyframes hmFade{ from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:none;} }

.hm-head h1{
  font-size: 19px; font-weight: 700;
  margin: 0 0 6px; color: var(--hm-text); text-align: center;
}
.hm-head p{
  font-size: 13px; line-height: 1.9;
  color: var(--hm-muted); text-align: center; margin: 0 0 18px;
}

.hm-field{ margin-bottom: 14px; }
.hm-field label{
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--hm-text); margin-bottom: 6px;
}
.hm-input{
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--hm-input-bg);
  border: 1px solid var(--hm-border);
  border-radius: var(--hm-radius);
  font-size: 14px; color: var(--hm-text);
  font-family: inherit; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.hm-input::placeholder{ color: var(--hm-soft); font-size: 13px; }
.hm-input:focus{
  outline: none; background: #fff;
  border-color: var(--hm-brand);
  box-shadow: 0 0 0 3px var(--hm-brand-soft);
}

.hm-btn{
  position: relative;
  width: 100%; height: 46px;
  background: var(--hm-brand); color: #fff;
  border: 0; border-radius: var(--hm-radius);
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .05s, box-shadow .15s, opacity .15s;
  margin-top: 6px;
}
.hm-btn:hover:not(:disabled){ background: var(--hm-brand-hov); }
.hm-btn:active{ transform: scale(.99); }
.hm-btn:focus{ outline: none; box-shadow: 0 0 0 3px rgba(239,64,86,.25); }
.hm-btn:disabled{ opacity:.8; cursor: not-allowed; }

.hm-btn.is-loading .hm-btn-label{ opacity: 0; }
.hm-btn.is-loading .hm-spinner{
  display: block;
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  margin-top: -11px; margin-left: -11px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color:#fff;
  border-radius: 50%;
  animation: hmSpin .8s linear infinite;
}
@keyframes hmSpin{ to{ transform: rotate(360deg); } }

/* دکمه‌های ثانویه (مثل ارسال کد در پروفایل) */
.hm-btn-secondary{
  background: transparent; color: var(--hm-brand); border:1px solid var(--hm-brand);
}
.hm-btn-secondary:hover:not(:disabled){ background: var(--hm-brand-soft); color: var(--hm-brand-hov); border-color: var(--hm-brand-hov); }

/* روی لینک‌های متنی هم اسپینر هنگام ارسال مجدد بیاید */
.hm-link.is-loading{ opacity:.6; pointer-events: none; }

.hm-alert{
  background: #fff0f1; border: 1px solid #f5c2c7; color: #b02a37;
  border-radius: var(--hm-radius);
  padding: 10px 14px; font-size: 13px; margin: 0 0 14px;
}
.hm-alert-success{ background: var(--hm-ok-bg); border-color: rgba(28,174,123,.30); color:#0f7a55; }

.hm-row{ display:flex; justify-content:space-between; align-items:center; margin:-2px 0 14px; }
.hm-check{
  display: inline-flex !important; align-items: center; gap: 6px;
  font-size: 12.5px !important; color: var(--hm-muted) !important;
  margin: 0 !important; cursor: pointer; font-weight: 400 !important;
}
.hm-check input{ width:16px; height:16px; accent-color: var(--hm-brand); cursor: pointer; }

.hm-link{
  color: var(--hm-brand); text-decoration: none;
  font-size: 12.5px; font-weight: 600;
}
.hm-link:hover{ color: var(--hm-brand-hov); text-decoration: underline; }

.hm-hint{ text-align: center; font-size: 12.5px; color: var(--hm-muted); margin: 0 0 14px; }
.hm-hint b{ color: var(--hm-text); font-weight: 600; }

.hm-otp{
  display:flex; gap:6px; direction: ltr;
  justify-content:center; margin: 4px 0 16px;
}
.hm-otp-cell{
  width: 40px; height: 48px; text-align: center;
  font-size: 20px; font-weight: 700; color: var(--hm-text);
  background: var(--hm-input-bg);
  border: 1px solid var(--hm-border);
  border-radius: 8px; font-family: inherit;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.hm-otp-cell:focus{
  outline:none; background:#fff; border-color: var(--hm-brand);
  box-shadow: 0 0 0 3px var(--hm-brand-soft);
}
.hm-otp-cell.filled{ background:#fff; border-color: var(--hm-brand); }

.hm-foot-row{
  display:flex; justify-content:space-between; align-items:center;
  font-size: 12.5px; color: var(--hm-soft); margin-top: 12px;
}
.hm-timer b{ color: var(--hm-text); }

.hm-text-btn{
  display:block; margin: 10px auto 0;
  background:transparent; border:0;
  color: var(--hm-muted); font-family: inherit; font-size: 12.5px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.hm-text-btn:hover{ color: var(--hm-brand); }

.hm-divider{
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 10px;
  color: var(--hm-soft); font-size: 12px;
}
.hm-divider::before, .hm-divider::after{
  content:''; flex:1; height:1px; background: var(--hm-border);
}
.hm-divider span{ background: var(--hm-card); padding: 0 6px; color: var(--hm-soft); }

.hm-mode-switch{
  display: block; width: 100%;
  background: transparent; border: 1px solid var(--hm-border);
  color: var(--hm-brand);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 10px 14px; border-radius: var(--hm-radius);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.hm-mode-switch:hover{
  color: var(--hm-brand-hov); border-color: var(--hm-brand-hov);
  background: var(--hm-brand-soft);
}

.hm-switcher{
  text-align: center;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--hm-border);
  font-size: 13px;
  display:flex; justify-content:center; align-items:center; gap:8px; flex-wrap:wrap;
}
.hm-switcher a{ color: var(--hm-brand); text-decoration: none; font-weight:600; }
.hm-switcher a:hover{ color: var(--hm-brand-hov); text-decoration: underline; }

.hm-toast{
  position: fixed;
  inset: auto 16px 16px auto;
  background:#fff; border-right:4px solid var(--hm-brand);
  border-radius: var(--hm-radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.20);
  padding: 12px 18px; font-size: 13.5px; color: var(--hm-text);
  max-width: 360px;
  opacity:0; transform: translateY(20px);
  transition: opacity .2s, transform .2s;
  z-index: 10000; direction: rtl;
}
.hm-toast.show{ opacity:1; transform: translateY(0); }
.hm-toast.success{ border-right-color: var(--hm-success); background: var(--hm-ok-bg); color:#0f7a55; }

/* ---------- صفحهٔ set-phone ---------- */
.hm-phone-setup{
  max-width: 420px; margin: 56px auto 0;
  background: #fff;
  padding: 26px 26px 22px;
  border-radius: 14px;
  box-shadow: var(--hm-shadow);
  direction: rtl;
}
.hm-phone-setup .hm-head h1{ font-size: 19px; }
.hm-phone-setup .hm-head p{ font-size: 13px; }
#hm-phone-setup-messages{ margin-bottom: 8px; }

/* ---------- پروفایل EDD (override) ---------- */
.hm-profile-edit{
padding: 26px 26px 22px;
  direction: rtl;
}
.hm-profile-edit .hm-head{ margin-bottom: 18px; }
.hm-profile-edit fieldset{
  border:1px solid var(--hm-border);
  border-radius: var(--hm-radius);
  padding: 16px 16px 4px;
  margin: 0 0 14px;
}
.hm-profile-edit legend{
  padding: 0 8px; font-size: 13px; font-weight: 700;
  color: var(--hm-text);
}
.hm-profile-edit p{ margin: 0 0 14px; }
.hm-profile-edit label{
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--hm-text); margin-bottom: 6px;
}
.hm-profile-phone__hint{
  font-size: 12px; color: var(--hm-muted); line-height: 1.8;
  margin: 0 0 12px;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 480px){
  .hm-login-v4{ padding: 32px 12px; }
  .hm-card{ padding: 22px 18px 18px; border-radius: 12px; }
  .hm-otp-cell{ width: 36px; height: 44px; font-size: 18px; }
  .hm-toast{ inset: auto 10px 10px auto; max-width: calc(100% - 20px); font-size: 13px; }
  .hm-profile-edit{ margin: 16px 12px 0; padding: 22px 18px 18px; }
}
