*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:   #0a0f1a;
  --card-bg:   #0f1829;
  --card-bg2:  #111e32;
  --accent:    #F59E0B;
  --accent2:   #FBBF24;
  --teal:      #14B8A6;
  --blue-btn:  #2563EB;
  --blue-btn2: #3B82F6;
  --text:      #E2E8F0;
  --muted:     #64748B;
  --border:    rgba(255,255,255,0.08);
}

html {
  height: 100%;
  /* Evita zoom en inputs iOS */
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh; /* dynamic viewport height — evita el problema del chrome móvil */
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ══ FONDO ═══════════════════════════════════ */
.bg-photo {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 80% at 65% 50%, rgba(15,24,40,0.55) 0%, rgba(5,8,15,0.92) 100%),
    linear-gradient(135deg, #060d1a 0%, #0d1828 40%, #12202e 70%, #0a1520 100%);
}
.bg-photo::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 25% 55%, rgba(245,158,11,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 75% 30%, rgba(20,184,166,0.05) 0%, transparent 55%);
}

/* ══ CANVAS ══════════════════════════════════ */
#cvs-net, #cvs-sparks {
  position: fixed; inset: 0; pointer-events: none;
}
#cvs-net    { z-index: 1; }
#cvs-sparks { z-index: 2; }

/* ══ PÁGINA ══════════════════════════════════ */
.page {
  position: relative; z-index: 10;
  width: 100%;
  max-width: 1200px;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 48px 6vw;
  gap: 48px;
}

/* ══ IZQUIERDA ═══════════════════════════════ */
.left {
  flex: 1;
  max-width: 540px;
  animation: fadeLeft .9s cubic-bezier(.16,1,.3,1) both;
}
@keyframes fadeLeft {
  from { opacity:0; transform:translateX(-28px); }
  to   { opacity:1; transform:translateX(0); }
}

.logo-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.logo-icon {
  width: 50px; height: 50px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(245,158,11,0.35);
}
.logo-icon i { font-size: 20px; color: #fff; }
.logo-text { font-size: 20px; font-weight: 600; color: var(--text); line-height: 1.2; }
.logo-text span { color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(20,184,166,0.12);
  border: 1px solid rgba(20,184,166,0.25);
  color: var(--teal);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 50px;
  margin-bottom: 24px;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--teal); border-radius: 50%;
  flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(34px, 4.8vw, 60px);
  font-weight: 900; line-height: 1.08;
  color: var(--text); margin-bottom: 18px;
}
.headline em {
  font-style: italic; color: var(--accent);
  position: relative; display: inline-block;
}
.headline em::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.tagline {
  font-size: 14.5px; color: var(--muted);
  line-height: 1.75; max-width: 400px; margin-bottom: 36px;
}

.stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; max-width: 400px;
}
.stat {
  background: rgba(15,24,40,0.85); padding: 20px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  backdrop-filter: blur(10px); transition: background .3s;
  -webkit-backdrop-filter: blur(10px);
}
.stat:hover  { background: rgba(245,158,11,0.07); }
.stat-val    { font-family:'Playfair Display',serif; font-size:26px; font-weight:700; color:var(--text); }
.stat-val sup{ font-size:13px; color:var(--accent); }
.stat-val .inf{ font-size:20px; color:var(--teal); }
.stat-lbl    { font-size:9px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; color:var(--muted); text-align:center; }

/* ══ DERECHA ══════════════════════════════════ */
.right {
  flex-shrink: 0;
  width: min(390px, 100%);
  animation: fadeRight .9s .1s cubic-bezier(.16,1,.3,1) both;
}
@keyframes fadeRight {
  from { opacity:0; transform:translateX(28px); }
  to   { opacity:1; transform:translateX(0); }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 38px 34px 30px;
  box-shadow:
    0 30px 60px rgba(0,0,0,.5),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute;
  top: 0; left: 18%; right: 18%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.secure-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 12px;
}
.card-title {
  font-family:'Playfair Display',serif; font-size:30px; font-weight:700;
  color:var(--text); margin-bottom:5px;
}
.card-sub { font-size:13px; color:var(--muted); margin-bottom:26px; }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px; padding: 12px 14px;
  font-size: 13px; color: #FCA5A5; margin-bottom: 18px;
  animation: shake .4s ease;
}
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

