html,
body {
    font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
    color: #1b1b18;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden !important;
    background-image: url("../img/bg-ia.jpg");
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Imagen fija */
    background-position: center center;
}

/* Bloque informativo de inscripción, alineado y con secuencia visual igual al formulario */
.container {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.contenido-formulario-inscripcion {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 18px rgba(24, 79, 164, 0.09);
    margin: 1rem auto 2.5rem auto;
    width: 100%;
    max-width: 700px;
    min-width: 0;
    box-sizing: border-box;
    padding: 2.7rem 3.5rem 2.2rem 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    overflow-x: hidden;
}

/* ORGANIZACIÓN PROFESIONAL DE LOS LOGOS */
.contenido-formulario-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin-bottom: 0.85rem;
    overflow-x: hidden;
}

.contenido-logo-group {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.contenido-img-titulo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    display: block;
    box-shadow: 0 2px 10px rgba(30, 60, 90, 0.07);
    padding: 0.25rem 0.7rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.contenido-img-titulo:hover {
    transform: scale(1.07);
    box-shadow: 0 4px 16px rgba(30, 70, 160, 0.13);
}

.contenido-formulario-title {
    text-align: center;
    font-weight: 700;
    font-size: 2.1rem;
    color: #184fa4;
    margin-bottom: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid #e0e3e8;
    letter-spacing: -0.5px;
    width: 100%;
}

.contenido-formulario-inscripcion strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
    font-weight: 600;
    text-align: left;
    width: 100%;
}

.contenido-formulario-inscripcion p {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.6;
    color: #353535;
    text-align: left;
    width: 100%;
}

/* Responsive: móvil y tablet */
@media (max-width: 650px) {
    body {
        background-size: cover;
        background-position: center center;
    }
    .contenido-formulario-inscripcion {
        padding: 1.1rem 0.6rem 1rem 0.6rem;
        border-radius: 12px;
        max-width: 98vw;
        margin: 0.5rem auto 1.5rem auto;
        align-items: center;
        overflow-x: hidden;
    }
    .contenido-formulario-header {
        gap: 0.5rem;
        margin-bottom: 0.7rem;
    }
    .contenido-logo-group {
        gap: 1rem;
    }
    .contenido-img-titulo {
        width: 70px;
        height: 70px;
        padding: 0.15rem 0.4rem;
        margin-bottom: 0.2rem;
        border-radius: 8px;
    }
    .contenido-formulario-title {
        font-size: 1.2rem;
        padding-bottom: 0.3rem;
    }
    .contenido-formulario-inscripcion strong,
    .contenido-formulario-inscripcion p {
        text-align: center;
    }
}
@media (max-width: 400px) {
    body {
        background-size: cover;
        background-position: center center;
    }
    .contenido-formulario-inscripcion {
        padding: 0.5rem 0.25rem 0.7rem 0.25rem;
        border-radius: 10px;
        max-width: 97vw;
        margin: 0.25rem auto 1rem auto;
    }
    .contenido-logo-group {
        gap: 0.6rem;
    }
    .contenido-img-titulo {
        width: 55px;
        height: 55px;
        border-radius: 5px;
        padding: 0.08rem 0.15rem;
    }
    .contenido-formulario-title {
        font-size: 1rem;
    }
    .contenido-formulario-inscripcion strong {
        font-size: 0.97rem;
    }
    .contenido-formulario-inscripcion p {
        font-size: 0.96rem;
    }
}

/* Evita scroll horizontal en todo el bloque */
.contenido-formulario-inscripcion,
.contenido-formulario-header {
    overflow-x: hidden;
}

main > form {
    background: #e4eafc;
    padding: 3.5rem;
    border-radius: 18px;
    box-shadow: 0 2px 18px rgba(24, 79, 164, 0.11);
    margin: 1rem;
    width: 100%;
    max-width: 700px;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

[class^="col-"] {
    width: 100%;
    padding: 0;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Labels arriba, bien claros */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35em;
    text-align: left;
}

/* Inputs, selects y files centrados y anchos */
.form-control,
.form-control-file,
select,
input[type="file"],
input[type="checkbox"] {
    width: 100%;
    margin-bottom: 0.2em;
    padding: 0.55em 0.85em;
    border-radius: 0.55em;
    border: 1px solid #c3c2c2;
    box-sizing: border-box;
    font-size: 1.05rem;
    background: #fff;
    margin-left: auto;
    margin-right: auto;
}

.form-control:focus,
select:focus,
input[type="file"]:focus {
    outline: 2px solid #ecb50070;
    border-color: #184fa4;
}

/* Radios verticales y centrados */
.form-group.genero-group {
    margin-bottom: 1rem;
}
.genero-options {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    margin-left: 0;
    align-items: flex-start;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.2em;
}
.form-check-input {
    margin-left: 0;
    width: 1.5em;
    height: 1.5em;
}

#formulario-inscripcion {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    Opcional: transition-delay: 0.1s;
}
#formulario-inscripcion.visible {
    opacity: 1;
    max-height: 5000px; /* suficiente para mostrar el contenido */
    overflow: visible;
}

/* Mensaje de error */
.invalid-feedback,
.invalid-feedback.d-block {
    display: block;
    margin-top: 0.1em;
    font-size: 0.95em;
}

/* Títulos de sección */
h4 {
    color: #184fa4;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 1.1rem;
    width: 100%;
    text-align: left;
    font-size: 2rem;
    letter-spacing: -0.5px;
}

/* Separador */
hr {
    border-top: 1.5px solid #e0e3e8;
    margin: 32px 0 24px 0;
    width: 100%;
}

.alert-danger {
    font-size: 1rem;
    border-radius: 8px;
    padding: 0.85rem 1.2rem;
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    display: flex;
    align-items: center;
    gap: 0.7em;
    margin-bottom: 1.5rem;
    width: 100%;
}

.btn,
.btn-primary {
    width: 100%;
    margin-top: 1.2rem;
    font-size: 1.15rem;
    padding: 0.7em 0;
}

@media (max-width: 650px) {
    main > form {
        padding: 2rem;
        border-radius: 12px;
        max-width: 98vw;
        margin: 0.5rem;
    }
    h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 400px) {
    main > form {
        padding: 1rem;
        border-radius: 10px;
        max-width: 97vw;
        margin: 0.25rem;
    }
    h4 {
        font-size: 1.05rem;
    }
    label {
        font-size: 0.98rem;
    }
    .btn,
    .btn-primary {
        font-size: 1rem;
        padding: 0.6em 0;
    }
}

/* Entidades search select*/

/* El contenedor padre debe tener position:relative */
.col-12.col-md-6.mb-3 {
    position: relative;
}

/* Sugerencias */
#entidad_suggestions {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-top: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%; /* igual al input */
    min-width: 120px;
    z-index: 100;
    left: 0;
    right: 0;
    transition: box-shadow 0.2s;
}

#entidad_suggestions .list-group-item {
    cursor: pointer;
    font-size: 0.98em;
    white-space: normal;
    padding: 0.5em 1em;
    border: none;
    background: transparent;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    display: block;
    box-sizing: border-box;
    text-align: left;
}

#entidad_suggestions .list-group-item:hover,
#entidad_suggestions .list-group-item:focus {
    background: #1976d2;
    color: #fff;
}

@media (max-width: 576px) {
    #entidad_suggestions {
        font-size: 0.95em;
        max-height: 200px;
    }
    #entidad_suggestions .list-group-item {
        padding: 0.5em 0.6em;
        font-size: 0.95em;
    }
}
