/* Split login / signup — professional Lottie + form card */
:root {
  --auth-blue: #2563eb;
  --auth-blue-dk: #1d4ed8;
  --auth-navy: #0f2744;
  --auth-red: #ef5350;
  --auth-bg: #c9daf8;
  --auth-field: #f4f8fd;
  --auth-border: #d7e4f4;
  --auth-label: #1e3a5f;
  --auth-muted: #5b7390;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--auth-navy);
  background: #eef3fb;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 1.12fr) minmax(440px, 0.88fr);
  background: #eef3fb;
}
.auth-art {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 78% 58% at 48% 38%, rgba(37,99,235,.18), transparent 64%),
    linear-gradient(165deg, #dbeafe 0%, #e8f1fb 42%, #cfe0f6 100%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 28px 48px;
}
.auth-art::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  top: -90px;
  right: -80px;
  pointer-events: none;
}
.auth-art::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(37,99,235,.08);
  bottom: -70px;
  left: -40px;
  pointer-events: none;
}
.auth-art img, .auth-art .hero-photo { display: none !important; }
.auth-lottie,
.auth-art .rz-lottie,
.auth-art .rz-lottie-hero {
  position: relative;
  z-index: 1;
  width: min(92%, 560px) !important;
  height: min(68vh, 540px) !important;
  max-width: 100%;
  margin: 0 auto;
  opacity: 1;
  filter: none;
}
.auth-art-kicker {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--auth-blue);
}
.auth-art-copy {
  position: relative;
  z-index: 1;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--auth-navy);
  text-align: center;
  max-width: 360px;
  line-height: 1.4;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 40px;
  background:
    linear-gradient(180deg, #f7faff 0%, #eef3fb 100%);
}
.auth-inner { width: 100%; max-width: 460px; }
.auth-card {
  background: #fff;
  border: 1px solid rgba(37,99,235,.1);
  border-radius: 18px;
  padding: 36px 34px 32px;
  box-shadow:
    0 1px 2px rgba(15,39,68,.04),
    0 18px 48px rgba(15,39,68,.12);
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  text-decoration: none;
  color: inherit;
}
.auth-logo-fav {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(37,99,235,.18);
}
.auth-logo-rez { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: #111; }
.auth-logo-sms { font-size: 24px; font-weight: 800; letter-spacing: -.5px; color: var(--auth-blue); }
.auth-tag { display: none; }
.auth-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--auth-navy);
  margin-bottom: 8px;
  letter-spacing: -0.6px;
  line-height: 1.15;
}
.auth-sub {
  font-size: 15px;
  font-weight: 500;
  color: var(--auth-muted);
  margin-bottom: 26px;
  line-height: 1.5;
}
.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--auth-label);
  margin-bottom: 7px;
}
.auth-field input, .auth-field select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: var(--auth-field);
  font-size: 15px;
  font-family: inherit;
  color: var(--auth-navy);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.auth-field input:focus, .auth-field select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37,99,235,.14);
  background: #fff;
}
.auth-math {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}
.auth-math .q {
  font-size: 15px;
  font-weight: 700;
  color: var(--auth-label);
  padding-bottom: 12px;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--auth-muted);
  margin: 0 0 18px;
  cursor: pointer;
  user-select: none;
}
.auth-remember input { width: 16px; height: 16px; accent-color: var(--auth-blue); }
.auth-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 10px;
  background: var(--auth-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37,99,235,.28);
  letter-spacing: -.1px;
}
.auth-btn:hover:not(:disabled) { background: var(--auth-blue-dk); }
.auth-btn:disabled { opacity: .7; cursor: wait; box-shadow: none; }
.auth-alert {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
}
.auth-alert.show, .auth-alert[style*="block"] { display: block; }
.auth-alert.err { background: #fdecea; color: #b42318; }
.auth-alert.ok { background: #ecfdf3; color: #067647; }
.auth-foot {
  margin-top: 20px;
  font-size: 14px;
  color: var(--auth-muted);
  text-align: center;
}
.auth-foot a { color: var(--auth-blue); font-weight: 700; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }
.auth-refresh {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15,39,68,.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-blue);
  z-index: 20;
}
.auth-refresh:hover { background: #f8fafc; }
.auth-refresh svg { width: 26px; height: 26px; }

.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-row .auth-field { margin-bottom: 18px; }
.role-toggle { display: flex; border: 1px solid var(--auth-border); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.role-toggle input { display: none; }
.role-toggle label {
  flex: 1; text-align: center; padding: 11px 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--auth-muted); background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.role-toggle label svg { width: 16px; height: 16px; }
.role-toggle input:checked + label { background: var(--auth-blue); color: #fff; }

.auth-input-wrap { position: relative; }
.auth-input-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--auth-muted); padding: 4px; line-height: 1;
}
.pw-toggle:hover { color: var(--auth-blue); }
.pw-toggle svg { width: 18px; height: 18px; display: block; }
.field-status {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 700;
}
.field-status.ok { color: #16a34a; }
.field-status.err { color: #dc2626; }

.pw-strength { display: flex; gap: 4px; align-items: center; margin: -8px 0 16px; }
.pw-bar { height: 3px; flex: 1; border-radius: 2px; background: #e2e8f0; }
.pw-label { font-size: 11px; color: var(--auth-muted); min-width: 42px; }

.captcha-wrap {
  background: var(--auth-field);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}
.captcha-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--auth-label);
  margin-bottom: 10px;
}
.captcha-row { display: flex; align-items: center; gap: 12px; }
.captcha-img-wrap {
  position: relative; border-radius: 6px; overflow: hidden; background: #fff; flex-shrink: 0;
}
#captcha-img { display: block; width: 180px; height: 54px; }
.captcha-reload {
  position: absolute; bottom: 4px; right: 4px;
  background: var(--auth-blue); border: none; border-radius: 4px;
  padding: 3px 6px; cursor: pointer; color: #fff; font-size: 11px; font-weight: 700;
}
#captcha-code {
  flex: 1; height: 46px; border: none; border-radius: 6px;
  padding: 0 12px; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  text-align: center; background: #fff; color: var(--auth-navy); outline: none;
  text-transform: uppercase; min-width: 0; font-family: inherit;
}
#captcha-code:focus { box-shadow: 0 0 0 2px rgba(37,99,235,.28); }

.step { display: none; }
.step.active { display: block; }
.step-dots { display: flex; gap: 8px; margin-bottom: 18px; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.step-dot.active { background: var(--auth-blue); width: 22px; border-radius: 4px; }
.step-dot.done { background: #22c55e; }

.otp-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #eef4fb; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.otp-icon svg { width: 30px; height: 30px; fill: var(--auth-blue); }
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0 10px; }
.otp-inputs input {
  width: 48px; height: 56px; border: none; border-radius: 8px;
  text-align: center; font-size: 22px; font-weight: 800; color: var(--auth-navy);
  background: var(--auth-field); outline: none;
}
.otp-inputs input:focus { box-shadow: 0 0 0 2px rgba(37,99,235,.28); background: #f7fbff; }
.otp-timer { text-align: center; font-size: 13px; color: var(--auth-muted); margin-bottom: 6px; }
.otp-timer span { color: var(--auth-blue); font-weight: 600; }
.resend-wrap { text-align: center; margin-bottom: 18px; }
.resend-btn {
  background: none; border: none; color: var(--auth-blue); font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; text-decoration: underline; padding: 0;
}
.resend-btn:disabled { color: var(--auth-muted); text-decoration: none; cursor: not-allowed; }
.auth-back {
  display: block; margin: 14px auto 0; background: none; border: none;
  color: var(--auth-muted); font-size: 13px; cursor: pointer; font-family: inherit;
}

.auth-panel.signup { align-items: flex-start; padding-top: 28px; padding-bottom: 56px; overflow-y: auto; }
.auth-panel.signup .auth-card { margin: 8px 0 24px; }

@media (max-width: 1100px) {
  .auth-shell { grid-template-columns: minmax(340px, 1fr) minmax(400px, 480px); }
  .auth-lottie,
  .auth-art .rz-lottie,
  .auth-art .rz-lottie-hero {
    width: min(94%, 440px) !important;
    height: min(58vh, 440px) !important;
  }
}

.auth-hint {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--auth-muted);
  text-align: center;
}
.auth-math label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--auth-label);
  margin-bottom: 6px;
}
.auth-field input,
.auth-math input {
  font-size: 16px; /* prevents iOS zoom on focus */
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}
.auth-btn { min-height: 52px; touch-action: manipulation; }
.auth-remember { user-select: none; -webkit-tap-highlight-color: transparent; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel {
    padding: max(16px, env(safe-area-inset-top)) 16px max(88px, env(safe-area-inset-bottom));
    min-height: 100dvh;
    align-items: flex-start;
  }
  .auth-inner { max-width: 100%; padding-top: 12px; }
  .auth-card {
    padding: 22px 18px 20px;
    border-radius: 16px;
    box-shadow:
      0 1px 2px rgba(15,39,68,.05),
      0 12px 32px rgba(15,39,68,.1);
  }
  .auth-logo { margin-bottom: 18px; }
  .auth-logo-fav { width: 40px; height: 40px; }
  .auth-tag { font-size: 12px; }
  .auth-title { font-size: 24px; letter-spacing: -.02em; margin-bottom: 6px; }
  .auth-sub { font-size: 14px; margin-bottom: 20px; line-height: 1.45; }
  .auth-field { margin-bottom: 14px; }
  .auth-field label { font-size: 12.5px; margin-bottom: 6px; }
  .auth-field input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 16px;
  }
  .auth-math {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--auth-field);
    border-radius: 12px;
  }
  .auth-math .q {
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--auth-navy);
  }
  .auth-math input {
    height: 50px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: .04em;
  }
  .auth-remember {
    margin: 4px 0 16px;
    font-size: 13.5px;
    gap: 10px;
  }
  .auth-remember input { width: 18px; height: 18px; }
  .auth-btn {
    height: 52px;
    font-size: 16px;
    border-radius: 12px;
  }
  .auth-hint { font-size: 12px; padding: 0 4px; }
  .auth-refresh {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
  .auth-row { grid-template-columns: 1fr; }
  .captcha-row { flex-direction: column; align-items: stretch; }
  #captcha-img { width: 100%; height: auto; }
  .otp-inputs input { width: 42px; height: 50px; font-size: 20px; }
}
@media (max-width: 380px) {
  .auth-card { padding: 18px 14px 16px; }
  .auth-title { font-size: 22px; }
}

