:root {
  color-scheme: light;
  --auth-brand-950: #2b0710;
  --auth-brand-900: #3a0915;
  --auth-brand-800: #510d1d;
  --auth-brand-700: #681126;
  --auth-brand-600: #82172f;
  --auth-brand-500: #9b2340;
  --auth-brand-100: #f7e9ed;
  --auth-brand-50: #fcf6f8;
  --auth-surface: #ffffff;
  --auth-bg: #f3f5f7;
  --auth-text: #181a1e;
  --auth-muted: #626a75;
  --auth-faint: #8a929d;
  --auth-line: rgba(28, 32, 38, .12);
  --auth-danger: #bd303b;
  --auth-success: #16794b;
  font-family: IRANSansX, Abar, Vazirmatn, Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body.login-page {
  margin: 0;
  min-height: 100dvh;
  color: var(--auth-text);
  background: var(--auth-bg);
  font-family: IRANSansX, Abar, Vazirmatn, Tahoma, sans-serif;
  overflow-x: hidden;
}
.hidden { display: none !important; }
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(430px, .88fr) minmax(520px, 1.12fr);
  direction: rtl;
  background: var(--auth-bg);
}
.login-panel {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
  padding: 44px clamp(32px, 5.2vw, 84px);
  background: var(--auth-surface);
  border-left: 1px solid var(--auth-line);
}
.login-brand {
  width: min(440px, 100%);
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.login-brand img { width: 94px; height: 62px; object-fit: contain; }
.login-brand div { display: grid; gap: 2px; }
.login-brand b { color: var(--auth-brand-700); font-size: 14px; font-weight: 700; }
.login-brand span { color: var(--auth-muted); font-size: 10.5px; }
.login-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 8px; }
.login-lock-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  color: var(--auth-brand-700);
  background: var(--auth-brand-50);
  border: 1px solid rgba(104, 17, 38, .13);
  border-radius: 12px;
}
.login-lock-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-card-head small { display: block; margin-bottom: 3px; color: var(--auth-muted); font-size: 10.5px; }
.login-card h1,
.login-card h2 { margin: 0; color: var(--auth-text); font-size: clamp(23px, 2.4vw, 29px); font-weight: 700; letter-spacing: -.02em; }
.login-help { min-height: 26px; margin: 8px 0 23px; color: var(--auth-muted); font-size: 12.5px; line-height: 1.8; }
.auth-field { display: grid; gap: 7px; margin: 0 0 15px; }
.auth-field > span { color: #353a42; font-size: 11.5px; font-weight: 600; }
.auth-control { position: relative; }
.auth-field input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  color: var(--auth-text);
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 11px;
  outline: 0;
  font: inherit;
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.auth-field input::placeholder { color: var(--auth-faint); }
.auth-field input:hover { border-color: rgba(28, 32, 38, .23); }
.auth-field input:focus { border-color: var(--auth-brand-600); box-shadow: 0 0 0 4px rgba(130, 23, 47, .1); }
.password-input input { padding-left: 52px; }
.password-input button {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 37px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--auth-muted);
  background: #f5f6f8;
  border: 1px solid rgba(28, 32, 38, .07);
  border-radius: 8px;
  cursor: pointer;
}
.password-input button:hover { color: var(--auth-brand-700); background: var(--auth-brand-50); }
.password-input button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.remember-row { min-height: 38px; display: flex; align-items: center; gap: 9px; margin: 1px 1px 15px; color: var(--auth-muted); font-size: 11.5px; cursor: pointer; }
.remember-row input { width: 17px; height: 17px; accent-color: var(--auth-brand-700); }
.caps-lock-note { min-height: 19px; margin: -8px 2px 9px; color: #94600b; font-size: 10.5px; opacity: 0; transition: opacity 150ms ease; }
.caps-lock-note.show { opacity: 1; }
.login-submit {
  position: relative;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: var(--auth-brand-700);
  border: 1px solid var(--auth-brand-700);
  border-radius: 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 9px 22px rgba(104, 17, 38, .16);
  transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.login-submit:hover:not(:disabled) { background: var(--auth-brand-600); transform: translateY(-1px); }
.login-submit:active:not(:disabled) { transform: none; }
.login-submit:disabled { opacity: .6; cursor: wait; transform: none; }
.login-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.login-submit.is-busy svg { animation: auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-message {
  min-height: 42px;
  margin-top: 13px;
  padding: 10px 11px;
  color: transparent;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.7;
}
.auth-message:not(:empty) { color: var(--auth-danger); background: #fff7f7; border-color: rgba(189, 48, 59, .15); }
.auth-message.success:not(:empty) { color: var(--auth-success); background: #f4fbf7; border-color: rgba(22, 121, 75, .16); }
.login-footer {
  width: min(440px, 100%);
  margin: 25px auto 0;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--auth-faint);
  border-top: 1px solid rgba(28, 32, 38, .07);
  font-size: 9.5px;
}
.login-visual {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 25%, rgba(155, 35, 64, .28), transparent 30%),
    linear-gradient(145deg, #21080e 0%, #380b16 44%, #5d1023 100%);
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, transparent, #000 28%, #000 100%);
}
.rail-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.rail-art path,
.rail-art line,
.rail-art polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rail-art .rail-base { stroke: rgba(255,255,255,.13); stroke-width: 1; }
.rail-art .rail-track { stroke: rgba(255,255,255,.34); stroke-width: 1.5; }
.rail-art .rail-accent { stroke: rgba(244, 157, 177, .74); stroke-width: 2; stroke-dasharray: 9 13; animation: rail-flow 18s linear infinite; }
.rail-art .rail-node { fill: #fff; stroke: rgba(255,255,255,.4); stroke-width: 5; transform-origin: center; animation: node-breathe 4s ease-in-out infinite; }
.rail-art .rail-node:nth-of-type(2n) { animation-delay: -1.7s; }
@keyframes rail-flow { to { stroke-dashoffset: -220; } }
@keyframes node-breathe { 50% { opacity: .45; } }
.visual-mark {
  position: absolute;
  right: clamp(35px, 6vw, 90px);
  bottom: clamp(42px, 8vh, 90px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,.78);
}
.visual-mark::before { content: ""; width: 42px; height: 1px; background: rgba(255,255,255,.42); }
.visual-mark span { font-size: 10px; letter-spacing: .08em; }
.auth-denied-page { display: grid; place-items: center; padding: 24px; background: var(--auth-bg); }
.access-denied-card { width: min(520px,100%); padding: 38px; text-align: center; background: #fff; border: 1px solid var(--auth-line); border-radius: 20px; box-shadow: 0 22px 60px rgba(28,32,38,.1); }
.access-denied-card img { width: 85px; }
.access-denied-card span { display: block; margin-top: 14px; color: var(--auth-brand-700); font-weight: 650; }
.access-denied-card h1 { font-size: 24px; }
.access-denied-card p { color: var(--auth-muted); line-height: 1.9; }
.access-denied-card .btn { display: inline-flex; margin-top: 13px; padding: 11px 19px; color: #fff; background: var(--auth-brand-700); border-radius: 10px; text-decoration: none; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus { -webkit-text-fill-color: var(--auth-text); caret-color: var(--auth-text); -webkit-box-shadow: 0 0 0 1000px #fff inset; transition: background-color 9999s ease-out 0s; }
:focus-visible { outline: 2px solid var(--auth-brand-600); outline-offset: 2px; }
@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { padding: 28px clamp(22px, 8vw, 72px); border-left: 0; }
}
@media (max-width: 520px) {
  .login-panel { justify-content: flex-start; padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
  .login-brand { margin-bottom: 36px; }
  .login-card h1, .login-card h2 { font-size: 24px; }
  .login-footer { flex-direction: column; align-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
