/* =============================================
   VARIABLES GLOBALES (Fácil mantenimiento)
   ============================================= */

:root {
    --color-primario: #1a4f8a;
    --color-primario-hover: #15407a;
    --color-texto: #333;
    --color-gris-claro: #808080;
    /* Variables para los bordes con gradiente */
    --borde-gradiente-normal: linear-gradient(white, white), linear-gradient(to bottom, #c1c2c2, #8b8b8b);
    --borde-gradiente-focus: linear-gradient(white, white), linear-gradient(to top, #c1c2c2, #8b8b8b);
}

/* =============================================
   CONFIGURACIÓN BASE
   ============================================= */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
}

body {
    background: url(/Resourcers/validateBg.webp) center / cover no-repeat fixed;
    color: var(--color-texto);
}

/* =============================================
   BARRA SUPERIOR
   ============================================= */
.barra-superior {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 15px 7px;
    font-size: 14px;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.enlace-idioma,
.enlace-superior {
    color: var(--color-gris-claro);
    text-decoration: none;
    transition: color 0.2s;
}

.enlace-idioma {
    margin-right: 12px;
}

.enlace-superior {
    margin-right: 14px;
}

    .enlace-idioma:hover,
    .enlace-superior:hover {
        color: var(--color-gris-claro);
        text-decoration: underline;
    }

/* =============================================
   CONTENEDOR PÁGINA
   ============================================= */
.pagina-inicio .contenedor-pagina {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 95px;
}

.pagina-resultados .contenedor-pagina {
    padding-top: 95px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px;
    align-items: center;
    justify-content: center;
}

/* =============================================
   SECCIÓN BÚSQUEDA
   ============================================= */
.seccion-busqueda {
    width: 100%;
    max-width: 860px;
    position: relative;
    z-index: 1030;
    view-transition-name: barra-buscador;
}

.tarjeta-busqueda {
    border-radius: 10px;
    padding: 36px 40px 0; 
    overflow: visible;
    position: relative;
    z-index: 5;
}

/* =============================================
   FORMULARIO
   ============================================= */
.formulario-busqueda .form-label {
    font-weight: 600;
    color: #444;
    font-size: 20px;
    margin-bottom: 4px;
}

.formulario-busqueda .col-md-3,
.formulario-busqueda .col-md-4 {
    position: relative;
    padding-bottom: 1.5em;
}

.formulario-busqueda .col-md-3 {
    z-index: 1;
}

.formulario-busqueda .col-md-4 {
    z-index: 10;
}

.formulario-busqueda .col-md-2 {
    padding-top: 34px;
}

.formulario-busqueda .text-danger {
    position: absolute;
    bottom: 0;
    left: 20px;
    display: block;
}

/* Campos de texto y selector (Estilos compartidos) */
.formulario-busqueda .form-control,
.disparador-selector {
    border: 4px solid transparent;
    border-radius: 10px;
    background-image: var(--borde-gradiente-normal);
    background-clip: padding-box, border-box;
    background-origin: padding-box, border-box;
    transition: background-image 0.15s, border-color 0.15s;
}

.formulario-busqueda .form-control {
    font-size: 24px;
    padding: 10px;
}

    .formulario-busqueda .form-control:focus,
    .disparador-selector:hover,
    .contenedor-selector:focus-within .disparador-selector {
        background-image: var(--borde-gradiente-focus);
        box-shadow: none;
        outline: none;
    }

    /* Corrección para autocompletado de Chrome */
    .formulario-busqueda .form-control:-webkit-autofill,
    .formulario-busqueda .form-control:-webkit-autofill:hover,
    .formulario-busqueda .form-control:-webkit-autofill:focus {
        -webkit-box-shadow: 0 0 0px 1000px white inset;
        transition: background-color 5000s ease-in-out 0s;
        background-image: var(--borde-gradiente-normal) !important;
        background-clip: padding-box, border-box !important;
        background-origin: padding-box, border-box !important;
    }

/* Botón Buscar */
.boton-buscar {
    background-color: var(--color-primario);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    padding: 9px 0;
    font-size: 20px;
    transition: background-color 0.2s;
}

.boton-buscar:hover {
    background-color: var(--color-primario-hover);
    color: #fff;
}

/* =============================================
   SELECTOR DE PAÍS (Desplegable)
   ============================================= */
.contenedor-selector {
    position: relative;
    z-index: 10;
}

.contenedor-selector:focus-within,
.contenedor-selector:active,
.contenedor-selector:hover {
    z-index: 20;
}

.disparador-selector {
    padding: 9px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #222;
}

.flecha-selector {
    font-size: 0.7rem;
    color: var(--color-gris-claro);
    margin-left: 8px;
}

.desplegable-selector {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #c8d4e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
}

    .desplegable-selector.abierto {
        display: flex;
        flex-direction: column;
    }

.opcion-selector {
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-texto);
    transition: background 0.12s;
}

.opcion-selector:hover,
.opcion-selector.seleccionado {
    background-color: #eef3fb;
    color: var(--color-primario);
    font-weight: 600;
}

/* =============================================
   ÁREA INFERIOR (Logo y Políticas)
   ============================================= */
.area-inferior {
    margin-top: 10px;
    margin-bottom: 10px;
}

.logo-inferior {
    height: 523px;
    margin-bottom: 8px;
}

.enlace-politica {
    color: black;
    font-size: 14px;
    transition: color 0.2s;
}

    .enlace-politica:hover {
        text-decoration: underline;
    }

.separador-politica {
    color: black;
    font-size: 14px;
    margin: 0 4px;
}

.card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.codigo-busqueda {
    letter-spacing: -1px;
    font-size: 2.8rem;
    color: #6A6A6A;
    padding-bottom: 15px
}

.contenedor-notario {
    font-size: 1.4rem; 
    color: #6A6A6A
}


/* =============================================
   ANIMACIONES
   ============================================= */
.contenedor-pagina {
    animation: fade-in-up 0.5s ease-out;
}

.sin-animacion {
    animation: none !important;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* =============================================
   ACCESIBILIDAD Y NAVEGACIÓN POR TECLADO
   ============================================= */

body.usando-raton .form-control:focus,
body.usando-raton .disparador-selector:focus,
body.usando-raton .btn:focus {
    outline: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

body.usando-raton input.form-control:focus,
body.usando-raton .disparador-selector:focus {
    background-image: var(--borde-gradiente-focus) !important;
}

.form-control:focus-visible,
.disparador-selector:focus-visible{
    background-image: linear-gradient(white, white), linear-gradient(var(--color-primario), var(--color-primario)) !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(26, 79, 138, 0.2) !important;
}

.btn:focus-visible,
.btn-light:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(26, 79, 138, 0.4) !important;
}

.opcion-selector.enfocado-teclado {
    background-color: #e9ecef !important;
    color: var(--color-primario) !important;
    border-left: 4px solid var(--color-primario);
}

.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;
}

/* ==========================================================================
   RECUPERACIÓN DEL BACKDROP DE BOOTSTRAP (Fondo oscuro de Modales)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

    .modal-backdrop.fade {
        opacity: 0;
        transition: opacity .15s linear;
    }

    .modal-backdrop.show {
        opacity: 0.5; /* Aquí controlas lo oscuro que es (0.5 = 50% de opacidad) */
    }