:root {
  --al-purple: #5A52FF;
  --al-purple-2: #6D63FF;
  --al-ink: #0f172a;
  --al-muted: #64748b;
  --al-line: #e2e8f0;
  --al-danger: #dc2626;
  --al-ok: #059669;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
.auth-login-body {
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--al-ink);
  background: #fff;
}

/* Formulario izquierda · panel morado derecha (estilo referencia) */
.al-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 1.05fr);
}

.al-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px; background: #fff;
}
.al-card {
  width: 100%; max-width: 420px;
  animation: alCardIn .45s ease;
}
.al-logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; margin-bottom: 28px;
}
.al-logo-dark { color: var(--al-ink); }
.al-logo img { height: 36px; width: auto; }
.al-logo strong { font-family: Poppins, sans-serif; font-size: 1.25rem; }

.al-card h2 {
  margin: 0 0 8px; font-family: Poppins, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em;
}
.al-card-sub { margin: 0 0 22px; color: var(--al-muted); font-size: 14.5px; line-height: 1.55; }
.al-card-sub strong { color: var(--al-ink); }

.al-form { display: grid; gap: 14px; }
.al-field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.al-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.45; color: var(--al-muted); cursor: pointer;
}
.al-check input {
  margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--al-purple);
}
.al-check a { color: var(--al-purple); font-weight: 600; text-decoration: underline; }
.al-check a:hover { opacity: .85; }
.al-input {
  width: 100%; padding: 15px 20px; border: 1.5px solid var(--al-line);
  border-radius: 999px; font-size: 15px; background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.al-input:focus {
  outline: none; border-color: var(--al-purple);
  box-shadow: 0 0 0 4px rgba(90, 82, 255, .15);
}
.al-pass-wrap { position: relative; }
.al-pass-wrap .al-input { padding-right: 48px; transition: border-color .2s, box-shadow .25s, transform .2s; }
.al-pass-wrap.is-focus .al-input {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(90, 82, 255, .15), 0 10px 24px rgba(90, 82, 255, .08);
}
.al-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; font-size: 16px; opacity: .6;
  transition: opacity .2s, transform .2s;
}
.al-eye:hover, .al-eye.is-open { opacity: 1; transform: translateY(-50%) scale(1.08); }

