/* ===== Colores tomados del logo Systemax ===== */
:root {
    --blue: #3b5bdb;
    --blue-l: #5b7cff;
    --blue-d: #2440b8;
    --ink: #1c1e23;
    /* negro del logo */
    --gray: #4b4e55;
    /* gris del logo */
    --soft: #f4f6fb;
    --line: #d9deea;
    --white: #fff;
    --dark: #101218;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    height: 100%
}

body {
    font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--soft);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

/* ===================== FORMULARIO ===================== */
.login {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.2rem, 4vw, 3rem);
    gap: 1.5rem;
    background: var(--white);
}

.back {
    position: absolute;
    top: clamp(1rem, 3vw, 2rem);
    left: clamp(1rem, 3vw, 2.5rem);
    color: var(--gray);
    text-decoration: none;
    font-size: .9rem;
    transition: .25s;
}

.back:hover {
    color: var(--blue);
    transform: translateX(-4px)
}

.login__box {
    width: 100%;
    max-width: 440px;
    animation: rise .9s cubic-bezier(.2, .8, .2, 1) both
}

.login__logo {
    display: block;
    width: clamp(130px, 30vw, 170px);
    margin: 0 auto 1.2rem;
    animation: float 5s ease-in-out infinite
}

.login__title {
    text-align: center;
    font-weight: 800;
    font-size: clamp(2rem, 6vw, 2.8rem);
    color: var(--blue-d);
    letter-spacing: -.02em;
    margin-bottom: 2rem;
}

.login__title span {
    display: block;
    width: 50px;
    height: 6px;
    border-radius: 6px;
    margin: .7rem auto 0;
    background: linear-gradient(90deg, var(--blue), var(--blue-l), var(--blue));
    background-size: 200% 100%;
    animation: slide 2.2s linear infinite;
}

/* Campos con etiqueta flotante */
.field {
    position: relative;
    margin-bottom: 1.1rem
}

.field input {
    width: 100%;
    height: 60px;
    padding: 1.3rem 3rem .4rem 1.2rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--soft);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    outline: none;
    transition: .3s;
}

.field label {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
    transition: .25s;
}

.field input:focus+label,
.field input:not(:placeholder-shown)+label {
    top: .9rem;
    font-size: .72rem;
    color: var(--blue);
    font-weight: 600
}

.field input:focus {
    background: var(--white);
    border-color: var(--blue);
    box-shadow: 0 0 0 5px rgba(59, 91, 219, .14);
    transform: translateY(-2px);
}

.field__bar {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--blue);
    transform: scaleX(0);
    transition: transform .4s;
}

.field input:focus~.field__bar {
    transform: scaleX(1)
}

.eye {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    background: none;
    color: var(--gray);
    cursor: pointer;
    border-radius: 50%;
    transition: .25s;
}

.eye svg {
    width: 22px;
    height: 22px
}

.eye:hover,
.eye.on {
    color: var(--blue);
    background: rgba(59, 91, 219, .1)
}

.error {
    min-height: 1.2rem;
    color: #d6336c;
    font-size: .85rem;
    text-align: center;
    margin-bottom: .4rem
}

.forgot {
    text-align: center;
    color: var(--gray);
    margin-bottom: 1.4rem;
    font-size: .95rem
}

.forgot a,
.register a {
    color: var(--blue-d);
    font-weight: 600;
    text-decoration: none;
    position: relative
}

.forgot a::after,
.register a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 100%;
    background: var(--blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: .3s;
}

.forgot a:hover::after,
.register a:hover::after {
    transform: scaleX(1)
}

/* Botón con brillo */
.btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 58px;
    border: 0;
    border-radius: 40px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--white);
    background: linear-gradient(120deg, var(--blue-d), var(--blue), var(--blue-l));
    background-size: 200% 100%;
    box-shadow: 0 12px 28px -8px rgba(59, 91, 219, .7);
    transition: .35s;
}

