.auth-page {
  --auth-bg: #f3f5f8;
  --auth-surface: #fff;
  --auth-ink: #1b2939;
  --auth-muted: #657385;
  --auth-line: #dce2e9;
  --auth-input: #f9fafb;
  --auth-action: #26374a;
  padding: 30px 20px 72px;
  background: var(--auth-bg);
}
.auth-layout {
  direction: rtl;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  width: min(880px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  background: var(--auth-surface);
  box-shadow: 0 12px 34px rgba(27,41,57,.045);
}
.auth-page--login .auth-layout { min-height: 490px; }
.auth-panel { display: flex; align-items: center; min-width: 0; }
.auth-panel__inner { width: 100%; padding: 36px clamp(26px, 4.2vw, 58px); }
.auth-page--register .auth-layout {
  display: flex;
  flex-direction: column;
  width: min(840px, 100%);
}
.auth-page--register .auth-panel__inner { padding: 28px clamp(24px, 5vw, 58px) 36px; }
.auth-page--register .auth-panel { order: 2; }
.auth-register-header { order: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 82px; padding: 16px clamp(24px, 5vw, 58px); background: #26374a; color: #fff; }
.auth-register-header__brand { font: 800 20px Manrope, sans-serif; direction: ltr; }
.auth-register-header__label { color: #becbd7; font-size: 12px; font-weight: 600; }
.auth-kicker { display: block; margin-bottom: 9px; color: var(--auth-muted); font: 700 10px Manrope, sans-serif; letter-spacing: .12em; direction: ltr; text-align: right; }
.auth-heading { margin: 0 0 4px; color: var(--auth-ink); font-size: clamp(25px, 2.6vw, 32px); line-height: 1.45; font-weight: 800; }
.auth-sub { margin: 0 0 24px; color: var(--auth-muted); font-size: 13px; line-height: 1.85; }
.auth-page--register .auth-sub { margin-bottom: 18px; }
.auth-form { width: 100%; }
.auth-field { min-width: 0; margin-bottom: 14px; }
.auth-field label, .auth-field__pw-row label { display: block; margin-bottom: 6px; color: var(--auth-ink); font-size: 12px; font-weight: 700; }
.auth-field input { display: block; width: 100%; height: 43px; padding: 0 13px; border: 1px solid var(--auth-line); border-radius: 7px; outline: 0; background: var(--auth-input); color: var(--auth-ink); font: 400 13px Vazirmatn, sans-serif; transition: border-color .18s, background .18s, box-shadow .18s; }
.auth-field input::placeholder { color: #9ba5b1; }
.auth-field input:focus { border-color: #718397; background: var(--auth-surface); box-shadow: 0 0 0 3px rgba(74,101,128,.12); }
.auth-field input.is-error { border-color: #cb636b; }
.auth-field input[type='email'], .auth-field input[type='tel'], .auth-field input[inputmode='numeric'] { direction: ltr; text-align: left; font-family: Manrope, Vazirmatn, sans-serif; }
.auth-field__pw-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-forgot, .auth-footer-link a { color: #38546e; font-size: 12px; font-weight: 700; }
.auth-forgot:hover, .auth-footer-link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 45px; margin-top: 18px; padding: 0 15px; border: 0; border-radius: 7px; background: var(--auth-action); color: #fff; font: 700 13px Vazirmatn, sans-serif; cursor: pointer; transition: background .2s, transform .2s; }
.auth-btn::after { content: '←'; font: 500 19px Manrope, sans-serif; line-height: 1; }
.auth-btn:hover { background: #3a5168; transform: translateY(-1px); }
.auth-btn:focus-visible, .auth-check:focus-within { outline: 3px solid rgba(74,101,128,.26); outline-offset: 2px; }
.auth-footer-link { display: flex; align-items: center; gap: 5px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--auth-line); color: var(--auth-muted); font-size: 12px; }
.auth-media { position: relative; min-height: 100%; overflow: hidden; background: #202d39; }
.auth-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% center; }
.auth-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,22,35,.1), rgba(10,22,35,.25)); }
.auth-media__top { position: absolute; z-index: 1; top: 20px; right: 22px; color: #fff; font: 700 14px Manrope, sans-serif; direction: ltr; }
.auth-media__bottom { display: none; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.auth-section-label { display: flex; align-items: center; gap: 12px; margin: 20px 0 12px; color: var(--auth-ink); font-size: 12px; font-weight: 800; }
.auth-section-label::after { content: ''; height: 1px; flex: 1; background: var(--auth-line); }
.auth-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 15px; }
.auth-check { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 11px; border: 1px solid var(--auth-line); border-radius: 7px; background: var(--auth-input); color: var(--auth-ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.auth-check:has(input:checked) { border-color: #7890a6; background: #edf2f6; }
.auth-check input { width: 15px; height: 15px; accent-color: #38546e; }
.auth-hint { margin-top: 4px; color: var(--auth-muted); font-size: 11px; }
.auth-company-fields[hidden] { display: none; }
.auth-field__errors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.auth-field__err, .auth-nonfield-errors { color: #a83743; font-size: 12px; line-height: 1.7; }
.auth-nonfield-errors { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border: 1px solid #eabec3; border-radius: 7px; background: #fff4f5; }
.auth-nonfield-errors svg { flex: none; margin-top: 2px; }
.auth-messages { position: fixed; z-index: 200; top: calc(var(--nav-h) + 20px); left: 50%; transform: translateX(-50%); width: min(400px,calc(100% - 32px)); }
.auth-msg { margin-bottom: 8px; padding: 10px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; box-shadow: 0 10px 24px rgba(12,24,41,.1); }
.auth-msg--error { background: #fff1f1; color: #9f2d38; }
.auth-msg--success { background: #e5f7ee; color: #18603c; }
.auth-msg--info { background: #edf2f6; color: #38546e; }
body:has(.auth-page) .nav__cta { background: #26374a; box-shadow: 0 8px 20px rgba(26,39,54,.18); }
body:has(.auth-page) .nav__cta:hover { background: #3a5168; }
:root[data-theme='dark'] .auth-page { --auth-bg: #111723; --auth-surface: #1a2330; --auth-ink: #eef1f4; --auth-muted: #abb8c6; --auth-line: #354354; --auth-input: #202c3a; --auth-action: #415a70; }
:root[data-theme='dark'] .auth-check:has(input:checked) { background: #28394a; border-color: #7993a8; }
:root[data-theme='dark'] .auth-forgot, :root[data-theme='dark'] .auth-footer-link a { color: #a9c4dc; }
:root[data-theme='dark'] body:has(.auth-page) .nav__cta { background: #415a70; }
:root[data-theme='dark'] .auth-field__err { color: #ffb9c1; }
:root[data-theme='dark'] .auth-nonfield-errors { background: #382a34; color: #ffb9c1; border-color: #77505a; }
@media (max-width: 700px) {
  .auth-page { padding: 18px 14px 48px; }
  .auth-page--login .auth-layout { grid-template-columns: 1fr; min-height: 0; }
  .auth-page--login .auth-media { order: -1; height: 130px; min-height: 0; }
  .auth-panel__inner, .auth-page--register .auth-panel__inner { padding: 25px 22px 30px; }
  .auth-register-header { min-height: 64px; }
  .auth-heading { font-size: 26px; }
}
@media (max-width: 460px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-checks { grid-template-columns: 1fr 1fr; gap: 6px; }
  .auth-check { font-size: 11px; padding-inline: 7px; }
  .auth-panel__inner, .auth-page--register .auth-panel__inner { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) { .auth-btn, .auth-field input { transition: none; } }