.field { margin-bottom: 15px; }
.field-label {
  display: block; font-size: 12px; font-weight: 500;
  color: #94A3B8; margin-bottom: 7px;
}
.field-wrap { position: relative; }
.field-wrap input {
  width: 100%; background: var(--card-bg2);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 44px 13px 42px;
  font-family:'Outfit',sans-serif;
  /* iOS font-size mínimo 16px evita el zoom automático */
  font-size: 16px;
  color: var(--text); outline: none;
  transition: border-color .25s, box-shadow .25s;
  -webkit-appearance: none;
  appearance: none;
}
.field-wrap input::placeholder { color: rgba(100,116,139,0.6); }
.field-wrap input:focus {
  border-color: rgba(37,99,235,0.6);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.fi {
  position:absolute; left:14px; top:50%; transform:translateY(-50%);
  font-size:14px; color:var(--muted); pointer-events:none; transition:color .2s;
}
.field-wrap:focus-within .fi { color: var(--blue-btn2); }
.btn-eye {
  position:absolute; right:0; top:0; bottom:0;
  width:44px;
  background:none; border:none; cursor:pointer; color:var(--muted);
  font-size:14px; display:flex; align-items:center; justify-content:center;
  transition:color .2s;
  /* área táctil cómoda */
  min-width: 44px;
}
.btn-eye:hover { color:var(--text); }

.opts { display:flex; align-items:center; margin-bottom:20px; }
.chk-label {
  display:flex; align-items:center; gap:9px; cursor:pointer;
  font-size:13px; color:var(--muted); user-select:none;
  /* área táctil */
  padding: 4px 0;
}
.chk-label input { display:none; }
.chkbox {
  /* mínimo 44x44px área táctil */
  width:20px; height:20px; border-radius:6px; border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  transition:background .2s, border-color .2s; flex-shrink:0;
}
.chk-label input:checked + .chkbox { background:var(--blue-btn); border-color:var(--blue-btn); }
.chk-label input:checked + .chkbox::after { content:'✓'; color:#fff; font-size:11px; font-weight:700; }

.btn-login {
  width:100%;
  /* área táctil mínima 48px */
  padding: 16px;
  background: linear-gradient(135deg, var(--blue-btn), var(--blue-btn2));
  border:none; border-radius:10px; color:#fff;
  font-family:'Outfit',sans-serif; font-size:15px; font-weight:600;
  cursor:pointer; display:flex; align-items:center; justify-content:center; gap:10px;
  position:relative; overflow:hidden;
  transition:transform .15s, box-shadow .25s;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-login::before {
  content:''; position:absolute; top:0; left:-100%; width:55%; height:100%;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.15),transparent);
  transform:skewX(-22deg); transition:left .55s;
}
.btn-login:hover { transform:translateY(-2px); box-shadow:0 12px 30px rgba(37,99,235,0.5); }
.btn-login:hover::before { left:160%; }
.btn-login:active { transform:scale(.98); }
.btn-loader { display:none; align-items:center; gap:10px; }

.card-footer {
  margin-top:22px; display:flex; align-items:center; justify-content:center;
  flex-wrap:wrap; gap:6px;
  font-size:10.5px; color:rgba(100,116,139,0.5);
  letter-spacing:.05em; text-transform:uppercase;
}
.card-footer i { color:var(--teal); font-size:11px; }

/* ════════════════════════════════════════════
   RESPONSIVE — breakpoints completos
════════════════════════════════════════════ */

/* Tablets landscape (1024px y menos) */
@media (max-width: 1024px) {
  .page { padding: 40px 4vw; gap: 32px; }
  .headline { font-size: clamp(30px, 4vw, 48px); }
  .tagline { font-size: 14px; }
}

/* Tablets portrait + móviles landscape (820px) */
@media (max-width: 820px) {
  body { align-items: flex-start; }

  .page {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100dvh;
    padding: 40px 20px 48px;
    gap: 32px;
  }

  .left {
    max-width: 100%;
    width: 100%;
    text-align: center;
    order: 1;
  }

  .right {
    width: 100%;
    max-width: 460px;
    order: 2;
  }

  /* Centra los elementos del branding */
  .logo-row   { justify-content: center; }
  .badge      { margin-left: auto; margin-right: auto; }
  .tagline    { margin-left: auto; margin-right: auto; }
  .stats      { margin: 0 auto; max-width: 100%; }

  .headline em::after {
    left: 50%; transform: translateX(-50%);
    right: auto; width: 90%;
  }

  /* En tablet: headline más pequeño */
  .headline { font-size: clamp(32px, 6vw, 48px); }
}

/* Móviles grandes (640px) */
@media (max-width: 640px) {
  .page { padding: 28px 16px 40px; gap: 24px; }

  /* Oculta el branding izquierdo, solo muestra logo + badge */
  .tagline  { display: none; }
  .stats    { display: none; }

  /* Headline más compacto */
  .headline { font-size: clamp(28px, 8vw, 38px); margin-bottom: 14px; }

  .left { margin-bottom: 0; }

  .card { padding: 32px 24px 26px; border-radius: 16px; }
  .card-title { font-size: 26px; }
}

/* Móviles estándar (480px — iPhone SE, Galaxy A, etc.) */
@media (max-width: 480px) {
  .page { padding: 20px 14px 36px; }

  .logo-icon { width: 44px; height: 44px; }
  .logo-icon i { font-size: 18px; }
  .logo-text { font-size: 18px; }

  .badge { font-size: 9.5px; letter-spacing: .14em; padding: 6px 12px; }

  .headline { font-size: clamp(24px, 8.5vw, 34px); }

  .card { padding: 28px 20px 24px; border-radius: 14px; }
  .card-title { font-size: 24px; }
  .card-sub { font-size: 12.5px; margin-bottom: 22px; }

  .field-label { font-size: 11.5px; }
  .field-wrap input { padding: 12px 44px 12px 40px; }

  .btn-login { font-size: 14px; padding: 15px; }
}

/* Móviles pequeños (375px — iPhone SE antiguo) */
@media (max-width: 375px) {
  .page { padding: 16px 12px 30px; gap: 18px; }

  .logo-text { font-size: 16px; }
  .headline  { font-size: 22px; }

  .card { padding: 24px 18px 22px; }
  .card-title { font-size: 22px; }

  .badge { font-size: 9px; padding: 5px 10px; }
}

/* Móviles muy pequeños (320px) */
@media (max-width: 320px) {
  .logo-row { gap: 10px; }
  .logo-icon { width: 38px; height: 38px; }
  .logo-text { font-size: 15px; }
  .headline  { font-size: 20px; }
  .card { padding: 20px 14px 18px; }
  .badge { display: none; }
}

/* Móviles landscape (altura reducida) */
@media (max-height: 600px) and (orientation: landscape) {
  .page { padding: 16px 4vw; }
  body  { align-items: flex-start; }

  .left { display: none; } /* En landscape pequeño: solo el formulario */

  .right {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .card { padding: 24px 28px 20px; }
}

/* iPad Pro / tablets grandes (1024px+, portrait) */
@media (min-width: 821px) and (max-width: 1100px) {
  .page { padding: 40px 40px; gap: 36px; }
  .headline { font-size: clamp(32px, 4vw, 52px); }
}

/* Pantallas de alta densidad — nitidez en retina */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card {
    box-shadow:
      0 30px 60px rgba(0,0,0,.55),
      0 0 0 0.5px rgba(255,255,255,0.07),
      inset 0 1px 0 rgba(255,255,255,0.08);
  }
}