.al-secure-meter {
  display: none; flex-direction: column; gap: 8px;
  padding: 4px 2px 2px; color: var(--al-muted); font-size: 12px;
  animation: alMeterIn .35s ease;
}
.al-secure-meter.is-on,
.al-secure-meter:not([hidden]).is-on { display: flex; }
.al-secure-meter[hidden] { display: none !important; }
.al-strength {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.al-strength-seg {
  height: 6px; border-radius: 99px; background: #e2e8f0;
  transform: scaleX(.92); transform-origin: left center;
  transition: background .25s ease, transform .25s ease;
}
.al-strength-seg.is-on { transform: scaleX(1); }
.al-strength-seg.is-pop { animation: alSegPop .35s ease; }
.al-strength[data-score="1"] .al-strength-seg.is-on { background: #f97316; }
.al-strength[data-score="2"] .al-strength-seg.is-on { background: #eab308; }
.al-strength[data-score="3"] .al-strength-seg.is-on { background: #22c55e; }
.al-strength[data-score="4"] .al-strength-seg.is-on {
  background: linear-gradient(90deg, var(--al-purple), #22d3ee);
}
#alStrengthLabel[data-score="1"] { color: #ea580c; }
#alStrengthLabel[data-score="2"] { color: #ca8a04; }
#alStrengthLabel[data-score="3"] { color: #16a34a; }
#alStrengthLabel[data-score="4"] { color: var(--al-purple); font-weight: 700; }

.al-btn {
  margin-top: 6px; width: 100%; padding: 15px 18px; border: 0 !important; border-radius: 999px;
  background: var(--al-purple) !important; color: #fff !important; font-weight: 700; font-size: 15px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s, background .2s, box-shadow .2s;
  appearance: none; -webkit-appearance: none;
}
.al-btn:hover { background: #473ecc !important; box-shadow: 0 10px 24px rgba(90, 82, 255, .28); }
.al-btn:active { transform: scale(.98); }
.al-btn.is-loading { pointer-events: none; opacity: .85; }
.al-btn-spin {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: alSpin .7s linear infinite;
}

.al-foot { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--al-muted); }
.al-foot a { color: var(--al-purple); font-weight: 700; text-decoration: none; }
.al-resend { text-align: center; margin-top: 14px; }
.al-link-btn {
  border: 0; background: none; color: var(--al-purple); font-weight: 700;
  cursor: pointer; font-size: 14px; text-decoration: underline;
}

.al-flash {
  padding: 12px 14px; border-radius: 14px; font-size: 13.5px; margin-bottom: 14px;
  animation: alFlashIn .35s ease;
}
.al-flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.al-flash-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.al-card.is-shake { animation: alShake .45s ease; }
.cf-turnstile { margin: 4px 0; display: flex; justify-content: center; }

.al-otp-field { position: relative; }
.al-otp-slots {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.al-otp-slots i {
  display: flex; align-items: center; justify-content: center;
  height: 52px; border-radius: 14px;
  border: 1.5px solid var(--al-line); background: #f8fafc;
  font-family: Poppins, sans-serif; font-size: 1.25rem; font-weight: 800;
  color: var(--al-ink); letter-spacing: 0;
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.al-otp-slots i.is-on {
  border-color: var(--al-purple); background: #eef0ff; color: var(--al-purple);
}
.al-otp-slots i.is-active {
  border-color: var(--al-purple);
  box-shadow: 0 0 0 3px rgba(90, 82, 255, .18);
  animation: alCaretBlink 1s ease-in-out infinite;
}
.al-otp-slots i.is-pop { animation: alOtpPop .32s cubic-bezier(.2,.9,.3,1.2); }
.al-otp-slots.is-complete i {
  border-color: #22c55e; background: #ecfdf5; color: #15803d;
}
.al-otp-slots.is-checking { animation: alOtpPulse .9s ease-in-out infinite; }
.al-otp-input {
  letter-spacing: .45em; font-size: 1.2rem; font-weight: 700; text-align: center;
  font-family: Poppins, sans-serif; caret-color: var(--al-purple);
}
.al-otp-input.is-complete {
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .15);
}

/* Panel derecho */
.al-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px 0;
  background: linear-gradient(160deg, #5B6CFF 0%, #4F46E5 48%, #4338CA 100%);
  color: #fff;
  border-radius: 40px 0 0 40px;
  overflow: hidden;
  min-height: 100vh;
}
.al-brand-top { max-width: 440px; padding-bottom: 24px; }
.al-brand-title {
  margin: 0 0 14px; font-family: Poppins, sans-serif;
  font-size: clamp(1.85rem, 3.2vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
}
.al-lead { margin: 0 0 12px; font-size: 1.1rem; font-weight: 600; opacity: .95; }
.al-sub { margin: 0; font-size: 15px; line-height: 1.65; opacity: .84; max-width: 380px; }

.al-brand-visual {
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 12px 8px 0;
}
.al-brand-visual picture { display: contents; }
.al-brand-img {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 40px rgba(15, 23, 42, .28));
  animation: alHeroFloat 4.5s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes alHeroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes alCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes alShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
@keyframes alSpin { to { transform: rotate(360deg); } }
@keyframes alFlashIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes alMeterIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes alSegPop {
  0% { transform: scaleX(.7) scaleY(.6); }
  60% { transform: scaleX(1.05) scaleY(1.25); }
  100% { transform: scaleX(1) scaleY(1); }
}
@keyframes alOtpPop {
  0% { transform: scale(.82); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes alCaretBlink {
  0%, 100% { box-shadow: 0 0 0 3px rgba(90, 82, 255, .12); }
  50% { box-shadow: 0 0 0 5px rgba(90, 82, 255, .22); }
}
@keyframes alOtpPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

@media (max-width: 960px) {
  .al-shell { grid-template-columns: 1fr; }
  .al-brand { display: none; }
  .al-main { padding: 40px 20px 32px; align-items: flex-start; }
  .al-card { max-width: 420px; margin: 0 auto; animation: none; }
  .al-card h2 { text-align: center; }
  .al-card-sub { text-align: center; }
  .al-logo { justify-content: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .al-brand-img,
  .al-card,
  .al-strength-seg,
  .al-otp-slots i,
  .al-otp-slots.is-checking { animation: none !important; }
}
