:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --accent: #ff4d6d;
  --page: #0f0c2a;
  --surface: #ffffff;
  --ink: #171528;
  --ink-2: #58547a;
  --ink-3: #918dae;
  --line: #e7e5f5;
  --bad: #e0405e;
  --bad-soft: #fdecef;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--page);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
}

/* Fondo vivo: manchas de color con una deriva lenta, nada estridente — el
   objetivo es que la pantalla de login se sienta a la altura del producto de
   adentro, no un formulario suelto de intranet. */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}
body::before {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -14vw; left: -10vw;
  background: radial-gradient(circle at 30% 30%, #7c6bff, transparent 70%);
}
body::after {
  width: 40vw; height: 40vw; max-width: 560px; max-height: 560px;
  bottom: -16vw; right: -12vw;
  background: radial-gradient(circle at 60% 60%, var(--accent), transparent 70%);
  animation-delay: -9s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, 3%) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(10, 6, 40, .45);
}

/* ── Panel izquierdo: marca ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(155deg, var(--brand) 0%, var(--brand-2) 55%, #2c1f8f 100%);
  color: #fff;
  padding: 2.6rem 2.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.hero-blob {
  position: absolute; inset: auto -20% -35% auto;
  width: 70%; padding-bottom: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: .55;
}
.hero-mark {
  width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.hero-mark svg { width: 24px; height: 24px; }
.hero-copy { position: relative; z-index: 1; margin-top: 1.6rem; }
.hero-copy h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .6rem; font-weight: 750; }
.hero-copy p { font-size: .88rem; line-height: 1.6; margin: 0; opacity: .85; max-width: 30ch; }
.hero-stats { position: relative; z-index: 1; display: flex; gap: 1.6rem; margin-top: 2rem; }
.hero-stats div strong { display: block; font-size: 1.15rem; font-weight: 750; }
.hero-stats div span { display: block; font-size: .7rem; opacity: .75; margin-top: .1rem; }
.hero-foot { position: relative; z-index: 1; font-size: .72rem; opacity: .65; }

/* ── Panel derecho: formulario ──────────────────────────────────────────── */
.panel { padding: 2.6rem 2.4rem; display: flex; flex-direction: column; justify-content: center; }
.panel-head { margin-bottom: 1.6rem; }
.panel-head h2 { margin: 0 0 .3rem; font-size: 1.25rem; font-weight: 750; }
.panel-head p { margin: 0; font-size: .82rem; color: var(--ink-3); }

form { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .78rem; font-weight: 650; color: var(--ink-2); }
.field { position: relative; }
input {
  width: 100%; font-family: inherit; font-size: .92rem; padding: .68rem .8rem;
  border: 1.5px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }

button[type="submit"] {
  margin-top: .3rem; font-family: inherit; font-size: .9rem; font-weight: 700;
  padding: .75rem; border-radius: 11px; border: none; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px rgba(79,70,229,.35);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
button[type="submit"]:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(79,70,229,.45); }
button[type="submit"]:active:not(:disabled) { transform: translateY(0); }
button[type="submit"]:disabled { opacity: .65; cursor: progress; box-shadow: none; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}
button[type="submit"].busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  color: var(--bad); font-size: .78rem; margin: 0;
  border-radius: 8px; padding: 0; text-align: center;
}
.error:not(:empty) { padding: .55rem; background: var(--bad-soft); }

.panel-foot { margin: 1.5rem 0 0; font-size: .72rem; color: var(--ink-3); line-height: 1.5; text-align: center; }

@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; max-width: 420px; }
  .hero { display: none; }
}