.btn span {
    position: relative;
    z-index: 1
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

.btn:hover {
    background-position: 100% 0;
    transform: translateY(-3px);
    box-shadow: 0 18px 34px -10px rgba(59, 91, 219, .85)
}

.btn:active {
    transform: scale(.97)
}

.register {
    text-align: center;
    color: var(--gray);
    margin-top: 1.4rem;
    font-size: .95rem
}

.shake {
    animation: shake .5s
}

.secure {
    display: flex;
    align-items: center;
    gap: .9rem;
    width: 100%;
    max-width: 520px;
    padding: 1rem 1.3rem;
    background: var(--soft);
    border-radius: 14px;
    font-size: .85rem;
    color: var(--gray);
}

.secure svg {
    width: 34px;
    height: 34px;
    flex: none;
    color: var(--blue)
}

/* ===================== ESCENARIO (DERECHA) ===================== */
.stage {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    color: var(--white);
    background:
        radial-gradient(circle at 80% 10%, rgba(59, 91, 219, .45), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(91, 124, 255, .25), transparent 40%),
        linear-gradient(160deg, #191c26, var(--dark));
}

.stage__grid {
    position: absolute;
    inset: 0;
    opacity: .35;
    background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, #000 20%, transparent 75%);
    animation: grid 14s linear infinite;
}

.hex {
    position: absolute;
    border: 3px solid var(--blue);
    opacity: .35;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    background: rgba(59, 91, 219, .12);
    animation: drift 12s ease-in-out infinite;
}

.hex--1 {
    width: 130px;
    height: 130px;
    top: 6%;
    right: 8%
}

.hex--2 {
    width: 70px;
    height: 70px;
    bottom: 14%;
    left: 8%;
    animation-delay: -4s;
    animation-duration: 9s
}

.hex--3 {
    width: 46px;
    height: 46px;
    top: 40%;
    left: 14%;
    animation-delay: -7s;
    animation-duration: 15s
}

.beam {
    position: absolute;
    top: -20%;
    left: 50%;
    width: 140%;
    height: 70%;
    transform-origin: top center;
    background: conic-gradient(from 160deg at 50% 0, transparent 0 10deg, rgba(91, 124, 255, .28) 20deg, transparent 40deg);
    filter: blur(10px);
    animation: sweep 7s ease-in-out infinite alternate;
}

.stage__text {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 420px
}

.stage__text h2 {
    font-weight: 300;
    font-size: clamp(1.8rem, 3.6vw, 2.9rem);
    line-height: 1.12;
    letter-spacing: -.02em
}

.stage__text b {
    font-weight: 800;
    background: linear-gradient(90deg, var(--blue-l), #9db4ff, var(--blue-l));
    background-size: 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: slide 4s linear infinite
}

.stage__text p {
    margin-top: .9rem;
    color: #b8bfd3;
    font-size: .98rem;
    line-height: 1.5
}

/* Cámara */
.cam {
    position: relative;
    z-index: 2;
    width: clamp(170px, 22vw, 250px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, #3a3e4a, #15171d 70%);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, .04), 0 0 0 9px rgba(59, 91, 219, .5), 0 30px 80px -10px rgba(59, 91, 219, .55);
    animation: float 6s ease-in-out infinite;
}

.cam__rec {
    position: absolute;
    top: -6px;
    right: -30px;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, .6);
    font-size: .72rem;
    font-weight: 600;
}

.cam__rec i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3b5c;
    animation: blink 1s infinite
}

.cam__lens {
    position: relative;
    width: 76%;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #07080b;
    overflow: hidden
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--blue)
}

.ring--1 {
    inset: 0;
    border-color: rgba(91, 124, 255, .9);
    border-style: dashed;
    animation: spin 14s linear infinite
}

.ring--2 {
    inset: 12%;
    border-color: rgba(255, 255, 255, .2);
    animation: spin 9s linear infinite reverse;
    border-top-color: var(--blue-l)
}

.ring--3 {
    inset: 26%;
    border-color: rgba(91, 124, 255, .5);
    animation: pulse 2.4s ease-in-out infinite
}

.iris {
    --x: 0px;
    --y: 0px;
    width: 34%;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(var(--x), var(--y));
    transition: transform .25s ease-out;
    background: radial-gradient(circle at 35% 30%, #9db4ff, var(--blue) 45%, #0a1033 90%);
    box-shadow: 0 0 30px 6px rgba(91, 124, 255, .7);
}

.iris span {
    display: block;
    width: 26%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    margin: 22% 0 0 24%;
    opacity: .85
}

.stage.focus .iris {
    box-shadow: 0 0 50px 14px rgba(91, 124, 255, .95);
    width: 40%
}

.cam__scan {
    position: absolute;
    left: 12%;
    right: 12%;
    height: 2px;
    top: 20%;
    background: var(--blue-l);
    box-shadow: 0 0 14px 3px var(--blue-l);
    animation: scan 3s ease-in-out infinite;
    border-radius: 2px;
}

.cam__corners i {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid var(--blue-l)
}

.cam__corners i:nth-child(1) {
    top: -30px;
    left: -30px;
    border-right: 0;
    border-bottom: 0
}

.cam__corners i:nth-child(2) {
    top: -30px;
    right: -30px;
    border-left: 0;
    border-bottom: 0
}

.cam__corners i:nth-child(3) {
    bottom: -30px;
    left: -30px;
    border-right: 0;
    border-top: 0
}

.cam__corners i:nth-child(4) {
    bottom: -30px;
    right: -30px;
    border-left: 0;
    border-top: 0
}

.chips {
    position: relative;
    z-index: 2;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .7rem;
    width: 100%;
    max-width: 340px;
    margin-top: 1rem
}

.chips li {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 1.1rem;
    border-radius: 14px;
    font-size: .9rem;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(6px);
    animation: rise .8s both;
    transition: .3s;
}

.chips li:nth-child(2) {
    animation-delay: .15s
}

.chips li:nth-child(3) {
    animation-delay: .3s
}

.chips li:hover {
    transform: translateX(8px);
    border-color: var(--blue-l);
    background: rgba(59, 91, 219, .2)
}

.chips svg {
    width: 26px;
    height: 26px;
    color: var(--blue-l);
    flex: none
}

/* ===================== PANTALLA DE CARGA ===================== */
.loader {
    position: fixed;
    inset: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    background: radial-gradient(circle at center, #1e2540, var(--dark) 70%);
    color: var(--white);
    clip-path: circle(0% at 50% 60%);
    pointer-events: none;
    transition: clip-path .9s cubic-bezier(.7, 0, .2, 1);
}

.loader.show {
    clip-path: circle(150% at 50% 60%);
    pointer-events: all
}

.loader__grid {
    position: absolute;
    inset: 0;
    opacity: .25;
    background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 44px 44px;
    animation: grid 10s linear infinite
}

.loader__core {
    position: relative;
    width: clamp(150px, 38vw, 220px);
    aspect-ratio: 1
}

.hexsvg {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: visible
}

.hexsvg__bg {
    fill: rgba(59, 91, 219, .18);
    stroke: none
}

.hexsvg__line {
    stroke: url(#g);
    stroke-width: 6;
    stroke-dasharray: 520;
    stroke-dashoffset: 520;
    animation: draw 1.8s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px #5b7cff)
}

.aperture .blades path {
    fill: #fff;
    fill-opacity: .88;
    stroke: none
}

.aperture .blades {
    transform-origin: 0 0;
    animation: spin 3s linear infinite
}

.aperture .pupil {
    fill: var(--blue-l);
    animation: pulse 1.2s ease-in-out infinite;
    transform-origin: 0 0;
    filter: drop-shadow(0 0 8px #5b7cff)
}

.aperture {
    animation: iris 2.4s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center
}

.radar {
    position: absolute;
    inset: -18%;
    border-radius: 50%;
    border: 1px solid rgba(91, 124, 255, .4);
    background: conic-gradient(from 0deg, rgba(91, 124, 255, .55), transparent 28%);
    mask-image: radial-gradient(circle, transparent 58%, #000 59%);
    animation: spin 2s linear infinite;
}

.loader__brand {
    position: relative;
    margin-top: 1.6rem;
    font-weight: 800;
    font-size: clamp(1.4rem, 5vw, 2rem);
    letter-spacing: .35em;
    padding-left: .35em
}

.loader__msg {
    position: relative;
    color: #b8bfd3;
    font-size: .95rem;
    min-height: 1.4em;
    text-align: center;
    padding: 0 1rem
}

.loader__bar {
    position: relative;
    width: min(300px, 70vw);
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden
}

.loader__bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--blue-d), var(--blue-l));
    box-shadow: 0 0 14px var(--blue-l);
    transition: width .15s
}

.loader__pct {
    position: relative;
    font-weight: 600;
    font-size: .85rem;
    color: var(--blue-l)
}

.ok {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--dark);
    opacity: 0;
    visibility: hidden;
    transition: .5s
}

.ok svg {
    width: 110px;
    height: 110px;
    stroke: var(--blue-l);
    stroke-width: 3
}

.ok circle {
    stroke-dasharray: 152;
    stroke-dashoffset: 152
}

.ok path {
    stroke-dasharray: 50;
    stroke-dashoffset: 50
}

.ok p {
    font-weight: 600;
    font-size: 1.3rem
}

.loader.done .ok {
    opacity: 1;
    visibility: visible
}

.loader.done .ok circle {
    animation: draw0 .7s .1s forwards
}

.loader.done .ok path {
    animation: draw0 .5s .7s forwards
}

.is-loading {
    overflow: hidden
}

/* ===================== ANIMACIONES ===================== */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(30px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes float {
    50% {
        transform: translateY(-12px)
    }
}

@keyframes slide {
    to {
        background-position: -200% 0
    }
}

@keyframes shine {

    0%,
    60% {
        left: -80%
    }

    100% {
        left: 140%
    }
}

@keyframes shake {

    20%,
    60% {
        transform: translateX(-10px)
    }

    40%,
    80% {
        transform: translateX(10px)
    }
}

@keyframes grid {
    to {
        background-position: 44px 44px
    }
}

@keyframes drift {
    50% {
        transform: translate(-20px, 30px) rotate(25deg)
    }
}

@keyframes sweep {
    from {
        transform: translateX(-50%) rotate(-18deg)
    }

    to {
        transform: translateX(-50%) rotate(18deg)
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes pulse {
    50% {
        transform: scale(1.15);
        opacity: .7
    }
}

@keyframes blink {
    50% {
        opacity: .2
    }
}

@keyframes scan {

    0%,
    100% {
        top: 18%
    }

    50% {
        top: 80%
    }
}

@keyframes draw {
    to {
        stroke-dashoffset: 0
    }
}

@keyframes draw0 {
    to {
        stroke-dashoffset: 0
    }
}

@keyframes iris {
    50% {
        transform: scale(.8)
    }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width:1024px) {
    .cam__rec {
        right: -10px
    }
}

@media (max-width:860px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto
    }

    .stage {
        order: -1;
        padding: 1.5rem 1rem 2rem;
        gap: 1.1rem
    }

    .stage__text h2 {
        font-size: 1.7rem
    }

    .stage__text p,
    .chips {
        display: none
    }

    .cam {
        width: 130px
    }

    .cam__corners i {
        width: 16px;
        height: 16px
    }

    .cam__corners i:nth-child(1) {
        top: -20px;
        left: -20px
    }

    .cam__corners i:nth-child(2) {
        top: -20px;
        right: -20px
    }

    .cam__corners i:nth-child(3) {
        bottom: -20px;
        left: -20px
    }

    .cam__corners i:nth-child(4) {
        bottom: -20px;
        right: -20px
    }

    .login {
        border-radius: 28px 28px 0 0;
        margin-top: -1.4rem;
        position: relative;
        z-index: 3;
        padding-top: 2.8rem
    }

    .back {
        top: 1rem
    }
}

@media (max-width:420px) {
    .field input {
        height: 56px
    }

    .secure {
        font-size: .78rem;
        padding: .8rem
    }

    .cam__rec {
        right: -6px;
        font-size: .62rem
    }
}

@media (max-height:560px) and (orientation:landscape) {
    body {
        grid-template-columns: 1fr 1fr
    }

    .stage__text p,
    .chips {
        display: none
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important
    }
}