:root {
    --primary-color: #003366; /* Azul oscuro institucional */
    --secondary-color: #0055a5; /* Azul más claro */
    --bg-color: #f4f4f9;
    --text-color: #333;
    --card-bg: #ffffff;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
    max-width: 1000px; /* Ancho aumentado para dar aire a los 3 bloques */
    margin: 0 auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- CABECERA (GRID LAYOUT) --- */
.header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.branding {
    display: grid;
    /* Lógica de centrado perfecto:
       Columna 1 (1fr) y Columna 3 (1fr) ocupan el mismo espacio disponible,
       forzando a la Columna 2 (auto) a quedarse en el centro exacto.
    */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

/* Bloque Izquierdo (Logo) */
.brand-left {
    justify-self: start; /* Pegado a la izquierda */
}

.img-logo {
    max-height: 75px; /* Tamaño ajustado */
    width: auto;
    object-fit: contain;
}

/* Bloque Central (Títulos) */
.brand-center-text {
    justify-self: center; /* Centrado en su celda */
    text-align: center;
    white-space: nowrap; /* Intenta mantener el título en una línea */
}

.brand-center-text h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-top: 5px;
    margin-bottom: 0;
}

/* Bloque Derecho (Campaña) */
.brand-right {
    justify-self: end; /* Pegado a la derecha */
}

.img-campana {
    max-height: 90px; /* Un poco más grande para destacar */
    width: auto;
    object-fit: contain;
}

/* --- FORMULARIO --- */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #fbfbfb;
    border-radius: 8px;
    border-left: 5px solid var(--secondary-color);
}

h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #444;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(0, 85, 165, 0.2);
}

.row { display: flex; gap: 15px; }
.col { flex: 1; }

button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

button:hover {
    background-color: var(--secondary-color);
}

button:active {
    transform: scale(0.98);
}

.hidden { display: none; }

/* --- RESPONSIVE (CELULARES) --- */
@media (max-width: 850px) {
    .branding {
        display: flex;
        flex-direction: column; /* Apilar verticalmente */
        gap: 15px;
        text-align: center;
    }
    
    /* Reordenar visualmente en móvil si se desea */
    .brand-left { order: 1; align-self: center; }
    .brand-center-text { order: 2; white-space: normal; } /* Permitir salto de línea */
    .brand-right { order: 3; align-self: center; }

    .img-logo, .img-campana {
        max-height: 70px; /* Reducir tamaño en móvil */
    }

    .row { flex-direction: column; gap: 0; }
    .container { padding: 15px; }
}