/* ==========================================================================
   Estilos Generales del Sistema de Control de Asistencia Biométrico
   Identidad visual basada en logoI.png y Tailwind CSS (Cero Bootstrap)
   ========================================================================== */

:root {
    --brand-navy: #1D3D5C;
    --brand-dark: #0D1F2D;
    --brand-teal: #309DAA;
    --brand-teal-hover: #237A84;
    --brand-teal-light: #E8F6F7;
    --brand-surface: #F8FAFC;
    --brand-border: #E2E8F0;
    --brand-emerald: #059669;
    --brand-rose: #E11D48;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Compatibilidad de visibilidad para elementos dinámicos */
.d-none {
    display: none !important;
}

/* ==========================================================================
   Contenedor de Cámara y Video (Mobile First y Desktop)
   ========================================================================== */

.camera-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #0D1F2D;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 30px -8px rgba(13, 31, 45, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.camera-video {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transform: scaleX(-1); /* Efecto espejo */
    display: block;
}

.camera-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1);
}

/* Guía Ovalada Biométrica para el Rostro */
.face-guide-oval {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52%;
    height: 72%;
    border: 2.5px dashed rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(13, 31, 45, 0.55);
    pointer-events: none;
    transition: border-color 0.3s ease, border-style 0.3s ease, box-shadow 0.3s ease;
}

.face-guide-oval.active {
    border-color: #309DAA;
    border-style: solid;
    animation: pulseBorder 1.8s infinite ease-in-out;
}

.face-guide-oval.warning {
    border-color: #F59E0B;
    border-style: dashed;
}

@keyframes pulseBorder {
    0% {
        box-shadow: 0 0 0 9999px rgba(13, 31, 45, 0.55), 0 0 12px rgba(48, 157, 170, 0.7);
    }
    50% {
        box-shadow: 0 0 0 9999px rgba(13, 31, 45, 0.55), 0 0 24px rgba(48, 157, 170, 0.95);
    }
    100% {
        box-shadow: 0 0 0 9999px rgba(13, 31, 45, 0.55), 0 0 12px rgba(48, 157, 170, 0.7);
    }
}

/* Indicadores de Estado y Barra de Instrucción sobre la Cámara */
.liveness-badge {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 31, 45, 0.92);
    color: #FFFFFF;
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .liveness-badge {
        font-size: 0.875rem;
        padding: 0.5rem 1.25rem;
        bottom: 14px;
    }
}

/* Botón con animación de atención cuando fallan intentos biométricos */
@keyframes pulseAttention {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(225, 29, 72, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.pulse-button {
    animation: pulseAttention 1.8s infinite;
    border-color: #E11D48 !important;
    color: #E11D48 !important;
    font-weight: 700 !important;
}

/* Touch targets accesibles en móviles */
button, input, select, a {
    touch-action: manipulation;
}
