:root{
  --glass: rgba(255,255,255,.7);
  --stroke: rgba(15,23,42,.12);
  --primary: #0ea5e9;  /* igual que tu header público */
  --primary-2: #22d3ee;
  --fg: #0f172a;
  --fg-muted: #475569;
  --ok: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(15,23,42,.12);
}

/* Reset base */
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji','Segoe UI Emoji';
  color: var(--fg);
  background: #f8fafc;
}

/* Fondo animado sutil */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: -1; }
.blob{
  position: absolute;
  width: 420px; height: 420px;
  filter: blur(60px);
  border-radius: 50%;
  opacity: .45;
  animation: float 14s ease-in-out infinite alternate;
}
.b1{ background: radial-gradient(closest-side, #60a5fa, transparent); top:-60px; left:-60px; }
.b2{ background: radial-gradient(closest-side, #22d3ee, transparent); bottom:-80px; right:-40px; animation-delay: .6s; }
.b3{ background: radial-gradient(closest-side, #a78bfa, transparent); top: 50%; left: 60%; animation-delay: 1.2s; }
@keyframes float{
  to{ transform: translateY(-30px) translateX(20px) scale(1.05); opacity:.55; }
}

/* Rejilla sutil */
.grid{
  position:absolute; inset:0;
  background-image: linear-gradient(rgba(15,23,42,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, #000 40%, transparent 75%);
}

/* Layout */
.login-wrap{
  min-height: calc(100vh - 72px); /* considera header.php */
  display:flex; align-items:center; justify-content:center;
  padding: clamp(20px, 4vw, 60px);
}
.login-card{
  width: min(420px, 92vw);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px 24px;
  transform-style: preserve-3d;
  transition: transform .18s ease;
}

/* Header del card */
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 10px;
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand img{ width:34px; height:34px; object-fit:contain }
.brand h1{ font-size:16px; margin:0; color:var(--fg); font-weight:800; letter-spacing:.2px; text-transform:uppercase; }
.pill{
  font-size:12px; padding:6px 10px; border-radius:999px;
  background: #e0f2fe; color:#0c4a6e; border:1px solid #bae6fd;
}

/* Titular */
h2{ margin:8px 0 6px; font-size:22px }
.muted{ color: var(--fg-muted); margin:0 0 14px; }

/* Formulario */
.form{ margin-top: 4px; }
.field{ display:block; margin-bottom:14px; }
.field__label{ display:block; font-size:13px; margin-bottom:6px; color:#0f172a; font-weight:600; }
.field__box{
  display:flex; align-items:center; gap:10px;
  background:#fff; border:1px solid #cbd5e1; border-radius:12px;
  padding: 10px 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field__box:focus-within{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14,165,233,.15);
}
.field__input{
  border:none; outline:none; width:100%;
  font-size:15px; background:transparent; color:var(--fg);
}
.ico{ opacity:.75 }

/* Peek password */
.peek{
  border:none; background:transparent; cursor:pointer;
  font-size:18px; line-height:1; padding:0 2px;
  opacity:.8;
}
.peek:hover{ opacity:1 }

/* Row de acciones */
.row{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 4px; margin-bottom: 14px;
}
.chk{ display:flex; align-items:center; gap:8px; font-size:14px; color:#1e293b; }
.link{ color: var(--primary); text-decoration:none; font-weight:600; }
.link:hover{ text-decoration:underline }

/* Botones */
.btn{
  width:100%; padding:12px 18px; border-radius:12px; border:1px solid var(--stroke);
  background:#fff; color:#0f172a; cursor:pointer; font-weight:700;
  transition: transform .12s ease, filter .2s ease, box-shadow .2s ease;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.02); box-shadow: 0 10px 24px rgba(2,8,23,.08) }
.btn:active{ transform: translateY(0) scale(.99) }

.btn-primary{
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color:#fff; border:none; position:relative; overflow:hidden;
}
.btn-ghost{
  background: rgba(255,255,255,.75);
}

/* Glow animado del CTA */
.btn-cta{ position:relative; }
.btn-cta .glow{
  position:absolute; inset: -2px;
  background: radial-gradient(600px 100px at 50% -30%, rgba(255,255,255,.35), transparent 40%),
              linear-gradient(135deg, rgba(255,255,255,.08), transparent);
  opacity:.0; pointer-events:none; transition: opacity .25s ease;
}
.btn-cta:hover .glow{ opacity: 1; }
.btn-cta.pulse { animation: pulse 1.6s ease-in-out 2; }
@keyframes pulse{
  0%,100%{ box-shadow: 0 0 0 0 rgba(14,165,233,.0); }
  50%{ box-shadow: 0 0 0 12px rgba(14,165,233,.15); }
}

/* Divider */
.divider{
  display:flex; align-items:center; gap:10px; margin:14px 0 10px;
  color: var(--fg-muted); font-size:14px; justify-content:center;
}
.divider::before, .divider::after{
  content:""; flex:1; height:1px; background: rgba(2,8,23,.08);
}

/* Lista confianza */
.trust{
  display:flex; gap:10px; flex-wrap:wrap;
  list-style:none; margin:14px 0 0; padding:0;
  color:#0f172a; font-size:13px;
}
.trust li{
  background: rgba(255,255,255,.8);
  border:1px solid rgba(2,8,23,.08);
  border-radius:999px; padding:8px 12px;
}

/* Alert */
.alert{
  background:#fee2e2; color:#991b1b; border:1px solid #fecaca;
  border-radius:12px; padding:10px 12px; margin-bottom:10px; font-size:14px;
}
.shake{ animation: shake .34s ease; }
@keyframes shake{
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

/* Footer */
.foot{
  text-align:center; padding: 10px 16px; color:#64748b; font-size:13px;
}

/* Responsive */
@media (max-width: 640px){
  .login-card{ padding:20px; }
  .brand h1{ display:none; }
}

/* Signup mini-form */
.signup { margin-top: 8px; }
.inline-fields{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.signup .field{ margin-bottom:12px; }
.signup .btn{ margin-top:4px; }

/* Responsive */
@media (max-width: 640px){
  .inline-fields{ grid-template-columns: 1fr; }
}
