@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Quantico';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/quantico-700.woff2') format('woff2');
}

:root {
            --bg: #0F1620; --surface: #16202C; --surface2: #1C2734;
            --ink: #EEF2F6; --muted: #98A3AE; --faint: #717D89;
            --line: rgba(255,255,255,.075); --hair2: rgba(255,255,255,.14);
            --glass: rgba(22,32,44,.78);
            --a1: #F5B942; --a2: #F5B942; --a3: #34D399;
            --goldink: #F5B942; --goldsoft: rgba(245,185,66,.10); --goldline: rgba(245,185,66,.45);
            --ok: #34D399; --danger: #F87171;
            --gridline: rgba(245,185,66,.16); --glow: rgba(245,185,66,.18);
            --field: rgba(15,22,32,.7); --shadow: rgba(0,0,0,.6);
            --logofx: brightness(0) invert(1);
        }
        html[data-theme="light"] {
            --bg: #F2F1F0; --surface: #FFFFFF; --surface2: #F7F6F8;
            --ink: #16202A; --muted: #6B6F72; --faint: #8A9096;
            --line: rgba(16,24,32,.09); --hair2: rgba(16,24,32,.16);
            --glass: rgba(255,255,255,.88);
            --a1: #E2A32B; --a2: #E2A32B; --a3: #0E8A5F;
            --goldink: #8A5A0B; --goldsoft: rgba(226,163,43,.14); --goldline: rgba(226,163,43,.55);
            --ok: #0E8A5F; --danger: #B42318;
            --gridline: rgba(16,24,32,.08); --glow: rgba(226,163,43,.14);
            --field: #F7F6F8; --shadow: rgba(16,24,32,.18);
            --logofx: brightness(0);
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        html, body { height: 100%; }
        body {
            font-family: 'IBM Plex Sans', system-ui, sans-serif;
            background: var(--bg);
            color: var(--ink);
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
        }

        /* ---------- Fondo: grilla 3D en perspectiva + auroras ---------- */
        .scene { position: fixed; inset: 0; overflow: hidden; perspective: 900px; z-index: 0; }
        .grid {
            position: absolute; left: -50%; right: -50%; bottom: -30%; height: 90%;
            background-image:
                linear-gradient(var(--gridline) 1px, transparent 1px),
                linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
            background-size: 64px 64px;
            transform: rotateX(72deg);
            transform-origin: center top;
            animation: gridMove 6s linear infinite;
            mask-image: linear-gradient(to top, #000 10%, transparent 85%);
            -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
        }
        @keyframes gridMove { to { background-position: 0 64px; } }
        .aurora { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .22; }
        .aurora--1 { width: 520px; height: 520px; background: var(--a1); top: -160px; left: -120px; animation: float 14s ease-in-out infinite; }
        .aurora--2 { width: 420px; height: 420px; background: var(--a2); top: 30%; right: -140px; opacity: .18; animation: float 18s ease-in-out infinite reverse; }
        .aurora--3 { width: 360px; height: 360px; background: var(--a3); bottom: -160px; left: 35%; opacity: .2; animation: float 16s ease-in-out infinite; }
        @keyframes float { 50% { transform: translate(40px, 30px) scale(1.08); } }

        /* ---------- Layout ---------- */
        .layout {
            position: relative; z-index: 1; min-height: 100vh;
            display: grid; grid-template-columns: 1.1fr 1fr; align-items: center;
            gap: 48px; max-width: 1240px; margin: 0 auto; padding: 48px 32px;
        }

        /* ---------- Lado marca con cubo 3D ---------- */
        .brand { display: flex; flex-direction: column; gap: 36px; }
        .brand__logo { height: 188px; width: auto; align-self: flex-start; filter: var(--logofx); }
        .pill {
            display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
            padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
            background: var(--surface); font-size: 12px; color: var(--muted); letter-spacing: .04em;
        }
        .pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
        .headline {
            font-family: 'Quantico', sans-serif; text-transform: uppercase;
            font-size: clamp(34px, 4.4vw, 58px); font-weight: 800; line-height: 1.04; letter-spacing: -.035em;
        }
        .headline span {
            background: none; color: var(--a1);
            
        }
        .lead { color: var(--muted); font-size: 17px; line-height: 1.6; max-width: 500px; }

        .stage { display: flex; align-items: center; gap: 40px; }
        .cube-wrap { perspective: 800px; width: 150px; height: 150px; flex-shrink: 0; }
        .cube {
            position: relative; width: 100%; height: 100%;
            transform-style: preserve-3d; animation: spin 16s linear infinite;
        }
        .cube__face {
            position: absolute; inset: 0;
            border: 1px solid var(--goldline);
            background: var(--goldsoft);
            box-shadow: inset 0 0 30px var(--glow);
            display: grid; place-items: center; color: var(--a1);
        }
        .cube__face svg { width: 42px; height: 42px; opacity: .9; }
        .cube__face:nth-child(1) { transform: rotateY(0deg)   translateZ(75px); }
        .cube__face:nth-child(2) { transform: rotateY(90deg)  translateZ(75px); }
        .cube__face:nth-child(3) { transform: rotateY(180deg) translateZ(75px); }
        .cube__face:nth-child(4) { transform: rotateY(-90deg) translateZ(75px); }
        .cube__face:nth-child(5) { transform: rotateX(90deg)  translateZ(75px); }
        .cube__face:nth-child(6) { transform: rotateX(-90deg) translateZ(75px); }
        @keyframes spin { from { transform: rotateX(-22deg) rotateY(0); } to { transform: rotateX(-22deg) rotateY(360deg); } }

        .features { list-style: none; display: grid; gap: 14px; }
        .features li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.5; }
        .features svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--ok); }
        .foot { font-size: 12px; color: var(--faint); }

        /* ---------- Tarjeta login con tilt 3D ---------- */
        .panel { perspective: 1200px; display: flex; justify-content: center; }
        .card {
            position: relative; width: 100%; max-width: 440px; padding: 44px 40px;
            border-radius: 24px; background: var(--glass);
            backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
            border: 1px solid var(--line);
            box-shadow: 0 30px 80px -24px var(--shadow);
            transform-style: preserve-3d;
            transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
            transition: transform .25s ease-out;
            animation: rise .9s cubic-bezier(.2,.8,.2,1) both;
        }
        @keyframes rise { from { opacity: 0; transform: translateY(40px) rotateX(18deg); } }
        /* borde gradiente animado */
        .card::before {
            content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
            background: conic-gradient(from var(--ang, 0deg), transparent 0 65%, var(--goldline), var(--a1), transparent 95%);
            -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            -webkit-mask-composite: xor; mask-composite: exclude;
            animation: rotateAng 5s linear infinite; pointer-events: none;
        }
        @property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
        @keyframes rotateAng { to { --ang: 360deg; } }
        /* brillo que sigue el mouse */
        .card::after {
            content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
            background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 45%);
        }
        .card > * { transform: translateZ(40px); position: relative; z-index: 1; }

        .card__logo { display: none; height: 36px; margin-bottom: 24px; }
        .card__title { font-family: 'Quantico', sans-serif; text-transform: uppercase; font-size: 28px; font-weight: 700; letter-spacing: .01em; }
        .card__sub { color: var(--muted); font-size: 14px; margin: 8px 0 28px; }

        .alert {
            display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 20px;
            border-radius: 12px; font-size: 14px; color: var(--ink);
            background: rgba(248,113,113,.1); border: 1px solid var(--danger);
        }
        .alert svg { width: 18px; height: 18px; color: var(--danger); flex-shrink: 0; }

        .field { position: relative; margin-bottom: 16px; }
        .field input {
            width: 100%; height: 58px; padding: 22px 16px 8px; font: inherit; font-size: 15px; color: var(--ink);
            background: var(--field); border: 1px solid var(--line); border-radius: 14px; outline: none;
            transition: border-color .2s, box-shadow .2s, background .2s;
        }
        .field label {
            position: absolute; left: 16px; top: 19px; font-size: 15px; color: var(--muted);
            pointer-events: none; transition: all .18s ease;
        }
        .field input:focus, .field input:not(:placeholder-shown) { background: var(--surface2); }
        .field input:focus { border-color: var(--a1); box-shadow: 0 0 0 4px var(--goldsoft); }
        .field input:focus + label, .field input:not(:placeholder-shown) + label { top: 9px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--goldink); }
        .toggle {
            position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
            background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; padding: 6px;
        }
        .toggle:hover { color: var(--ink); }

        .submit {
            position: relative; width: 100%; height: 56px; margin-top: 12px; border: 0; border-radius: 14px; cursor: pointer;
            font: inherit; font-weight: 700; font-size: 14px; letter-spacing: .13em; text-transform: uppercase; color: #17202A; overflow: hidden;
            background: var(--a1);
            clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
            box-shadow: 0 0 0 1px var(--goldline), 0 12px 34px -14px rgba(245,185,66,.7);
            transition: transform .15s, box-shadow .2s, background-position .5s;
        }
        .submit:hover { transform: translateY(-2px); filter: brightness(1.06); }
        .submit:active { transform: translateY(1px) scale(.99); }
        .submit::after {
            content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
            transform: skewX(-20deg); animation: shine 3.5s ease-in-out infinite;
        }
        @keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
        .submit.is-loading { pointer-events: none; opacity: .85; }

        .secure { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; font-size: 12px; color: var(--faint); }
        .secure svg { width: 14px; height: 14px; }

        @media (max-width: 960px) {
            .layout { grid-template-columns: 1fr; padding: 32px 16px; }
            .brand { display: none; }
            .card__logo { display: block; }
            .card { padding: 36px 24px; }
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation: none !important; transition: none !important; }
        }
