﻿/* ====== Reset básico ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    /*background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);*/
   /* background: var(--bg-url) no-repeat center center fixed;
    background-size: cover;*/
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    content: "";
    position: relative;
    inset: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: .6;
        transform: scale(1);
    }

    50% {
        opacity: .8;
        transform: scale(1.1);
    }
}

.bg-blur {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: pulse 4s ease-in-out infinite;
}

.bg-blur-1 {
    top: -160px;
    right: -160px;
    width: 320px;
    height: 320px;
    background: rgba(59,130,246,.2);
}

.bg-blur-2 {
    bottom: -160px;
    left: -160px;
    width: 320px;
    height: 320px;
    background: rgba(6,182,212,.2);
    animation-delay: 1s;
}

.bg-blur-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 384px;
    height: 384px;
    background: rgba(168,85,247,.12);
    animation-delay: 2s;
}

.container {
    position: relative;
    width: 100%;
    max-width: 1200px;
}

.login-card {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,.3);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

.left-side {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #06b6d4 100%);
    padding: 48px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

    .left-side::before, .left-side::after {
        content: '';
        position: absolute;
        border-radius: 50%;
        background: rgba(255,255,255,.12);
    }

    .left-side::before {
        top: -128px;
        right: -128px;
        width: 256px;
        height: 256px;
    }

    .left-side::after {
        bottom: -96px;
        left: -96px;
        width: 192px;
        height: 192px;
    }

.logo-container {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 48px;
}

.logo-box {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 28px;
    display: inline-block;
}

.logo-img {
    display: block;
    height: 75px; /* ajusta a tu gusto: 48–72px suele ir bien */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}

.logo-text {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 2px;
}

.system-title {
    position: relative;
    z-index: 1;
    text-align: center;
}

    .system-title h2 {
        font-size: 32px;
        font-weight: 800;
        margin-bottom: 12px;
    }

    .system-title p {
        color: rgba(255,255,255,.95);
        font-size: 18px;
        line-height: 1.6;
        max-width: 420px;
    }

.right-side {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Steps */
.step {
    display: none;
}

    .step.active {
        display: block;
        animation: fadeIn .3s ease-in;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    margin-bottom: 24px;
}

    .header h2 {
        font-size: 28px;
        font-weight: 800;
        color: #1e293b;
        margin-bottom: 6px;
    }

    .header p {
        color: #64748b;
    }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 12px;
    padding: 8px 0;
}

    .back-btn:hover {
        color: #1e293b;
    }

.form-group {
    margin-bottom: 18px;
}

    .form-group label {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: #334155;
        margin-bottom: 8px;
    }

.input-wrapper {
    position: relative;
}

    .input-wrapper i {
        position: absolute;
        /*left: 16px;*/
        right: 0px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
    }

.form-control {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all .2s;
}

    .form-control:focus {
        border-color: #3b82f6;
    }

.error-text {
    color: #b91c1c;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.form-control[aria-invalid="true"] {
    border-color: #ef4444;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}

    .password-toggle:hover {
        color: #64748b;
    }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 18px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
}

    .checkbox-label input {
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 4px 12px rgba(59,130,246,.3);
}

    .btn-primary:hover:not(:disabled) {
        transform: scale(1.02);
        box-shadow: 0 6px 16px rgba(59,130,246,.4);
    }

    .btn-primary:disabled {
        opacity: .55;
        cursor: progress;
    }

.auth-methods {
    display: grid;
    gap: 16px;
}

.auth-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    background: #fff;
}

    .auth-method:hover {
        border-color: #3b82f6;
        background: #eff6ff;
    }

.auth-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    transition: transform .2s;
}

.auth-method:hover .auth-icon {
    transform: scale(1.1);
}

.auth-icon.password {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
}

