/* ----------------------
   ESTILOS GLOBALES
----------------------- */

:root {
            --azul-principal: #005aa8;
            --rosado-acento: #ed008a;
            --gris-claro: #bdbebf;
            --blanco: #ffffff;
            --texto-oscuro: #333;
            --gris-fondo: #f2f2f2;
            --color-exito: #27ae60;
        }

        .logo {
            width: 80px;
            /* Un tamaño más discreto para la esquina */
            margin: 0 auto 0.05rem auto;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            background-color: #f5f5fa;
            margin: 0;
            padding: 2rem;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .modal {
            width: 100%;
            max-width: 800px;
            background: var(--blanco);
            box-shadow: 0px 47px 47px rgba(0, 0, 0, 0.09);
            border-radius: 26px;
            overflow: hidden;
            /* Clave para que los pasos no se desborden */
        }

        .form {
            display: flex;
            flex-direction: column;
            gap: 25px;
            padding: 2.5rem;
        }

        /* === NUEVO: ESTILOS PARA EL INDICADOR DE PASOS === */
        .step-indicator {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            position: relative;
            margin-bottom: 30px;
        }

        .step {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 1;
        }

        .step-number {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--gris-fondo);
            color: #888;
            display: flex;
            justify-content: center;
            align-items: center;
            font-weight: bold;
            border: 4px solid var(--gris-fondo);
            transition: all 0.4s ease;
        }

        .step-label {
            font-size: 12px;
            color: #888;
            margin-top: 8px;
            transition: all 0.4s ease;
        }

        .step.active .step-number {
            background: var(--blanco);
            border-color: var(--azul-principal);
            color: var(--azul-principal);
        }

        .step.active .step-label {
            color: var(--azul-principal);
            font-weight: 600;
        }

        .step.completed .step-number {
            background: var(--azul-principal);
            border-color: var(--azul-principal);
            color: var(--blanco);
        }

        .step.completed .step-number span {
            display: none;
        }

        .step.completed .step-number::after {
            content: '✔';
            color: var(--blanco);
            font-size: 20px;
        }

        .indicator-line {
            position: absolute;
            top: 20px;
            left: 0;
            height: 4px;
            width: 100%;
            background: var(--gris-fondo);
            z-index: 0;
        }

        .indicator-progress {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            background: var(--azul-principal);
            width: 0%;
            transition: width 0.4s ease;
        }

        /* === ESTILOS PARA LOS PASOS DEL FORMULARIO === */
        .form-step {
            display: none;
            /* Ocultamos todos los pasos por defecto */
        }

        .form-step.active {
            display: block;
            /* Mostramos solo el paso activo */
            animation: fadeIn 0.5s;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Estilos de campos y layout (se mantienen) */
        .form-section h2 {
            font-size: 1rem;
            font-weight: 600;
            color: #555;
            text-align: left;
            border-bottom: 1px solid #eee;
            margin: 0 0 20px 0;
            padding-bottom: 10px;
        }

        .form-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
        }

        .input_container {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .input_label {
            font-size: 10px;
            color: #8b8e98;
            font-weight: 600;
        }

        .input_field {
            width: 100%;
            height: 45px;
            padding: 0 16px;
            border-radius: 9px;
            outline: none;
            background-color: var(--gris-fondo);
            border: 1px solid transparent;
            transition: all 0.3s;
            box-sizing: border-box;
        }

        .input_field.invalid {
            border-color: var(--rosado-acento);
            box-shadow: 0px 0px 0px 2px #ed008b44;
        }

        .errorlist {
            color: var(--rosado-acento);
            list-style: none;
            padding: 5px 0 0 0;
            font-size: 0.9rem;
        }

        /* === ESTILOS PARA BOTONES DE NAVEGACIÓN === */
        .navigation-buttons {
            display: flex;
            justify-content: space-between;
            margin-top: 30px;
        }

        .nav-btn {
            padding: 12px 30px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        #prevBtn {
            background: var(--gris-fondo);
            color: var(--texto-oscuro);
        }

        #prevBtn:hover {
            background: #e0e0e0;
        }

        #nextBtn,
        #submitBtn {
            background: var(--azul-principal);
            color: var(--blanco);
        }

        #nextBtn:hover,
        #submitBtn:hover {
            background: var(--rosado-acento);
        }

        /* Estilos de firmas, etc. (se mantienen) */
        .signature-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .signature-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .signature-subtitle {
            font-weight: 600;
            font-size: 0.9rem;
            color: #555;
            margin-bottom: 10px;
        }

        .signature-pad-container {
            width: 100%;
            padding: 1rem;
            border: 1px dashed var(--gris-claro);
            border-radius: 8px;
            box-sizing: border-box;
        }

        canvas {
            width: 100%;
            max-width: 300px;
            height: 150px;
            background-color: #f2f2f2;
            border-radius: 9px;
            cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><defs><radialGradient id="grad"><stop offset="0%" stop-color="rgba(0,0,0,0.4)"/><stop offset="100%" stop-color="rgba(0,0,0,0)"/></radialGradient></defs><circle cx="16" cy="16" r="8" fill="url(%23grad)"/></svg>') 16 16, auto;
        }

       /* Documento de Identidad ocupa toda la fila en desktop */
        .documento-group {
        grid-column: span 2;
        }

        .documento-group .documento-row {
        display: flex;
        gap: 10px;
        }

        .documento-group .documento-row select {
        flex: 0 0 90px; /* ancho fijo para el V/E/P */
        }

        .documento-group .documento-row input {
        flex: 1; /* ocupa el resto */
        }
        /* Igualar estilos de Documento de Identidad a los demás */



        @media (max-width: 768px) {
        /* Forzar 1 columna real en todos los campos */
        .form-grid {
            display: block !important; /* en vez de grid, fuerza bloque */
        }

        .form-grid .input_container {
            width: 100%;
            margin-bottom: 15px; /* espacio entre campos */
        }

        /* Documento de Identidad sigue especial */
        .documento-group {
            width: 100%;
        }

        .documento-group .documento-row {
            display: flex;
            flex-direction: row;
            gap: 10px;
        }

        .documento-group .documento-row select {
            flex: 0 0 90px;
        }

        .documento-group .documento-row input {
            flex: 1;
        }

        /* ======================================= */
        /* === AQUÍ ESTÁ LA SOLUCIÓN AÑADIDA === */
        /* ======================================= */
            
            /* 1. Usamos el ID para ser MÁS ESPECÍFICOS */
        #signature-minor-view .signature-grid {
                display: block; /* Esto hace que sus hijos (.signature-wrapper) se apilen */
            }

            /* 2. Añadimos un espacio entre las dos firmas */
        #signature-minor-view .signature-grid .signature-wrapper:not(:last-child) {
                margin-bottom: 25px; 
            }
        }



        .clear-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background-color: rgb(242, 242, 242);
            /* Mismo gris que los inputs */
            border: 1px solid #e0e0e0;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.05);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .clear-btn .icon {
            width: 15px;
            transition: all 0.3s ease;
        }

        .clear-btn .icon path {
            fill: #555;
            /* Color del ícono */
        }

        .clear-btn:hover {
            background-color: rgb(255, 69, 69);
            /* Rojo al pasar el mouse */
            border-color: rgb(255, 69, 69);
        }

        .clear-btn:hover .icon path {
            fill: white;
            /* Ícono blanco sobre fondo rojo */
        }

        .clear-container {
            display: flex;
            justify-content: center;
            /* Centra el botón horizontalmente */
            margin-top: 1rem;
        }

        #signature-adult-view .signature-wrapper {
            margin: 0 auto;
            /* Centra el bloque horizontalmente */
            max-width: 342px;
            /* Un ancho máximo para que el centrado funcione */
        }

        /* Para la vista de MENOR DE EDAD: la rejilla ya centra su contenido */
        .signature-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        /* Estilo común para AMBOS contenedores de firma */
        .signature-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* === NUEVO: ESTILOS PARA LA CORTINA DE ESPERA === */
        #loading-overlay {
            position: fixed;
            /* Se queda fija en la pantalla */
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(255, 255, 255, 0.8);
            /* Fondo blanco semitransparente */
            z-index: 9999;
            display: none;
            /* Oculta por defecto */
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(5px);
            /* Efecto de desenfoque del fondo */
        }

        .spinner {
            border: 8px solid #f3f3f3;
            /* Gris claro */
            border-top: 8px solid #005aa8;
            /* Azul principal */
            border-radius: 50%;
            width: 60px;
            height: 60px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }



