/* ==========================================================================
   Login Page — Factory ERP
   نکته: این فایل به static/css/tokens.css وابسته است؛
   حتماً tokens.css را قبل از این فایل لود کنید.
   ========================================================================== */

body.login-page {
  background-color: var(--paper-100);
}

/* ---------- صفحه‌ی معرفی (ویدیوی تمام‌صفحه‌ی بی‌صدا پیش از نمایش فرم ورود) ---------- */
.intro-screen {
  position: fixed;
  inset: 0;
  height: 100%;
  height: 100dvh;               /* ارتفاع واقعیِ نمای موبایل (با نوارابزار پویا) */
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #05070d;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.intro-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.intro-enter-btn {
  position: absolute;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  border: none;
  border-radius: 999px;
  padding: 15px 44px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.02rem;
  color: #ffffff;
  background: linear-gradient(180deg, #4a8ef2, var(--blue-500));
  box-shadow: 0 16px 44px -12px rgba(8, 14, 28, 0.7), 0 0 0 6px rgba(255, 255, 255, 0.10);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.intro-enter-btn:hover {
  filter: brightness(1.08);
}
.intro-enter-btn:active {
  transform: translateX(-50%) translateY(1px);
}
@media (max-width: 480px) {
  .intro-enter-btn {
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    padding: 13px 34px;
    font-size: 0.96rem;
  }
}

/* ---------- پس‌زمینه‌ی تمام‌صفحه: عکس تیره‌ی صنعتی با overlay ملایم ---------- */
.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px 0;
  background-image:
    linear-gradient(90deg, rgba(8, 14, 28, 0.55) 0%, rgba(8, 14, 28, 0.25) 45%, rgba(8, 14, 28, 0.65) 100%),
    url("../images/login-bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* نشانه‌های گونیا در گوشه‌ها (حس نقشه‌ی فنی) */
.corner-tick {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(122, 169, 255, 0.55);
  pointer-events: none;
}
.corner-tick--tl { top: 28px; right: 28px; border-left: none; border-bottom: none; }
.corner-tick--br { bottom: 28px; left: 28px; border-right: none; border-top: none; }

/* ---------- بدنه‌ی اصلی: کارت ورود، دقیقاً در مرکز صفحه ---------- */
.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 0 20px;
}

/* بلوک برند: لوگو + نام، دقیقاً بالای کارت */
.brand-mark {
  position: absolute;
  bottom: 100%;
  left: 20px;
  right: 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}
.brand-mark-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-name {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: 0.01em;
}
.brand-system-label {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.82rem;
  color: rgba(210, 224, 255, 0.85);
}

/* کارت شیشه‌ای فرم — تنها عنصرِ درون‌جریان، پس دقیقاً در مرکز صفحه می‌نشیند */
.login-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: 0 24px 60px -20px rgba(20, 26, 38, 0.35);
}

.login-card h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink-900);
}
.login-card .sub {
  font-size: 0.85rem;
  color: var(--steel-500);
  margin: 0 0 26px;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 8px;
}

.field-group {
  margin-bottom: 18px;
}

.form-control-dark {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(28, 37, 54, 0.14);
  color: var(--ink-900);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.form-control-dark::placeholder {
  color: var(--steel-300);
}
.form-control-dark:focus {
  outline: none;
  border-color: var(--blue-500);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(53, 118, 224, 0.20);
}

.password-field-wrap {
  position: relative;
}
.password-field-wrap .form-control-dark {
  padding-inline-end: 42px;
}
.password-toggle-btn {
  position: absolute;
  top: 50%;
  inset-inline-end: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 0;
  color: var(--steel-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn:hover {
  color: var(--ink-700);
}

.field-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px 0 20px;
}
.remember-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-700);
}
.remember-check input {
  accent-color: var(--blue-500);
}

.btn-signin {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  background: linear-gradient(180deg, #4a8ef2, var(--blue-500));
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn-signin:hover {
  filter: brightness(1.06);
}
.btn-signin:active {
  transform: translateY(1px);
}

.login-footnote {
  margin-top: 22px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--steel-500);
}

.form-error {
  background: rgba(214, 69, 69, 0.10);
  border: 1px solid rgba(214, 69, 69, 0.35);
  color: #a02f2f;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 18px;
}

/* ---------- ریسپانسیو ---------- */
/* چیدمان پایه (تک‌ستونه، عرض حداکثر ۳۸۰px، وسط‌چین) خودش واکنش‌گراست؛
   فقط روی صفحه‌های خیلی کوتاه، بلوکِ برند را کمی جمع‌تر می‌کنیم. */
@media (max-height: 620px) {
  .brand-mark {
    margin-bottom: 14px;
  }
  .brand-logo {
    width: 42px;
    height: 42px;
  }
}
