/* Estilos generales para el cuerpo */
body {
    font-family: Arial, sans-serif;
    background-color: #F5F6FA;
    text-align: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between;
}

/* Cabecera */
.header {
    display: flex;
    align-items: center;
    background-color: #FAFAFA;
    padding: 20px;
    width: 100%;
    justify-content: space-between;
    position: relative;
    border-bottom: 5px solid #0572AA;
}

/* Contenedor del logo */
.logo-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: auto;
}

/* Logo */
.logo {
    width: 150px;
    height: auto;
}

/* Contenedor del título */
.titulo-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Estilos del título */
.titulo {
    font-size: 24px;
    text-align: center;
    color: #3f3f3f;
    font-weight: bold;
}

/* Contenedor del formulario */
.container {
    width: 40%;
    margin: 110px auto;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0px 0px 10px #ccc;
}

/* Estilo de los campos */
label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}

/* Estilo general de los campos */
input, select {
    padding: 8px;
    margin-bottom: 30px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    font-size: 16px;
    width: 70%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Separación entre los grupos de campos */
label, .documento-container {
    margin-bottom: 15px;
}

/* Contenedor del número de documento */
.documento-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.documento-container input {
    width: 160px;
    padding: 5px;
    margin: 0;
}

.documento-container span {
    font-size: 24px;
    font-weight: bold;
}

/* Botón */
button {
    padding: 10px 15px;
    border: none;
    color: white;
    background: #002b5e;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    border-radius: 5px;
    width: 50%;
}

button:hover {
    background: #001a3d;
}

/* Contenedor de los resultados */
.result {
    margin-top: 20px;
    font-weight: bold;
}

/* Estilos específicos para los botones generados por JS */
.boton-descarga {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    color: white;
    cursor: pointer;
}

.boton-xml {
    background-color: #22641b;
}

.boton-cdr {
    background-color: #810d23;
}

/* Estilo para el contenedor de botones */
#contenedor-botones {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Estilos para el pie de página */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0572aa;
    color: white;
    padding: 20px;
    width: 100%;
    margin-top: auto;
    flex-wrap: wrap;
}

.logo-light-container {
    width: 140px;
    margin-left: 20px;
}

.logo-light {
    width: 100%;
}

.footer-text {
    text-align: right;
    flex-grow: 1; 
    margin-right: 20px;
}

.footer-text p {
    margin: 0;
}

/* Estilo para los enlaces en el pie de página */
.footer-link {
    color: white;
    text-decoration: none;
}

.footer-link:hover {
    color: #142d39; /* Para cuando se pasa el cursor */
    text-decoration: none;
}

/* Para pantallas pequeñas */
@media (max-width: 768px) {
    .container {
        width: 80%;
        margin: 50px auto;
    }

    .logo-container {
        width: 80px;
        align-self: flex-start; /* Asegura que la imagen se mantenga arriba */
        margin-top: 10px;
    }

    .logo {
        width: 100%;
    }

    input, select {
        width: 100%;
        font-size: 14px;
    }

    button {
        width: 100%;
        font-size: 14px;
    }

    /* Cabecera: Ajuste en dispositivos pequeños */
    .header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        padding: 30px 0; /* Ajusta el padding sin afectar el título */
        position: relative; /* Mantiene la imagen en su sitio */
    }
    
    .logo-container {
        position: absolute;
        top: 10px; /* Se mantiene siempre pegado arriba */
        left: 50%;
        transform: translateX(-50%);
    }
    
    .titulo-container {
        margin-top: 15px; /* Elimina cualquier margen superior */
        position: relative;
        top: 10px; /* Ajusta la distancia sin depender del padding del header */
        text-align: center;
        width: 100%;
    }
    
    .titulo {
        font-size: 22px;
        font-weight: bold;
        margin: 0 auto; /* Centra el título sin que dependa del header */
        display: block;
    }

    .documento-container input {
        width: 130px;
        padding: 5px;
        margin: 0;
    }

    /* Pie de página */
    .footer {
        flex-direction: column;
        align-items: center;
    }

    .logo-light-container {
        margin-left: 0;
        margin-bottom: 10px;
    }

    .footer-text {
        text-align: center;
        margin-right: 0;
    }
}

/* Para pantallas aún más pequeñas (como móviles en modo retrato) */
@media (max-width: 480px) {
    .container {
        width: 90%;
        margin: 30px auto;
    }

    input, select {
        font-size: 12px;
    }

    button {
        font-size: 12px;
    }

    .header {
        padding: 15px;
        width: 100%;
        position: relative;
    }

    .titulo-container {
        margin-top: 20px; /* Aumenta la separación del título */
    }

    .titulo {
        font-size: 18px;
        margin-top: 15px;
    }

    .footer {
        padding: 15px;
    }

    .footer-text {
        font-size: 12px;
    }
}