:root {
  color-scheme: light;
  --auth-primary: #2563eb;
  --auth-primary-hover: #1d4ed8;
  --auth-ink: #172033;
  --auth-muted: #667085;
  --auth-line: #d9e0e9;
  --auth-danger: #b42318;
}

* { box-sizing: border-box; }

.auth-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--auth-ink);
  background:
    radial-gradient(circle at 82% 18%, rgba(37, 99, 235, .12), transparent 28%),
    radial-gradient(circle at 13% 82%, rgba(14, 165, 233, .08), transparent 30%),
    linear-gradient(145deg, #f8fafc 0%, #eef3fa 100%);
  font-family: Vazirmatn, Tahoma, sans-serif;
}

.auth-page::before {
  position: fixed;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #172554, #2563eb 55%, #38bdf8);
  content: "";
}

.auth-language-switcher {
  position: fixed;
  z-index: 2;
  inset-block-start: 22px;
  inset-inline-end: 24px;
}

.auth-language-switcher .language-switcher {
  border-color: #d8dee8;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
}

.auth-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding: 84px 24px 42px;
}

.auth-panel { position: relative; width: min(100%, 430px); }
.auth-panel::before { position: absolute; z-index: -1; width: 280px; height: 280px; inset-block-start: -65px; inset-inline-end: -80px; border: 1px solid rgba(37,99,235,.08); border-radius: 50%; content: ""; }
.auth-panel--demo {
  display: grid;
  width: min(100%, 980px);
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.demo-credentials {
  max-height: 690px;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #dce2ea;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 65px rgba(15, 23, 42, .09);
}

.demo-credentials header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.demo-credentials h2 { margin: 2px 0 0; font-size: 1.08rem; font-weight: 850; }
.demo-credentials__eyebrow { color: #b54708; font-size: .68rem; font-weight: 800; }
.demo-credentials__password { padding: 7px 10px; border-radius: 8px; color: #175cd3; background: #eff6ff; font-size: .75rem; white-space: nowrap; }
.demo-credentials > p { margin: 10px 0 15px; color: var(--auth-muted); font-size: .75rem; }
.demo-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-account { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; border: 1px solid #e0e7f0; border-radius: 9px; color: #344054; background: #f9fafb; font: inherit; cursor: pointer; text-align: start; }
.demo-account:hover, .demo-account:focus-visible { border-color: #84adf4; outline: 0; color: #175cd3; background: #f3f7ff; }
.demo-account span { font-size: .72rem; font-weight: 750; }
.demo-account bdi { overflow: hidden; width: 100%; color: #667085; font: 600 .65rem ui-monospace, monospace; text-overflow: ellipsis; }

.auth-card {
  width: 100%;
  padding: 32px;
  border: 1px solid #dce2ea;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 65px rgba(15, 23, 42, .09);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #edf0f4;
}

.auth-brand > span {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #2563eb;
  font-size: 1rem;
}

.auth-brand > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.auth-brand strong { font-size: .93rem; font-weight: 850; }
.auth-brand small { color: #7a8799; font-size: .71rem; }

.auth-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  margin-bottom: 7px;
}

.auth-step-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #dbe8fb;
  border-radius: 50%;
  color: #2563eb;
  background: #f3f7ff;
  font-size: 1rem;
}

.auth-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.auth-step-label { color: #667085; font-size: .72rem; font-weight: 650; }

.auth-card h1 {
  margin: 0;
  color: #172033;
  font-size: 1.45rem;
  font-weight: 850;
  line-height: 1.45;
  letter-spacing: -.02em;
}

.auth-description {
  margin: 0 49px 23px 0;
  color: var(--auth-muted);
  font-size: .82rem;
  line-height: 1.8;
}

html[dir="ltr"] .auth-description { margin-right: 0; margin-left: 49px; }

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 17px;
  padding: 10px 12px;
  border: 1px solid #f5c7c3;
  border-radius: 10px;
  color: var(--auth-danger);
  background: #fff6f5;
  font-size: .77rem;
  line-height: 1.7;
}

.auth-alert--success { border-color: #a6dbc5; color: #176b4b; background: #f0fdf7; }
.auth-alert--info { border-color: #bfd5f5; color: #245b8f; background: #f3f7ff; }
.auth-field-error { display:flex;align-items:flex-start;gap:6px;color:var(--auth-danger);font-size:.71rem;line-height:1.65; }

.auth-form { display: grid; gap: 8px; }

.auth-form label {
  margin-top: 7px;
  color: #344054;
  font-size: .77rem;
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap > i {
  position: absolute;
  z-index: 1;
  inset-inline-start: 14px;
  color: #8895a7;
  font-size: .95rem;
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  height: 47px;
  padding: 10px 42px 10px 13px;
  border: 1px solid #cfd7e2;
  border-radius: 10px;
  outline: 0;
  color: var(--auth-ink);
  background: #fff;
  font: inherit;
  font-size: .84rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

html[dir="ltr"] .auth-input-wrap input { padding-right: 13px; padding-left: 42px; }
.auth-input-wrap input::placeholder { color: #9aa5b4; }
.auth-input-wrap input:focus { border-color: #6b9df2; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

.auth-password-toggle {
  position: absolute;
  inset-inline-end: 6px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #728095;
  background: transparent;
  cursor: pointer;
}

.auth-password-toggle:hover { color: #2563eb; background: #f0f5ff; }

.auth-otp-input input {
  padding: 10px 13px;
  direction: ltr;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .45em;
  text-align: center;
}

.auth-form > small { color: var(--auth-muted); font-size: .7rem; line-height: 1.65; }

.auth-primary {
  display: flex;
  width: 100%;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--auth-primary);
  font: inherit;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.auth-primary:hover { background: var(--auth-primary-hover); box-shadow: 0 6px 15px rgba(37, 99, 235, .18); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 22px 0 15px;
  color: #98a2b3;
  font-size: .68rem;
}

.auth-divider::before,
.auth-divider::after { height: 1px; flex: 1; background: #eaecf0; content: ""; }

.auth-otp-request button {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d0d7e2;
  border-radius: 10px;
  color: #344054;
  background: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.auth-otp-request button:hover { border-color: #aebaca; background: #f9fafb; }

.auth-policy-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 9px 2px 0;
  color: #8994a5;
  font-size: .65rem;
  line-height: 1.65;
}

.auth-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 17px;
}

.auth-secondary-actions form { margin: 0; }

.auth-secondary-actions button,
.auth-secondary-actions a {
  border: 0;
  color: #52657c;
  background: transparent;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.auth-secondary-actions button:hover,
.auth-secondary-actions a:hover { color: #2563eb; }
.auth-secondary-actions button:disabled { color: #8b99aa; cursor: wait; opacity: .72; }

.auth-resend-status {
  margin: 10px 0 0;
  color: #6b7c91;
  font-size: .69rem;
  line-height: 1.75;
  text-align: center;
}

.auth-resend-status strong { color: #245b8f; font-variant-numeric: tabular-nums; }

.auth-trust-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 25px;
  padding-top: 17px;
  border-top: 1px solid #edf0f4;
  color: #7c899a;
  font-size: .68rem;
}

.auth-trust-note i { color: #3b7a62; }

.auth-primary:focus-visible,
.auth-password-toggle:focus-visible,
.auth-otp-request button:focus-visible,
.auth-secondary-actions button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .18);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .auth-language-switcher { inset-block-start: 14px; inset-inline-end: 14px; }
  .auth-shell { align-items: start; padding: 76px 14px 24px; }
  .auth-card { padding: 25px 21px; border-radius: 14px; }
  .auth-brand { margin-bottom: 25px; }
  .auth-card h1 { font-size: 1.3rem; }
  .auth-description { margin-inline-start: 0; margin-inline-end: 0; }
}

@media (max-width: 860px) {
  .auth-panel--demo { grid-template-columns: 1fr; }
  .auth-panel::before { display: none; }
  .demo-account-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
