:root {
    --c-primary: #184fa4;
    --c-primary-dark: #0d3272;
    --c-primary-mid: #1d63d4;
    --c-primary-light: #eef2ff;
    --c-primary-ultra: #f5f8ff;
    --c-gold: #e9b121;
    --c-gold-dark: #b5880d;
    --c-border: #ced9f0;
    --c-border-soft: #e4ebf8;
    --c-text: #1a2540;
    --c-text-soft: #60718a;
    --c-white: #ffffff;
    --c-surface: #f6f9ff;

    --shadow-card: 0 6px 48px rgba(10, 30, 80, 0.18), 0 1px 6px rgba(10, 30, 80, 0.08);
    --shadow-input: 0 0 0 4px rgba(24, 79, 164, 0.11);

    --radius-xl: 22px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 7px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --tr: all 0.22s var(--ease);
}

html,
body {
    font-family: "Plus Jakarta Sans", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
    color: var(--c-text);
    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: var(--c-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    margin: 1rem auto 2.5rem auto;
    width: 92%;
    max-width: 900px;
    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;
    border-top: 6px solid var(--c-primary);
}

/* 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-family: 'Syne', 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 1.05rem + 1.3vw, 1.9rem);
    line-height: 1.35;
    color: var(--c-primary);
    margin: 0 auto;
    padding-bottom: 0.6rem;
    border-bottom: 1.5px solid var(--c-border-soft);
    letter-spacing: -0.3px;
    max-width: 620px;
    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: var(--c-white);
    padding: 2.75rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    margin: 1rem;
    width: 92%;
    max-width: 900px;
    min-width: 0;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    align-items: center;
    border-top: 6px solid var(--c-primary);
}

main > form.visible {
    display: flex;
}

.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"] {
    width: 100%;
    margin-bottom: 0.2em;
    padding: 0.6em 0.9em;
    border-radius: var(--radius-sm);
    border: 1.5px solid #cad3e8;
    box-sizing: border-box;
    font-size: 1.05rem;
    background: #fff;
    margin-left: auto;
    margin-right: auto;
    transition: var(--tr);
}

.form-control:hover,
select:hover,
input[type="file"]:hover {
    border-color: #a2b8e0;
}

.form-control:focus,
select:focus,
input[type="file"]:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: var(--shadow-input);
}

/* 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;
}

/* Mensaje de error */
.invalid-feedback,
.invalid-feedback.d-block {
    display: block;
    margin-top: 0.1em;
    font-size: 0.95em;
}

/* Títulos de sección (fallback para <h4> sueltos que puedan quedar fuera del wizard) */
h4 {
    color: var(--c-primary);
    font-family: 'Syne', 'Plus Jakarta Sans', sans-serif;
    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 var(--c-border-soft);
    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-family: 'Syne', 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.3px;
    font-size: 1.1rem;
    padding: 0.75em 0;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 45%, var(--c-primary-mid) 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(13, 50, 114, 0.38);
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(13, 50, 114, 0.48);
}

.btn:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

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

/* ===================================================
   ENCABEZADO DE PASO (badge + icono + titulo)
=================================================== */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin-bottom: 1.4rem;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, var(--c-primary-ultra), var(--c-primary-light));
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-sm);
}

.section-badge {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon {
    color: var(--c-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--c-primary-dark);
    letter-spacing: -0.2px;
}

/* ===================================================
   MULTI-STEP FORM
=================================================== */
.form-step {
    display: none;
    flex-direction: column;
    width: 100%;
    animation: stepFadeIn 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.active {
    display: flex;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   STEPS PROGRESS BAR
=================================================== */
.steps-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    margin-bottom: 2.25rem;
    padding: 0 0.25rem;
    width: 100%;
    box-sizing: border-box;
}

.step-connector {
    position: absolute;
    top: 17px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: var(--c-border-soft);
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
    flex: 1;
    cursor: default;
}

.step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8eef7;
    border: 2px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--c-text-soft);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
                box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.step-item.active .step-dot {
    background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary-mid));
    border-color: var(--c-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(24, 79, 164, 0.45);
    transform: scale(1.12);
}

.step-item.done .step-dot {
    background: var(--c-primary);
    border-color: var(--c-primary-dark);
    color: #fff;
}

.step-item.done .step-dot span { display: none; }

.step-item.done .step-dot::after {
    content: '\2713';
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
}

.step-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--c-text-soft);
    font-family: 'Syne', sans-serif;
    text-align: center;
    transition: color 0.3s var(--ease);
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.step-item.active .step-label { color: var(--c-primary); }
.step-item.done .step-label   { color: var(--c-primary-dark); }

/* ===================================================
   STEP NAVIGATION BUTTONS
=================================================== */
.step-nav {
    display: flex;
    gap: 0.85rem;
    margin-top: 2rem;
    width: 100%;
    align-items: stretch;
}

.btn-step {
    font-family: 'Syne', 'Plus Jakarta Sans', sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.78em 1.5em;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
                background 0.2s var(--ease);
}

.btn-next-step {
    background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary-mid));
    color: #fff;
    box-shadow: 0 4px 20px rgba(13, 50, 114, 0.38);
    flex: 1;
    margin-top: 0;
}

.btn-next-step:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(13, 50, 114, 0.48);
}

.btn-next-step:active:not(:disabled) { transform: translateY(0); }

.btn-next-step:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
    filter: grayscale(0.2);
}

.btn-prev-step {
    background: var(--c-surface);
    color: var(--c-primary);
    border: 1.5px solid var(--c-border);
    min-width: 110px;
    margin-top: 0;
}

.btn-prev-step:hover {
    background: var(--c-primary-light);
    border-color: var(--c-primary);
}

/* Submit dentro de step-nav */
.step-nav .btn.btn-submit-step {
    flex: 1;
    margin-top: 0 !important;
    width: auto !important;
}

/* Shake al validar paso invalido */
@keyframes btnShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.btn-shake { animation: btnShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* ===================================================
   STEP PROGRESS RESPONSIVE
=================================================== */
@media (max-width: 500px) {
    .step-label { font-size: 0.58rem; }
    .step-dot   { width: 28px; height: 28px; font-size: 0.78rem; }
    .step-connector { top: 14px; }
    .btn-prev-step { min-width: 80px; font-size: 0.88rem; }
    .section-header { padding: 0.55rem 0.7rem; gap: 0.5rem; }
    .section-title { font-size: 0.98rem; }
}
