/* ============================================================================
   LicitaFácil — Login premium (split credenciales + QR branded estilo Steam).
   Se usa en dos contextos: modal desplegable en el landing (.lfauth-overlay)
   y página completa /login (.lfauth-page). Todo va scoped bajo .lfauth*.
   Paleta de marca: azure #0d47a1/#1565d8 + emerald #2e9e5a/#34d399.
   ============================================================================ */
.lfauth-scope {
    --az-900:#0a2a5e; --az-700:#0d47a1; --az-500:#1565d8; --az-400:#2c8be0;
    --em-600:#248a4d; --em-500:#2e9e5a; --em-400:#34d399;
    --paper:#ffffff; --paper-2:#f5f9fe;
    --ink:#0d1b2a; --ink-2:#43566d; --ink-3:#7286a0;
    --line:#e5edf7; --line-2:#d3e0f0;
    --grad-brand: linear-gradient(152deg, #0d47a1 0%, #1565d8 46%, #2e9e5a 100%);
    --f-disp:'Space Grotesk','Segoe UI',system-ui,sans-serif;
    --f-body:'Inter','Segoe UI',system-ui,sans-serif;
    --f-mono:'Roboto Mono',ui-monospace,'Cascadia Code',monospace;
}

/* ── Contenedores de contexto ─────────────────────────────────────────────── */
/* Página /login: fondo claro con auroras de marca. */
.lfauth-page {
    min-height:100vh; min-height:100dvh; display:flex; align-items:center; justify-content:center;
    padding:40px 20px; position:relative; overflow:hidden;
    background:radial-gradient(120% 100% at 50% -10%, #ffffff 0%, #eef4fc 45%, #e5eef9 100%);
    font-family:var(--f-body); color:var(--ink);
}
.lfauth-page::before {
    content:""; position:absolute; inset:-25%; pointer-events:none; z-index:0;
    background:
        radial-gradient(38% 42% at 20% 26%, rgba(21,101,216,.16), transparent 62%),
        radial-gradient(36% 40% at 82% 24%, rgba(46,158,90,.15), transparent 60%),
        radial-gradient(42% 46% at 74% 84%, rgba(44,139,224,.12), transparent 62%);
    filter:blur(6px); animation:lfauth-drift 24s ease-in-out infinite alternate;
}
@keyframes lfauth-drift { 0%{transform:translate3d(-1.5%,-1%,0) scale(1.02);} 100%{transform:translate3d(1.5%,2%,0) scale(1.05);} }

/* Modal en el landing: velo oscuro con blur. */
.lfauth-overlay {
    position:fixed; inset:0; z-index:1200; display:none;
    align-items:center; justify-content:center; padding:26px 18px;
    background:rgba(8,17,34,.62); backdrop-filter:blur(9px) saturate(1.1);
    font-family:var(--f-body); color:var(--ink);
    opacity:0; transition:opacity .28s ease;
}
.lfauth-overlay.is-open { display:flex; opacity:1; }
.lfauth-overlay .lfauth { animation:lfauth-rise .42s cubic-bezier(.2,.9,.25,1.05) both; }
@keyframes lfauth-rise { from{opacity:0; transform:translateY(16px) scale(.985);} to{opacity:1; transform:none;} }

/* ── Tarjeta split ────────────────────────────────────────────────────────── */
.lfauth {
    position:relative; z-index:2; width:100%; max-width:880px;
    display:grid; grid-template-columns:1fr 1fr;
    background:var(--paper); border:1px solid var(--line);
    border-radius:22px; overflow:hidden;
    box-shadow:0 40px 90px -34px rgba(13,45,90,.42), 0 6px 20px -12px rgba(13,45,90,.24);
}

/* Botón cerrar (solo en modal). */
.lfauth__x {
    position:absolute; top:14px; right:14px; z-index:6; width:34px; height:34px;
    display:none; align-items:center; justify-content:center;
    border:1px solid rgba(255,255,255,.28); border-radius:10px;
    background:rgba(255,255,255,.14); color:#fff; cursor:pointer; transition:all .15s;
}
.lfauth-overlay .lfauth__x { display:inline-flex; }
.lfauth__x:hover { background:rgba(255,255,255,.26); }

/* ── Panel izquierdo: credenciales ────────────────────────────────────────── */
.lfauth__cred { padding:42px 40px 34px; display:flex; flex-direction:column; }
.lfauth__logo { height:40px; width:auto; display:block; margin-bottom:26px; }
.lfauth__brandlogo { margin-bottom:24px; }
.lfauth__brandlogo .lfbrand__mark { height:46px; width:46px; }
.lfauth__brandlogo .lfbrand__name { font-size:24px; }
.lfauth__eyebrow { font-family:var(--f-mono); font-size:11px; letter-spacing:.16em; text-transform:uppercase; color:var(--az-500); margin:0 0 8px; }
.lfauth__title { font-family:var(--f-disp); font-size:27px; font-weight:700; letter-spacing:-.02em; color:var(--ink); margin:0 0 6px; }
.lfauth__sub { font-size:13.5px; color:var(--ink-2); margin:0 0 22px; }

/* ⚠️ Los controles que ocupan todo el ancho tienen que MEDIR todo el ancho.
   Sin esto, `width:100%` es el ancho del CONTENIDO y el relleno se suma por fuera: medido en
   navegador sobre una tarjeta con 360 px útiles, la casilla salía 390, el botón de Google 386
   y el de acceso 392 — todos desbordando el cuadro y descentrados respecto a él.
   El <button> se libraba por casualidad: el navegador ya le da border-box de fábrica. Los <a>
   y los <input> no, así que el fallo sólo se veía en unos cuantos.
   NO se pone un border-box a toda la página a propósito: encogería el chip del QR de /login
   —196 de contenido pasarían a 196 totales— y ahí el tamaño es crítico para que el código se
   pueda escanear. Se arregla lo que está roto y nada más. */
.lfauth-input, .lfauth-submit, .lfauth-google { box-sizing:border-box; }

.lfauth-field { margin-bottom:14px; }
.lfauth-label { display:block; font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-2); margin-bottom:6px; }
.lfauth-input {
    width:100%; padding:12px 14px; font-family:var(--f-body); font-size:14px; color:var(--ink);
    background:var(--paper-2); border:1px solid var(--line-2); border-radius:11px; outline:none;
    transition:border-color .15s, box-shadow .15s, background .15s;
}
.lfauth-input::placeholder { color:var(--ink-3); }
.lfauth-input:focus { border-color:var(--az-500); background:#fff; box-shadow:0 0 0 3px rgba(21,101,216,.13); }

.lfauth-row { display:flex; align-items:center; justify-content:space-between; margin:4px 0 18px; font-size:12.5px; }
.lfauth-check { display:inline-flex; align-items:center; gap:8px; color:var(--ink-2); cursor:pointer; user-select:none; }
.lfauth-check input { width:15px; height:15px; accent-color:var(--az-500); }
.lfauth-link { color:var(--az-500); text-decoration:none; font-weight:600; }
.lfauth-link:hover { text-decoration:underline; }

.lfauth-submit {
    width:100%; display:inline-flex; align-items:center; justify-content:center; gap:9px;
    padding:13px 16px; font-family:var(--f-body); font-size:14.5px; font-weight:600; color:#fff;
    background:var(--grad-brand); background-size:160% 160%; background-position:0% 50%;
    border:0; border-radius:12px; cursor:pointer;
    box-shadow:0 14px 30px -12px rgba(21,101,216,.6); transition:background-position .5s ease, transform .15s, box-shadow .2s;
}
.lfauth-submit:hover { background-position:100% 50%; transform:translateY(-1px); box-shadow:0 18px 36px -12px rgba(21,101,216,.66); }
.lfauth-submit:active { transform:translateY(0); }
.lfauth-submit svg { flex:none; }

.lfauth-div { display:flex; align-items:center; gap:12px; margin:20px 0 16px; color:var(--ink-3); font-size:11px; letter-spacing:.1em; text-transform:uppercase; }
.lfauth-div::before, .lfauth-div::after { content:""; flex:1; height:1px; background:var(--line); }

.lfauth-google {
    display:flex; align-items:center; justify-content:center; gap:11px; width:100%; padding:12px;
    font-family:var(--f-body); font-size:14px; font-weight:600; color:#3c4043; text-decoration:none;
    background:#fff; border:1px solid var(--line-2); border-radius:12px;
    box-shadow:0 1px 2px rgba(13,45,90,.06); transition:box-shadow .2s, transform .2s, border-color .2s;
}
.lfauth-google:hover { box-shadow:0 8px 20px -8px rgba(13,45,90,.22); transform:translateY(-1px); border-color:var(--line); }
.lfauth-google svg { flex:none; }

.lfauth-foot { text-align:center; margin:22px 0 0; font-size:12.5px; color:var(--ink-3); }

/* Alertas */
.lfauth-alert { padding:11px 13px; border-radius:11px; font-size:12.8px; line-height:1.45; margin-bottom:15px; display:flex; gap:8px; align-items:flex-start; }
.lfauth-alert--err { background:#fdecec; color:#b42318; border:1px solid #f6c9c6; }
.lfauth-alert--info { background:#eaf2fd; color:#1257b0; border:1px solid #cfe0f8; }
.lfauth-alert--ok { background:#e9f8ef; color:#1a7a44; border:1px solid #c4ead3; }

/* ── Panel derecho: marca + QR ────────────────────────────────────────────── */
.lfauth__brand {
    position:relative; padding:42px 36px; color:#fff; overflow:hidden;
    display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;
    background:var(--grad-brand);
}
/* textura de puntos + halo */
.lfauth__brand::before {
    content:""; position:absolute; inset:0; pointer-events:none; opacity:.5;
    background-image:radial-gradient(rgba(255,255,255,.16) 1px, transparent 1.4px);
    background-size:22px 22px;
    -webkit-mask-image:radial-gradient(80% 70% at 50% 42%, #000 30%, transparent 80%);
            mask-image:radial-gradient(80% 70% at 50% 42%, #000 30%, transparent 80%);
}
.lfauth__brand::after {
    content:""; position:absolute; width:340px; height:340px; top:-90px; right:-120px; border-radius:50%;
    background:radial-gradient(circle, rgba(52,211,153,.5), transparent 62%); filter:blur(20px); pointer-events:none;
    animation:lfauth-halo 16s ease-in-out infinite alternate;
}
@keyframes lfauth-halo { 0%{transform:translate(0,0) scale(1);} 100%{transform:translate(-30px,40px) scale(1.15);} }

.lfauth__brand-in { position:relative; z-index:2; display:flex; flex-direction:column; align-items:center; }
.lfauth__brand-eyebrow { font-family:var(--f-mono); font-size:10.5px; letter-spacing:.2em; text-transform:uppercase; color:rgba(255,255,255,.82); margin:0 0 6px; }
.lfauth__brand-title { font-family:var(--f-disp); font-size:19px; font-weight:600; letter-spacing:-.01em; margin:0 0 20px; color:#fff; }

/* Chip QR (marco blanco tipo Steam) */
.lfauth-qr { position:relative; width:196px; height:196px; border-radius:18px; background:#fff; padding:12px;
    box-shadow:0 22px 44px -18px rgba(4,20,45,.6); }
.lfauth-qr__canvas { display:block; width:100%; height:100%; border-radius:8px; }
/* Logo al centro. 46px sobre un lienzo de 172 = 7,1% del área; a 62px tapaba el 15,8% y
   el código dejaba de leerse — ni el móvil ni un decodificador de escritorio podían con él.
   Cualquier retoque aquí hay que comprobarlo escaneándolo de verdad, no a ojo. */
.lfauth-qr__logo {
    position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
    width:46px; height:46px; border-radius:12px; background:#fff; padding:6px;
    box-shadow:0 3px 10px rgba(4,20,45,.22); display:flex; align-items:center; justify-content:center;
}
.lfauth-qr__logo svg { width:100%; height:100%; overflow:visible; display:block; }
/* barrido de escaneo */
.lfauth-qr__scan {
    position:absolute; left:12px; right:12px; height:22px; top:12px; border-radius:6px; pointer-events:none;
    background:linear-gradient(180deg, rgba(21,101,216,0), rgba(46,158,90,.28) 50%, rgba(21,101,216,0));
    box-shadow:0 0 14px 2px rgba(52,211,153,.35);
    animation:lfauth-scan 2.8s cubic-bezier(.5,0,.5,1) infinite;
}
@keyframes lfauth-scan { 0%{transform:translateY(0); opacity:0;} 12%{opacity:1;} 88%{opacity:1;} 100%{transform:translateY(150px); opacity:0;} }
/* parpadeo suave al regenerar el código */
.lfauth-qr__canvas.is-refresh { animation:lfauth-qrefresh .42s ease; }
@keyframes lfauth-qrefresh { 0%{opacity:1;} 40%{opacity:.28;} 100%{opacity:1;} }

.lfauth__brand-cap { margin:20px 0 0; font-size:13px; color:rgba(255,255,255,.92); max-width:220px; line-height:1.5; }
/* Estado "código vivo" — se lee funcional: el código se renueva solo. */
.lfauth__brand-status {
    display:inline-flex; align-items:center; gap:7px; margin-top:16px;
    font-family:var(--f-mono); font-size:11px; letter-spacing:.14em; text-transform:uppercase;
    color:rgba(255,255,255,.9);
}
.lfauth__brand-status::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--em-400); box-shadow:0 0 9px var(--em-400); animation:lfauth-pulse 1.9s infinite; }
.lfauth__brand-code { font-family:var(--f-mono); font-size:12px; letter-spacing:.22em; color:rgba(255,255,255,.72); margin-top:9px; }
@keyframes lfauth-pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* ── Responsive: en móvil se oculta el panel QR (scan-con-teléfono no aplica) ── */
@media (max-width:760px) {
    .lfauth { grid-template-columns:1fr; max-width:420px; }
    .lfauth__brand { display:none; }
    .lfauth__cred { padding:34px 24px 28px; }
    .lfauth-overlay { padding:0; align-items:stretch; }
    .lfauth-overlay .lfauth { border-radius:0; min-height:100dvh; max-width:100%; box-shadow:none; }
    .lfauth-overlay .lfauth__cred { justify-content:center; }
}

@media (prefers-reduced-motion: reduce) {
    .lfauth-page::before, .lfauth__brand::after, .lfauth-qr__scan, .lfauth__soon::before,
    .lfauth-overlay .lfauth { animation:none !important; }
    .lfauth-overlay { transition:none; }
}
