:root {
    --color-fondo: #f5f6f1;
    --fuente-principal: arial;
    --color-letra: #2a407e;
    --color-footer: #ffffff;
    --color-borde: #2a407e;
    --border-radius: 8px;
    --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --padding: 20px;
}

.color-letra {
    color: var(--color-letra);
}

.color-footer {
    color: var(--color-footer);
}

.arial {
    font-family: var(--fuente-principal);
}

body {
    max-width: 100%;
    /* Permite que el cuerpo ocupe todo el ancho */
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--color-fondo);
    text-align: center;
    box-sizing: border-box;
}

header,
nav,
main,
footer {
    max-width: 1200px;
    /* Ancho máximo amplio para pantallas grandes, adaptable */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

header {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 65ch;
    /* Mantiene los párrafos legibles con límite de caracteres */
    margin-left: auto;
    margin-right: auto;
}

footer {
    margin-top: 40px;
    padding: 20px;
    border: 1px solid black;
    border-radius: 8px;
    background-color: #2a407e;
}

.foto-chica {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 150px;
    height: auto;
    margin: 0;
    z-index: 1000;
}

input:focus,
input:hover,
textarea:focus {
    border-color: #2563eb;
    outline: none;
}

.tarjeta {
    background-color: var(--color-fondo);
    padding: var(--padding);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-left: 5px solid var(--color-borde);
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    /* Asegura que la tarjeta ocupe todo el ancho posible */
    box-sizing: border-box;
    text-align: center;
}

/* Estilos para las tablas dentro de los formularios */
form table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

form table tr td {
    padding: 10px;
    vertical-align: middle;
}

/* Alinea las etiquetas de la tabla a la derecha */
form table tr td:first-child {
    text-align: right;
    width: 40%;
    font-weight: bold;
    color: var(--color-letra);
}

/* Los campos de la tabla ocupan el espacio disponible */
form table tr td:last-child {
    text-align: left;
    width: 60%;
}

form input[type="text"],
form input[type="number"],
form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-borde);
    border-radius: var(--border-radius);
    background-color: #ffffff;
    font-family: var(--fuente-principal);
    box-sizing: border-box;
}

a.boton,
button.boton {
    display: inline-block;
    min-height: 44px;
    padding: .6rem 1rem;
    background: #1d4ed8;
    color: #fff;
    border-radius: .4rem;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    border: none;
    cursor: pointer;
    font-family: var(--fuente-principal);
    font-size: 1rem;
}

a.boton:hover,
button.boton:hover,
button[type="submit"]:hover {
    background: #1e48af;
}

a.boton:focus,
button.boton:focus,
button[type="submit"]:focus {
    outline: 3px solid #f59e0b;
}

.banner {
    display: block;
    width: 100%;
    max-width: 1300px;
    height: auto;
    margin: 0 auto;
    object-fit: cover;
    border-radius: 0 0 16px 16px;
    box-shadow: var(--box-shadow);
}

/* Estilo para que el iframe ocupe todo el ancho */
#resultado {
    display: block;
    width: 100%;
    max-width: 1200px; /* Se alinea con el ancho máximo de header/main/footer */
    height: 450px;     /* Altura fija cómoda para ver las respuestas */
    margin: 30px auto; /* Centrado y separado de los formularios */
    border: 1px solid var(--color-borde);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    background-color: var(--color-fondo);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .foto-chica {
        display: block;
        width: 100px;
        height: auto;
        margin: 0 auto 20px auto;
        position: static;
    }

    body {
        padding-top: 20px;
    }

    /* Hace que en celulares cada celda de la tabla se apile verticalmente */
    form table tr td {
        display: block;
        width: 100%;
        text-align: left;
    }

    form table tr td:first-child {
        padding-bottom: 2px;
    }
    
    /* Ajuste para celulares del iframe */
    #resultado {
        height: 350px;
        margin: 20px auto;
    }
}