/* Reset corto y fuente del sistema */
*{box-sizing:border-box} html,body{height:100%}
body{margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji";}
:root{
  --bg1:#0ea5e9; --bg2:#312e81;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#6b7280;
  --border:rgba(15,23,42,.12);
  --ring:#3b82f6;
  --error:#ef4444;
  --success:#16a34a;
}

/* Fondo */
.login-page .bg{
  position:fixed; inset:0;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(255,255,255,.12), transparent 50%),
              radial-gradient(800px 600px at 90% 90%, rgba(255,255,255,.08), transparent 50%),
              linear-gradient(135deg, var(--bg1), var(--bg2));
  filter: saturate(110%);
}

/* Contenedor principal */
.auth{
  min-height:100dvh; display:grid; place-items:center; padding:24px;
}

/* Tarjeta */
.card{
  width:100%; max-width:420px;
  background: color-mix(in oklab, var(--card) 88%, white 12%);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
  padding:28px;
  animation: rise .35s ease-out both;
}
@keyframes rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

.brand{ text-align:center; margin-bottom:10px;}
.brand .logo{ width:62px; height:62px; object-fit:contain; margin-bottom:6px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.15)); }
.brand h1{ margin:0; font-size:22px; color:var(--text); letter-spacing:.5px;}
.brand .subtitle{ margin:4px 0 6px; color:var(--muted); font-size:14px;}

/* Formulario */
.field{ margin:14px 0;}
label{ display:block; font-size:13px; color:var(--muted); margin:0 0 6px 2px;}
.ctl{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--border); border-radius:12px; padding:10px 12px;
  background:#fff;
}
.ctl:focus-within{ outline:2px solid color-mix(in oklab, var(--ring) 35%, white 65%); outline-offset:2px; }
.ctl input{
  border:0; outline:0; width:100%; font:inherit; color:var(--text); background:transparent;
}
.with-icon .icon{ width:18px; height:18px; color:#64748b; display:grid; place-items:center; }
.with-icon .icon svg{ width:18px; height:18px; fill:currentColor; }
.icon-btn{
  width:28px; height:28px; display:grid; place-items:center;
  border:0; background:transparent; cursor:pointer; color:#64748b;
  border-radius:8px;
}
.icon-btn:hover{ background:#f3f4f6;}
.icon-btn .eye{ width:18px; height:18px; fill:currentColor; }

/* Fila utilidades */
.row{ display:flex; align-items:center; gap:12px; margin:6px 2px 2px; }
.row.between{ justify-content:space-between;}
.check{ color:var(--muted); font-size:13px; display:flex; align-items:center; gap:6px; }
.link{ color:var(--ring); text-decoration:none; font-size:13px;}
.link:hover{ text-decoration:underline; }

/* Botón */
.btn{
  width:100%; border:0; border-radius:12px; padding:12px 16px; cursor:pointer;
  font-weight:600; letter-spacing:.2px; display:inline-grid; place-items:center;
}
.btn.primary{ background: linear-gradient(180deg, #22c55e, #16a34a); color:#fff; box-shadow:0 12px 24px rgba(22,163,74,.25); }
.btn.primary:hover{ filter: brightness(1.02); }
.btn[disabled]{ opacity:.7; cursor:not-allowed; }
.btn .spinner{
  width:18px; height:18px; border:2px solid #fff; border-right-color:transparent; border-radius:50%;
  display:none; animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.btn.loading .btn-text{ display:none; }
.btn.loading .spinner{ display:inline-block; }

/* Alertas */
.alert{ padding:10px 12px; border-radius:10px; margin:8px 0 4px; font-size:14px; }
.alert-error{ background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }

/* Footer */
.foot{ margin-top:14px; text-align:center; color:var(--muted); }
.foot small{ display:block; line-height:1.5; }

/* Responsive pequeño */
@media (max-width:420px){
  .card{ padding:22px; }
}
