/* 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;
  }
}

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 22px 16px 80px; min-height: 100dvh; }
  .auth-card { padding: 26px 20px 24px; border-radius: 14px; }
  .auth-tag { font-size: 12px; }
  .auth-title { font-size: 26px; }
  .auth-math { grid-template-columns: 1fr; gap: 8px; }
  .auth-math .q { padding-bottom: 0; }
  .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; }
}
