/* ============================================================
   auth.css — استایل مشترک صفحات ورود و ثبت‌نام (هماهنگ با landing)
   برند: #084B5E  | فونت: IRANYekanXVF
   ============================================================ */

:root {
  --brand: #084B5E;
  --brand-2: #2590B8;
  --brand-soft: rgba(8, 75, 94, 0.06);
  --accent: #F2A466;
  --ink: #0F172A;
  --muted: #5B6B73;
  --bg: #FBFCFD;
  --border: rgba(8, 75, 94, 0.12);
  --error: #ef4444;
  --shadow: 0 24px 70px rgba(8, 75, 94, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.auth-page {
  font-family: 'IRANYekanXVF', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(37,144,184,0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(242,164,102,0.10), transparent 55%),
    var(--bg);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  gap: 22px;
}

/* ---- Brand ---- */
.auth-brand { display: flex; justify-content: center; }
.auth-logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.auth-logo img { width: 40px; height: 40px; object-fit: contain; }
.auth-logo strong { display: block; font-size: 20px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.auth-logo span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---- Card ---- */
.auth-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
  animation: authIn .35s ease;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

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

.auth-card-head { margin-bottom: 22px; text-align: center; }
.auth-card-head h1 { font-size: 23px; font-weight: 800; color: var(--ink); }
.auth-card-head p { margin-top: 9px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.auth-card-head strong { color: var(--brand); font-weight: 700; }

.auth-otp-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

/* ---- Form ---- */
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.auth-field > span i { color: var(--error); font-style: normal; }

.auth-field input {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 12px 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input::placeholder { color: #aab6bb; }
.auth-field input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37,144,184,.12); }
.auth-field input[dir="ltr"] { letter-spacing: .5px; }

/* حالت خطا (JS کلاس .error را روی input می‌گذارد) */
.auth-field input.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.auth-field input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }

/* پیشوند @ نام کاربری */
.auth-input-prefix { position: relative; }
.auth-input-prefix .prefix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 700; color: #aab6bb; pointer-events: none;
}
.auth-input-prefix input { padding-right: 34px; }

/* خطاها — JS با .hidden یا متن خالی کنترل می‌کند */
.auth-error { font-size: 12.5px; color: var(--error); line-height: 1.6; }
.auth-error:empty { display: none; }
.auth-error.hidden { display: none; }

/* ---- Buttons ---- */
.auth-submit {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 13px;
  padding: 14px;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 8px 22px rgba(8,75,94,.20);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px;
}
.auth-submit:hover { background: #0a5a70; transform: translateY(-1px); }
.auth-submit:active { transform: scale(.99); }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.auth-back {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  cursor: pointer;
  transition: .15s;
  margin-top: 10px;
}
.auth-back:hover { background: var(--brand-soft); color: var(--brand); }

/* ---- Alt / terms links ---- */
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.auth-alt a { color: var(--brand); font-weight: 700; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-terms { text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---- OTP digits ---- */
.otp-inputs { display: flex; gap: 9px; justify-content: center; }
.otp-inputs input {
  width: 46px; height: 54px; text-align: center;
  font-family: inherit; font-size: 20px; font-weight: 700; color: var(--ink);
  background: #fff; border: 1.5px solid var(--border); border-radius: 13px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp-inputs input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37,144,184,.12); }
/* کلاس‌هایی که JS اضافه می‌کند */
.otp-inputs input.is-filled,
.otp-inputs input.filled { border-color: var(--brand); background: var(--brand-soft); }
.otp-inputs input.error-state { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.otp-form.has-error .otp-inputs input { border-color: var(--error); }

/* ---- OTP heading (صفحه ورود) ---- */
.otp-heading { text-align: center; margin-bottom: 18px; display: flex; flex-direction: column; gap: 5px; }
.otp-heading > span { font-size: 12.5px; color: var(--muted); }
.otp-heading strong { font-size: 18px; font-weight: 800; color: var(--ink); }
.otp-heading small { font-size: 12.5px; color: var(--muted); }

/* فرم otp ورود وقتی hidden است */
.otp-form[hidden] { display: none; }

/* جابه‌جایی مرحله‌ای صفحهٔ ورود:
   login.js کلاس .is-otp را روی پنل و aria-hidden را روی فرم‌ها می‌گذارد. */
.login-panel.is-otp .phone-form { display: none; }
.auth-form[aria-hidden="true"] { display: none; }

@media (max-width: 440px) {
  .auth-card { padding: 24px 20px; border-radius: 20px; }
  .otp-inputs input { width: 42px; height: 50px; font-size: 18px; }
}