/* ===========================================
   FORZAR MODO CLARO (Evitar Inversión Automática)
   =========================================== */

/* Pista moderna para el navegador:
  Le decimos que esta página prefiere el esquema claro.
*/
:root {
  color-scheme: light;
}


@media (prefers-color-scheme: dark) {
    
    /* 1. Ponemos un fondo oscuro "exterior" (opcional, pero se ve bien) */
    body {
        background-color: #1e1e1e !important;
    }

    /* 2. Redefinimos todas las variables a sus valores originales 
         para forzar la tarjeta blanca y los colores de marca.
    */
    :root {
        --azul-principal: #005aa8 !important;
        --rosado-acento: #ed008a !important;
        --gris-claro: #bdbebf !important;
        --blanco: #ffffff !important;
        --texto-oscuro: #333 !important;
        --gris-fondo: #f2f2f2 !important;
        --color-exito: #27ae60 !important;
    }

    /* 3. Forzamos los colores de texto que el navegador 
         pudo haber invertido automáticamente.
    */
    .modal {
        background: var(--blanco) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important; /* Sombra más suave para fondo oscuro */
    }

    .step-number {
        color: #888 !important;
    }
    .step-label {
        color: #888 !important;
    }
    .form-section h2 {
        color: #555 !important;
        border-bottom-color: #eee !important;
    }
    .input_label {
        color: #8b8e98 !important;
    }
    .input_field {
        color: var(--texto-oscuro) !important; /* MUY IMPORTANTE */
        background-color: var(--gris-fondo) !important;
    }
    .signature-subtitle {
        color: #555 !important;
    }
    .clear-btn .icon path {
        fill: #555 !important;
    }
    
    /* Forzar la cortina de carga a ser clara */
    #loading-overlay {
        background-color: rgba(255, 255, 255, 0.8) !important;
        backdrop-filter: blur(5px) !important;
    }
    .spinner {
         border-color: #f3f3f3 !important;
         border-top-color: var(--azul-principal) !important;
    }
}
        




        
