/* ==========================================
   LEITOR FACIAL FUTURÍSTICO - SISTEMA DE RECONHECIMENTO 3D
   ========================================== */

.facial-scanner-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    perspective: 1500px;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.facial-scanner-container:hover {
    transform: scale(1.05) translateZ(20px);
}

/* Frame do Scanner */
.scanner-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.1) 0%, rgba(0, 230, 118, 0.1) 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 0 0 2px rgba(26, 115, 232, 0.3),
        0 0 40px rgba(26, 115, 232, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 80px rgba(0, 230, 118, 0.05);
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

.facial-scanner-container:hover .scanner-frame {
    box-shadow: 
        0 0 0 3px rgba(0, 230, 118, 0.6),
        0 0 80px rgba(0, 230, 118, 0.8),
        0 30px 80px rgba(0, 230, 118, 0.3),
        inset 0 0 120px rgba(0, 230, 118, 0.15);
    animation: frame-pulse 2s ease-in-out infinite;
}

@keyframes frame-pulse {
    0%, 100% { 
        transform: translateZ(0px);
    }
    50% { 
        transform: translateZ(10px);
    }
}

/* Cantos do Scanner - Estilo Futurístico */
.scanner-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid #00e676;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.corner-tl {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    border-radius: 5px 0 0 0;
}

.corner-tr {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 5px 0 0;
}

.corner-bl {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 5px;
}

.corner-br {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 5px 0;
}

.facial-scanner-container:hover .corner {
    width: 60px;
    height: 60px;
    border-width: 4px;
    opacity: 1;
    filter: drop-shadow(0 0 15px #00e676);
}

/* Rosto Robótico Ultra-Realista */
.robot-face-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    max-width: 380px;
    object-fit: contain;
    z-index: 2;
    filter: 
        drop-shadow(0 0 30px rgba(26, 115, 232, 0.6))
        drop-shadow(0 0 60px rgba(0, 230, 118, 0.4));
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
    animation: robot-idle 4s ease-in-out infinite;
}

@keyframes robot-idle {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-5px) scale(1.01);
    }
}

.facial-scanner-container:hover .robot-face-image {
    filter: 
        drop-shadow(0 0 50px rgba(26, 115, 232, 1))
        drop-shadow(0 0 80px rgba(0, 230, 118, 0.8))
        brightness(1.1)
        contrast(1.05);
    transform: translate(-50%, -50%) translateZ(40px) scale(1.08);
    animation: robot-activate 2s ease-in-out infinite;
}

@keyframes robot-activate {
    0%, 100% {
        transform: translate(-50%, -50%) translateZ(40px) scale(1.08);
        filter: 
            drop-shadow(0 0 50px rgba(26, 115, 232, 1))
            drop-shadow(0 0 80px rgba(0, 230, 118, 0.8))
            brightness(1.1)
            hue-rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) translateZ(40px) scale(1.1);
        filter: 
            drop-shadow(0 0 60px rgba(26, 115, 232, 1))
            drop-shadow(0 0 100px rgba(0, 230, 118, 1))
            brightness(1.15)
            hue-rotate(10deg);
    }
}

/* Manter compatibilidade com SVG antigo (se necessário) */
.face-svg {
    position: relative;
    width: 70%;
    height: 70%;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(0, 230, 118, 0.5));
    transition: all 0.4s ease;
    transform-style: preserve-3d;
}

.facial-scanner-container:hover .face-svg {
    filter: drop-shadow(0 0 35px rgba(0, 230, 118, 0.9));
    transform: translateZ(30px) scale(1.05);
}

/* Grid de Scan Futurístico */
.scan-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.facial-scanner-container:hover .scan-grid {
    opacity: 0.7;
}

.grid-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, #1a73e8, transparent);
    animation: grid-pulse 2s ease-in-out infinite;
}

.h-line {
    width: 100%;
    height: 1px;
}

.v-line {
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #1a73e8, transparent);
}

@keyframes grid-pulse {
    0%, 100% { 
        opacity: 0.3;
    }
    50% { 
        opacity: 0.8;
    }
}

/* Linha de Scan Principal - Efeito de Varredura */
.main-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 230, 118, 0.3), 
        rgba(0, 230, 118, 1), 
        rgba(0, 230, 118, 0.3), 
        transparent);
    opacity: 0;
    z-index: 5;
    filter: blur(1px);
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.8);
}