/* Mobile login extras stay hidden on the desktop split layout. */
.auth-mbrandblock,
.auth-title-mob,
.auth-lead,
.auth-ico,
.pw-word,
.auth-switch-track { display: none; }
.auth-secure { display: none; }

@keyframes rezFloatUp {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rezPopIn {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  body.auth-login .auth-card,
  body.auth-login .auth-mlogo { animation: none !important; }
}

@media (max-width: 860px) {
  body.auth-login {
    background:
      radial-gradient(90% 42% at 50% 0%, #d7e8fb 0%, rgba(215, 232, 251, 0) 70%),
      linear-gradient(180deg, #f5f9fd 0%, #e7f0f9 100%);
  }
  body.auth-login .auth-shell {
    display: flex;
    min-height: 100dvh;
    background: transparent;
  }
  body.auth-login .auth-art { display: none !important; }
  body.auth-login .auth-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
    background: transparent;
  }
  body.auth-login .auth-inner {
    width: 100%;
    max-width: 400px;
    margin: 0;
    padding: 0;
  }
  body.auth-login .auth-card {
    margin: 0;
    border: 1px solid #d3dfec;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(11, 40, 80, .08);
    padding: 0 0 26px;
    min-height: 0;
    overflow: hidden;
    animation: none;
  }
  body.auth-login .auth-logo { display: none; }
  body.auth-login .auth-mbrandblock {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 22px;
    padding: 26px 24px 22px;
    background: linear-gradient(180deg, #7ec8f5 0%, #d7f0ff 100%);
  }
  body.auth-login .auth-mbrandblock::after { content: none; }
  body.auth-login .auth-mlogo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #071833;
    border: 0;
    box-shadow: none;
  }
  body.auth-login .auth-title,
  body.auth-login .auth-lead,
  body.auth-login .auth-card form {
    padding-left: 26px;
    padding-right: 26px;
  }
  body.auth-login .auth-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0;
    color: #12263a;
    text-align: center;
    margin: 0 0 22px;
  }
  body.auth-login .auth-title-desk { display: inline; }
  body.auth-login .auth-title-mob,
  body.auth-login .auth-lead { display: none; }
  body.auth-login .auth-sub,
  body.auth-login .auth-hint,
  body.auth-login .auth-secure { display: none; }
  body.auth-login .auth-field { margin-bottom: 18px; }
  body.auth-login .auth-field label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #5c6f86;
    margin-bottom: 6px;
  }
  body.auth-login .auth-ico {
    display: block;
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    color: #9FB3CB;
    pointer-events: none;
  }
  body.auth-login .auth-field.focused .auth-ico { color: #1857C4; }
  body.auth-login .auth-field input {
    height: auto;
    min-height: 48px;
    padding: 13px 14px 13px 42px;
    border-radius: 4px;
    border: 1px solid #c5d4e4;
    background: #fff;
    font-size: 16px;
    color: #0F2A4A;
    box-shadow: none;
  }
  body.auth-login .auth-field input::placeholder { color: #8aa0b8; }
  body.auth-login .auth-field input:focus {
    border-color: #1857C4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(24, 87, 196, .14);
  }
  body.auth-login #password { padding-right: 64px; }
  body.auth-login .pw-toggle {
    right: 8px;
    color: #1857C4;
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 6px;
    border-radius: 6px;
  }
  body.auth-login .pw-toggle svg { display: none; }
  body.auth-login .pw-word { display: inline; }
  body.auth-login .auth-remember {
    color: #24384c;
    font-size: 14px;
    gap: 8px;
    margin: 2px 0 20px;
  }
  body.auth-login .auth-switch {
    position: static;
    width: auto;
    height: auto;
    flex: 0 0 auto;
  }
  body.auth-login .auth-switch input {
    opacity: 1;
    position: static;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0B3D91;
  }
  body.auth-login .auth-switch-track { display: none; }
  body.auth-login .auth-btn {
    min-height: 48px;
    height: auto;
    padding: 14px;
    border-radius: 4px;
    border: none;
    background: #0B3D91;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: none;
    box-shadow: none;
  }
  body.auth-login .auth-btn:hover:not(:disabled) { background: #082f70; }
  body.auth-login .auth-btn:disabled { opacity: .85; }
  body.auth-login .auth-alert { border-radius: 4px; }
}
@media (max-width: 380px) {
  body.auth-login .auth-card { padding-bottom: 22px; }
  body.auth-login .auth-title,
  body.auth-login .auth-lead,
  body.auth-login .auth-card form {
    padding-left: 18px;
    padding-right: 18px;
  }
}
