:root {
  --bg: #0b0d10; --bg-2: #11151a; --bg-3: #171c23; --line: #232a33;
  --text: #e6e9ee; --muted: #9aa4b2; --red: #e5383b; --red-2: #ff5a5f;
  --red-dim: rgba(229,56,59,.12); --green: #3ddc97; --amber: #f5b84b;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--red-2); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }

.layout { min-height: 100%; display: grid; grid-template-columns: minmax(380px, 1fr) 1.15fr; }

/* Panel lateral */
.side {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 56px; background: var(--bg-2); border-right: 1px solid var(--line);
}
.side::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 20% 90%, rgba(0,0,0,.6), transparent 70%);
  mask-image: radial-gradient(ellipse at 20% 90%, rgba(0,0,0,.6), transparent 70%);
}
.side::after {
  content: ""; position: absolute; width: 560px; height: 560px; left: -200px; bottom: -240px; pointer-events: none;
  background: radial-gradient(circle, rgba(229,56,59,.2), transparent 65%);
}
.side > * { position: relative; z-index: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand b { font-weight: inherit; }
.brand span { color: var(--red); }
.side-body { max-width: 440px; padding: 48px 0; }
.kicker { font-family: var(--mono); color: var(--red-2); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.side h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.2; margin: 12px 0 36px; letter-spacing: -.01em; }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.features li { display: flex; gap: 16px; align-items: flex-start; }
.features svg {
  flex: 0 0 40px; width: 40px; height: 40px; padding: 9px; border-radius: 9px;
  background: var(--red-dim); stroke: var(--red-2); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.features strong { display: block; font-size: .98rem; }
.features span { color: var(--muted); font-size: .88rem; }
.side-foot { margin: 0; color: var(--muted); font-size: .82rem; font-family: var(--mono); }

/* Zona principal */
.main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px 24px; }
.card { width: 100%; max-width: 420px; margin: auto 0; }
.card-head h2 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -.01em; }
.card-head p { color: var(--muted); margin: 0 0 28px; }

.alert { border-radius: 8px; padding: 12px 14px; font-size: .88rem; margin-bottom: 20px; border: 1px solid; }
.alert-error { background: rgba(229,56,59,.1); border-color: rgba(229,56,59,.4); color: #ffb3b4; }
.alert-info { background: rgba(245,184,75,.08); border-color: rgba(245,184,75,.35); color: #f7d48e; }

.field { margin-bottom: 18px; }
label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 7px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row a { font-size: .82rem; }
input[type=email], input[type=password], input[type=text] {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #5d6774; }
input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); }
.pw { position: relative; }
.pw input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px; cursor: pointer; color: var(--muted);
}
.pw-toggle:hover, .pw-toggle[aria-pressed=true] { color: var(--text); background: var(--bg-3); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; color: var(--muted); font-size: .88rem; margin: 4px 0 24px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--red); margin: 0; }

.btn {
  width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 650; cursor: pointer;
  background: var(--red); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--red-2); }
.btn:disabled { cursor: progress; opacity: .85; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--muted); }
.btn-ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .8rem; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.help { color: var(--muted); font-size: .84rem; margin: 26px 0 0; text-align: center; }

.foot { width: 100%; max-width: 420px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #6b7583; font-size: .76rem; padding-top: 32px; }
.foot nav { display: flex; gap: 14px; }
.foot a { color: #6b7583; }
.foot a:hover { color: var(--text); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { padding: 22px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-body, .side-foot { display: none; }
  .main { padding: 40px 24px 24px; justify-content: flex-start; }
  .card { margin: 0; }
  .foot { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
