/* ---------- Variables y modo claro ---------- */
:root{
    --bg: #0b1020;
    --layer1: #0f152b;
    --layer2: #121832;
    --text: #eaf0ff;
    --muted: #9aa4c4;
    --brand: #6ea3ff;
    --brand-2: #9dd1ff;
    --accent: #12b886;
    --danger: #f03e3e;
    --radius: 18px;
    --shadow: 0 18px 36px rgba(2,6,23,.35);
    --border: 1px solid rgba(255,255,255,.06);
    --gap: 18px;
  }
  
  :root.light{
    --bg: #f5f7fb;
    --layer1: #ffffff;
    --layer2: #f0f4ff;
    --text: #111827;
    --muted: #5b647e;
    --brand: #3662ff;
    --brand-2: #7fb0ff;
    --accent: #12b886;
    --danger: #e03131;
    --shadow: 0 18px 36px rgba(3,7,18,.08);
    --border: 1px solid rgba(2,6,23,.06);
  }
  
  /* ---------- Reset básico ---------- */
  *{ box-sizing: border-box; }
  html, body{ height:100%; }
  body{
    margin:0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background:
      radial-gradient(1200px 500px at -10% -20%, rgba(102,126,234,.18), transparent 60%),
      radial-gradient(1100px 600px at 110% 20%, rgba(118,75,162,.16), transparent 60%),
      var(--bg);
  }
  
  /* ---------- Layout ---------- */
  .auth-layout{
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.1fr 1fr; /* hero | panel */
  }
  
  .hero{
    position: relative;
    background:
      radial-gradient(800px 400px at 20% 10%, rgba(110,163,255,.18), transparent 60%),
      linear-gradient(180deg, var(--layer2), var(--layer1));
    border-right: var(--border);
    display: grid;
    place-items: center;
    padding: 28px;
  }
  .hero-inner{ max-width: 560px; }
  .brand{
    display:flex; align-items:center; gap:12px; margin-bottom: 12px;
  }
  .brand-logo{
    width:46px; height:46px; border-radius:14px;
    display:grid; place-items:center; color:white;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 12px 24px rgba(91,132,255,.35);
  }
  .brand-text strong{ display:block; font-size:18px; letter-spacing:.2px; }
  .brand-text span{ color: var(--muted); font-size:12px; }
  
  .hero h2{
    margin: 14px 0 10px;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.15;
  }
  .grad{
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .hero p{ color: var(--muted); margin: 8px 0 18px; }
  .bullets{ list-style: none; padding:0; margin: 0 0 24px; }
  .bullets li{
    display:flex; align-items:center; gap:10px; color: var(--text);
    padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.08);
  }
  .bullets li i{ color: var(--accent); }
  .hero-footer{ color: var(--muted); }
  
  .panel{
    min-height: 100dvh;
    display:flex; flex-direction: column;
    align-items:center; justify-content:center;
    padding: clamp(16px, 4vw, 28px);
    position: relative;
  }
  .panel-header{
    position:absolute; top:16px; right:16px;
  }
  .ghost-btn{
    display:inline-flex; align-items:center; justify-content:center;
    width:40px; height:40px; border-radius:12px;
    border: var(--border);
    background: var(--layer1);
    color: var(--text); cursor:pointer;
  }
  .ghost-btn:hover{ filter: brightness(1.06); }
  
  .card{
    width: min(96%, 520px);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--layer1);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 4vw, 26px);
    backdrop-filter: blur(8px);
  }
  .card-head{
    text-align:center; margin-bottom: 14px;
  }
  .logo-badge{
    width:54px; height:54px; border-radius:16px; margin: 0 auto 8px;
    display:grid; place-items:center; color:#0b1020;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 12px 26px rgba(91,132,255,.35);
  }
  .card-head h1{ margin:8px 0 6px; font-size: clamp(22px, 2.4vw, 26px); }
  .subtitle{ color: var(--muted); margin:0; }
  
  /* ---------- Formulario ---------- */
  .form{ margin-top: 10px; }
  .field{ margin-bottom: 14px; }
  .field label{
    display:block; font-weight:600; font-size: 13px; margin-bottom: 8px;
    color: var(--muted);
  }
  
  .control{
    position:relative;
    display:flex; align-items:center; gap:10px;
    background: var(--layer2);
    border: var(--border);
    border-radius: 14px;
    padding: 10px 12px;
  }
  .control i{
    font-size: 18px; opacity:.9; color: var(--muted);
  }
  .control input{
    flex:1; min-width:0; /* evita overflow en móvil */
    border:0; outline:0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    padding: 6px 2px;
  }
  .control input::placeholder{ color: color-mix(in oklab, var(--muted), #fff 10%); }
  
  .icon-btn{
    border:0; background: transparent; color: var(--muted);
    width:36px; height:36px; display:grid; place-items:center; border-radius:10px;
    cursor:pointer;
  }
  .icon-btn:hover{ filter: brightness(1.1); }
  
  .error{
    color: var(--danger);
    min-height: 16px;
    font-size: 12px;
    margin: 6px 4px 0;
  }
  
  .row{
    display:flex; align-items:center; justify-content:space-between;
    gap: 12px; margin: 8px 2px 6px;
  }
  .check{
    display:inline-flex; align-items:center; gap:8px; cursor:pointer;
    color: var(--muted);
    user-select: none;
  }
  .check input{ width:16px; height:16px; accent-color: var(--brand); }
  .link{
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
  }
  .link:hover{ filter: brightness(1.2); }
  
  /* ---------- Botón principal ---------- */
  .btn{
    appearance:none; border:0; cursor:pointer;
    width:100%;
    display:inline-flex; align-items:center; justify-content:center;
    gap:10px; padding: 12px 16px;
    border-radius: 14px; font-weight:800; letter-spacing:.2px;
    transition: transform .04s ease, box-shadow .2s ease;
  }
  .btn.primary{
    color: #0b1020;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 16px 32px rgba(91,132,255,.35);
  }
  .btn:hover{ transform: translateY(-1px); }
  .btn:active{ transform: translateY(0); }
  
  .btn.loading{
    pointer-events: none; opacity:.9; position: relative;
  }
  .btn .spinner{
    display:none; width:18px; height:18px; border-radius:50%;
    border: 2px solid rgba(0,0,0,.18);
    border-top-color: rgba(0,0,0,.5);
    animation: spin 1s linear infinite;
  }
  .btn.loading .btn-text{ opacity:.0; }
  .btn.loading .spinner{ display:inline-block; }
  
  @keyframes spin { to { transform: rotate(360deg) } }
  
  .hint{
    text-align:center; color: var(--muted); font-size: 14px; margin: 12px 0 0;
  }
  
  /* ---------- Móvil UI/UX ---------- */
  .mobile-footer{
    margin-top: 16px;
    display:flex; align-items:center; justify-content:center;
    gap:10px; color: var(--muted);
  }
  .mf-brand{ display:flex; align-items:center; gap:10px; }
  .mf-brand .brand-logo{
    width:36px; height:36px; border-radius:10px; display:grid; place-items:center; color:#0b1020;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
  }
  
  /* ---------- Helpers de visibilidad ---------- */
  .hide-on-mobile{ display:block; }
  .show-on-mobile{ display:none; }
  
  /* ---------- Responsivo ---------- */
  @media (max-width: 980px){
    .auth-layout{
      grid-template-columns: 1fr; /* solo panel */
    }
    .hide-on-mobile{ display:none; }
    .show-on-mobile{ display:block; }
    .panel{
      justify-content: flex-start;
      padding-top: 36px;
    }
    .card{
      margin-top: 20px;
      border-radius: 22px;
    }
  }
  
  /* Reduce motion */
  @media (prefers-reduced-motion: reduce){
    .btn, .btn.primary{ transition: none; }
    .btn .spinner{ animation: none; }
  }
  