.facial-scanner-container:hover .main-scan-line {
    animation: main-scan 2s ease-in-out infinite;
}

@keyframes main-scan {
    0% { 
        top: 0;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% { 
        top: 100%;
        opacity: 0;
    }
}

/* Pontos de Reconhecimento Facial */
.recognition-points {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
}

.point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #00e676;
    border: 2px solid rgba(0, 230, 118, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.3s ease;
}

.facial-scanner-container:hover .point {
    opacity: 1;
    animation: point-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.9);
}

@keyframes point-pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(0, 230, 118, 0.6);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 25px rgba(0, 230, 118, 1);
    }
}

/* Status do Scanner com LED Pulsante */
.scanner-status {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 20px;
    z-index: 8;
    transition: all 0.3s ease;
}

.facial-scanner-container:hover .scanner-status {
    background: rgba(0, 230, 118, 0.15);
    border-color: #00e676;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.5);
}

.status-led {
    width: 10px;
    height: 10px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.8);
    animation: led-pulse 1.5s ease-in-out infinite;
}

@keyframes led-pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.status-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: #00e676;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
}

/* HUD - Heads Up Display */
.hud-display {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    z-index: 8;
    transition: all 0.4s ease;
}

.facial-scanner-container:hover .hud-display {
    opacity: 1;
}

.hud-line {
    font-size: 0.65rem;
    font-weight: 600;
    color: #1a73e8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: rgba(26, 115, 232, 0.15);
    border-left: 2px solid #1a73e8;
    backdrop-filter: blur(5px);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px rgba(26, 115, 232, 0.5);
    animation: hud-typing 3s ease-in-out infinite;
}

@keyframes hud-typing {
    0%, 100% { 
        opacity: 0.7;
    }
    50% { 
        opacity: 1;
    }
}

/* Mensagem de Acesso Liberado */
.access-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px 40px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 3px solid #00e676;
    border-radius: 15px;
    box-shadow: 
        0 0 60px rgba(0, 230, 118, 0.8),
        inset 0 0 40px rgba(0, 230, 118, 0.2);
    z-index: 20;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.facial-scanner-container.scanning .access-message {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: message-entrance 0.6s ease-out;
}

@keyframes message-entrance {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1) rotate(10deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.access-icon {
    width: 80px;
    height: 80px;
    animation: icon-spin 0.8s ease-out;
}

@keyframes icon-spin {
    0% {
        transform: rotate(0deg) scale(0);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.access-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 230, 118, 0.9));
}

.access-text {
    text-align: center;
}

.access-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #00e676;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 
        0 0 20px rgba(0, 230, 118, 1),
        0 0 40px rgba(0, 230, 118, 0.5);
    animation: title-glow 1.5s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(0, 230, 118, 1),
            0 0 40px rgba(0, 230, 118, 0.5);
    }
    50% {
        text-shadow: 
            0 0 30px rgba(0, 230, 118, 1),
            0 0 60px rgba(0, 230, 118, 0.8),
            0 0 80px rgba(0, 230, 118, 0.4);
    }
}

.access-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a73e8;
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Onda de Energia ao Ativar */
.energy-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 230, 118, 0.4), transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 15;
}

.facial-scanner-container.scanning .energy-wave {
    animation: energy-blast 1s ease-out;
}

@keyframes energy-blast {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 500px;
        height: 500px;
        opacity: 0;
    }
}

/* Responsividade */
@media (max-width: 968px) {
    .facial-scanner-container {
        max-width: 350px;
    }
    
    .corner {
        width: 40px;
        height: 40px;
    }
    
    .access-message {
        padding: 25px 30px;
    }
    
    .access-title {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
    
    .access-icon {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 640px) {
    .facial-scanner-container {
        max-width: 300px;
    }
    
    .corner {
        width: 30px;
        height: 30px;
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .scanner-status {
        padding: 6px 15px;
        gap: 8px;
    }
    
    .status-text {
        font-size: 0.65rem;
    }
    
    .hud-display {
        gap: 3px;
        left: 10px;
        bottom: 10px;
    }
    
    .hud-line {
        font-size: 0.55rem;
        padding: 2px 6px;
    }
    
    .access-message {
        padding: 20px 25px;
        gap: 10px;
    }
    
    .access-title {
        font-size: 1rem;
        letter-spacing: 1.5px;
    }
    
    .access-subtitle {
        font-size: 0.75rem;
    }
    
    .access-icon {
        width: 50px;
        height: 50px;
    }
}