.auth-icon.fingerprint {
    background: linear-gradient(135deg, #a855f7, #ec4899);
}

.auth-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.auth-content p {
    font-size: 14px;
    color: #64748b;
}

.fingerprint-container {
    text-align: center;
    padding: 24px 0;
}

.fingerprint-icon {
    width: 128px;
    height: 128px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

    .fingerprint-icon i {
        font-size: 64px;
        color: #fff;
    }

.fingerprint-container h3 {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.fingerprint-container .username {
    color: #64748b;
    margin-bottom: 6px;
}

    .fingerprint-container .username strong {
        color: #1e293b;
    }

.fingerprint-container .instruction {
    color: #64748b;
    margin-bottom: 18px;
}

.btn-fingerprint {
    background: linear-gradient(135deg, #a855f7, #ec4899);
}

    .btn-fingerprint:hover:not(:disabled) {
        box-shadow: 0 6px 16px rgba(168,85,247,.4);
    }

.footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

    .footer p {
        font-size: 14px;
        color: #64748b;
        margin-bottom: 10px;
    }

    .footer a {
        color: #3b82f6;
        text-decoration: none;
        font-weight: 600;
    }

        .footer a:hover {
            color: #2563eb;
        }

.copyright {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 768px) {
    .login-card {
        grid-template-columns: 1fr;
    }

    .left-side {
        display: none;
    }

    .right-side {
        padding: 32px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    .bg-blur {
        filter: blur(80px);
    }
}

/* Animación de ondas alrededor del icono */
.fingerprint-icon {
    position: relative;
    overflow: visible; /* importante para que se vean las ondas */
}

.fp-wave {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 3px solid rgba(168,85,247,.35); /* violeta suave */
    transform: scale(1);
    opacity: .85;
    animation: fp-ping 1.8s ease-out infinite;
}

    .fp-wave.wave-2 {
        animation-delay: .6s;
        border-color: rgba(236,72,153,.35); /* rosa suave para 2ª onda */
    }

@keyframes fp-ping {
    0% {
        transform: scale(1);
        opacity: .85;
    }

    60% {
        transform: scale(1.6);
        opacity: .35;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* Puntos animados al final del texto */
.instruction .dots::after {
    display: inline-block;
    width: 1.5em; /* espacio donde “parpadean” */
    text-align: left;
    content: "…"; /* relleno inicial por accesibilidad */
    animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
    0% {
        content: "";
    }

    25% {
        content: ".";
    }

    50% {
        content: "..";
    }

    75% {
        content: "...";
    }

    100% {
        content: "";
    }
}

/* Texto principal un poco más visible durante el escaneo */
.fingerprint-container h3 {
    letter-spacing: .2px;
}

/* Respeto a reduce motion */
@media (prefers-reduced-motion: reduce) {
    .fp-wave {
        animation: none;
        opacity: .25;
    }

    .instruction .dots::after {
        animation: none;
        content: "...";
    }
}

/* opcional: evita flicker si autoredirige */
.step#step2 .auth-methods[aria-hidden="true"] {
    display: none;
}

/* Asegura posicionamiento y padding adecuado */
.input-wrapper {
    position: relative; /* <- clave para ubicar el caret */
}

    /* Select moderno sin flecha nativa y con espacio a la derecha */
    .input-wrapper select.form-control {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding-right: 44px; /* espacio para el caret */
        background-color: #fff; /* o el que uses */
    }

    /* El icono de la izquierda ya lo tienes; opcional: que no se solape */
    .input-wrapper > i.fa-user,
    .input-wrapper > i.fa-building,
    .input-wrapper > i.fa-location-dot {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        color: #94a3b8;
    }

    /* Ubicación y estilo del caret de la derecha */
    .input-wrapper .caret {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none; /* el click sigue siendo del select */
        color: #94a3b8;
        font-size: 14px;
        line-height: 1;
    }

    /* Accesibilidad visual en hover/focus */
    .input-wrapper select.form-control:focus + .caret i {
        color: #0ea5e9; /* mismo color de foco que tus inputs */
    }

    /* Estado deshabilitado */
    .input-wrapper select.form-control:disabled {
        background-color: #f1f5f9;
        color: #94a3b8;
    }

        .input-wrapper select.form-control:disabled ~ .caret i {
            color: #cbd5e1;
        }

/* Mismo ancho que las tarjetas de autenticación */
.org-selects,
.auth-methods {
    max-width: 760px; /* ajusta a tu ancho real si difiere */
    margin: 0 auto;
}

    /* Forzar 1 sola columna en esta fila */
    .org-selects .form-row.one-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Tarjeta visual para el bloque de Empresa, imitando las auth cards */
    .org-selects .card-like {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        padding: 14px 16px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

        /* Label más discreto dentro de la tarjeta */
        .org-selects .card-like > label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: #64748b;
            margin-bottom: 6px;
        }

        /* Input wrapper “full width” y alto cómodo como las tarjetas */
        .org-selects .card-like .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            height: 56px; /* altura consistente */
            padding: 0 14px 0 44px; /* deja espacio al ícono */
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            background: #fff;
        }

            /* Ícono dentro del wrapper */
            .org-selects .card-like .input-wrapper > i.fa-building {
                position: absolute;
                left: 14px;
                font-size: 16px;
                color: #94a3b8;
            }

        /* Select ocupa todo */
        .org-selects .card-like select.form-control {
            width: 100%;
            height: 100%;
            border: none;
            outline: none;
            background: transparent;
            font-size: 16px;
            color: #0f172a;
            appearance: none;
            padding-right: 36px; /* espacio para caret */
        }

        /* Caret a la derecha */
        .org-selects .card-like .caret {
            position: absolute;
            right: 12px;
            pointer-events: none;
            color: #94a3b8;
        }

        /* Focus */
        .org-selects .card-like .input-wrapper:focus-within {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
        }

/* Responsive: igual que auth-methods */
@media (max-width: 820px) {
    .org-selects, .auth-methods {
        max-width: 100%;
    }
}

/* Forzar a una sola columna el contenedor que aún tiene 1fr 1fr inline */
.org-selects > .form-row {
    display: grid !important;
    grid-template-columns: 1fr !important; /* ancho completo */
    gap: 16px !important;
}
