/* ── صفحهٔ ورود / ثبت‌نام / کد یک‌بارمصرف ──────────────────────────────
   توکن‌ها همان‌های `home.css` و `landing.css`اند تا مسیرِ «صفحهٔ اول ← ورود ←
   داشبورد» یک محصول به نظر برسد.

   نکته‌ای که برنگردد: اینجا `@import` گوگل‌فونت بود. روی شبکهٔ ایران رندر را
   بلاک می‌کرد و بدتر اینکه فونتِ لاتین می‌آورد در حالی که کلِ متن فارسی است.
   فونت حالا خودمیزبان است (`/vendor/fonts.css`) و خانواده همان
   Vazir → Vazirmatn است.
   ── */

:root {
  color-scheme: light;
  --bg: #f5f6fb;
  --panel: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e8ebf2;
  --border-soft: #f1f3f9;
  --accent: #5b5bef;
  --accent-2: #8b5cf6;
  --accent-soft: #eef0ff;
  --danger: #dc2626;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .12);
}

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

body {
  font-family: "Vazir", "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  background:
    radial-gradient(1000px 460px at 80% -10%, #ede9fe 0%, rgba(237, 233, 254, 0) 60%),
    radial-gradient(800px 400px at 10% 0%, #e0f2fe 0%, rgba(224, 242, 254, 0) 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

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

.auth-back {
  align-self: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.auth-back:hover { background: var(--accent-soft); color: var(--accent); }

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px 26px;
}

/* ── سربرگ ─────────────────────────────────────────────────── */
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-logo {
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(91, 91, 239, .3);
}
.auth-logo svg { width: 26px; height: 26px; }
.auth-title { font-size: 19px; font-weight: 800; margin-bottom: 5px; }
.auth-sub { font-size: 13px; color: var(--muted); line-height: 1.9; }

/* ── تب‌ها ─────────────────────────────────────────────────── */
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #f4f6fb;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  border: 0;
  border-radius: 10px;
  padding: 9px 4px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.auth-tab:hover { color: var(--text-2); }
.auth-tab.is-on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ── پنل‌ها ────────────────────────────────────────────────── */
.auth-pane { display: none; }
.auth-pane.is-on { display: grid; gap: 13px; }

.auth-field { display: grid; gap: 6px; }
.auth-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.auth-req { color: var(--danger); }
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.auth-field input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 91, 239, .13);
}
.auth-field input:disabled { background: #f4f6fb; color: var(--faint); cursor: not-allowed; }
.auth-field input.is-bad { border-color: #fca5a5; background: #fff7f7; }

/* خانهٔ کد: درشت و با فاصلهٔ حرفی، تا شش رقم خوانا بماند. */
.auth-otp-input {
  text-align: center;
  letter-spacing: .5em;
  text-indent: .5em; /* جبرانِ فاصلهٔ آخر، وگرنه متن کمی چپ می‌افتد */
  font-size: 20px !important;
  font-weight: 700;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.auth-btn {
  width: 100%;
  padding: 12px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(91, 91, 239, .26);
  transition: filter .15s ease, transform .12s ease, box-shadow .15s ease;
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.06); }
.auth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.auth-link {
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--accent);
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-link:disabled { color: var(--faint); cursor: not-allowed; text-decoration: none; }

/* ── پیام‌ها ───────────────────────────────────────────────── */
.auth-msg {
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.95;
  margin-bottom: 13px;
}
.auth-msg.is-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.auth-msg.is-bad { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.auth-note {
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 2;
}

/* ── ورودِ جایگزین ─────────────────────────────────────────── */
.auth-alt { margin-top: 18px; }
.auth-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 14px;
}
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-google { display: flex; justify-content: center; }

.auth-foot { font-size: 12.5px; color: var(--muted); }

@media (max-width: 420px) {
  .auth-card { padding: 24px 18px 20px; }
  .auth-tab { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn, .auth-tab, .auth-back, .auth-field input { transition: none; }
}
