/* Fuentes estilo Apple */
@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display&display=swap');

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Overlay principal */
.scanner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease-in-out;
}

/* Área principal del escáner */
.scanner-area {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    text-align: center;
    color: white;
    overflow: hidden;
    animation: fadeInUp 0.4s ease forwards;
    transition: all 0.3s ease;
}

/* Visor de la cámara */
.scanner-video {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.scanner-video video {
    width: 100%;
    display: block;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    margin-bottom: 15px;
    transition: all 0.3s ease;
    object-fit: cover; /* Evita deformaciones */
    height: auto;
}

/* Botón Cerrar (X) */
.btn-cerrar-scanner {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: transparent;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
}

.btn-cerrar-scanner:hover {
    transform: rotate(90deg);
}

/* Mensaje de resultado */
.scanner-resultado-contenedor {
    margin-top: 10px;
    min-height: 30px;
    font-size: 16px;
    font-weight: 500;
    color: #ffffffcc; 
    text-align: center;
    transition: opacity 0.3s ease;
}

/* Botón Validar estilo Apple */
.btn-validar {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background-color: #007AFF;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-validar:hover {
    background-color: #005ecb;
    transform: scale(1.03);
}

.btn-validar:active {
    transform: scale(0.98);
}

/* Animación al abrir */
@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}