/* ============================================================
 * FORMULARIO DE INSCRIPCION - ESTILO RENOVADO
 * Ubicacion: css/formulario_moderno.css
 * ------------------------------------------------------------
 * Solo cambia el ASPECTO. No toca ningun campo, id ni script:
 * se carga despues de codebase.min.css y lo sobrescribe.
 * El color de acento cambia con la clase del <body>:
 *   .form-esofa  -> celeste del escudo ESOFA
 *   .form-eofap  -> rojo del escudo EOFAP
 * ============================================================ */

:root {
    --fm-navy-900: #041528;
    --fm-navy-800: #06203f;
    --fm-navy-700: #0a2e57;
    --fm-navy-600: #0f3d72;
    --fm-oro: #e2b33c;
    --fm-oro-claro: #f6d46b;
    --fm-acento: #2f9fd8;
    --fm-acento-suave: #e6f4fb;
    --fm-texto: #1d2a3a;
    --fm-gris: #6b7785;
    --fm-borde: #d9e1ea;
    --fm-radio: 14px;
}
body.form-eofap { --fm-acento: #c8372d; --fm-acento-suave: #fdeceb; }

/* ---------- Fondo ---------- */
body.form-moderno {
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(47, 159, 216, .25), transparent 60%),
        linear-gradient(180deg, var(--fm-navy-800) 0, var(--fm-navy-700) 340px, #eef2f7 340px, #eef2f7 100%);
    background-attachment: scroll;
    color: var(--fm-texto);
    font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
}
body.form-eofap.form-moderno {
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(200, 55, 45, .25), transparent 60%),
        linear-gradient(180deg, var(--fm-navy-800) 0, var(--fm-navy-700) 340px, #eef2f7 340px, #eef2f7 100%);
}
body.form-moderno #page-container,
body.form-moderno #main-container { background: transparent !important; }
body.form-moderno .content { padding-top: 0; max-width: 1180px; }

/* ---------- Encabezado (hero) ---------- */
.fm-hero {
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
    padding: 34px 6px 26px; color: #fff;
}
.fm-hero .fm-escudos { display: flex; align-items: center; gap: 12px; }
.fm-hero .fm-escudos img { height: 78px; width: auto; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); }
.fm-hero .fm-escudos .fm-sep { width: 1px; height: 56px; background: rgba(255,255,255,.25); }
.fm-hero .fm-textos { flex: 1; min-width: 240px; }
.fm-hero .fm-eyebrow {
    display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
    color: var(--fm-oro-claro); margin-bottom: 4px;
}
.fm-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; margin: 0 0 4px; color: #fff; line-height: 1.1; }
.fm-hero p { margin: 0; color: rgba(255,255,255,.75); font-size: .95rem; }
.fm-hero .fm-ayuda {
    display: flex; flex-direction: column; gap: 6px; font-size: .82rem;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px; padding: 12px 16px; color: rgba(255,255,255,.88);
}
.fm-hero .fm-ayuda i { color: var(--fm-oro-claro); width: 16px; }
.fm-hero .fm-ayuda a { color: #fff; font-weight: 600; text-decoration: underline; }

/* ---------- Tarjeta principal ---------- */
body.form-moderno .js-wizard-simple.block {
    border-radius: 20px; overflow: hidden; border: 0;
    box-shadow: 0 24px 60px rgba(4, 21, 40, .18), 0 2px 6px rgba(4, 21, 40, .06);
    background: #fff;
}

/* ---------- Pasos (tabs) ---------- */
body.form-moderno .nav-tabs-block {
    background: #f6f8fb; border-bottom: 1px solid var(--fm-borde);
    padding: 14px 14px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin;
    counter-reset: fmpaso;
}
body.form-moderno .nav-tabs-block .nav-item { flex: 1 0 auto; }
body.form-moderno .nav-tabs-block .nav-link {
    position: relative; border: 0 !important; background: transparent !important;
    color: var(--fm-gris) !important; font-weight: 600; font-size: .86rem;
    padding: 10px 14px 16px; white-space: nowrap; transition: color .2s;
}
body.form-moderno .nav-tabs-block .nav-link::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 4px;
    border-radius: 4px 4px 0 0; background: transparent; transition: background .2s;
}
body.form-moderno .nav-tabs-block .nav-link.active { color: var(--fm-navy-700) !important; }
body.form-moderno .nav-tabs-block .nav-link.active::after { background: var(--fm-acento); }
body.form-moderno .nav-tabs-block .nav-link:hover { color: var(--fm-navy-600) !important; }

/* ---------- Barra de progreso ---------- */
body.form-moderno [data-wizard="progress"] {
    height: 8px !important; border-radius: 99px; background: #e8edf3; overflow: hidden;
}
body.form-moderno [data-wizard="progress"] .progress-bar {
    height: 8px !important; border-radius: 99px;
    background: linear-gradient(90deg, var(--fm-acento), var(--fm-oro)) !important;
    font-size: 0; transition: width .35s ease;
}

/* ---------- Contenido de cada paso ---------- */
body.form-moderno .tab-content { padding: 26px 30px 10px !important; }
body.form-moderno .tab-pane h5.nav-link,
body.form-moderno .tab-pane h5 {
    display: flex; align-items: center; gap: 10px;
    font-size: 1rem; font-weight: 800; color: var(--fm-navy-700) !important;
    padding: 0 0 10px !important; margin: 8px 0 18px; border-bottom: 2px solid var(--fm-acento-suave);
    background: none !important; text-transform: none;
}
body.form-moderno .tab-pane h5.nav-link::before,
body.form-moderno .tab-pane h5::before {
    content: ''; width: 6px; height: 18px; border-radius: 3px; background: var(--fm-acento); flex-shrink: 0;
}

/* ---------- Campos ---------- */
body.form-moderno .form-group { margin-bottom: 18px; }
body.form-moderno label {
    font-weight: 600; font-size: .86rem; color: #2b3a4d; margin-bottom: 6px;
}
body.form-moderno .form-control,
body.form-moderno .form-select,
body.form-moderno select.form-control {
    min-height: 44px; border-radius: 10px; border: 1.5px solid var(--fm-borde);
    background-color: #fbfcfe; font-size: .95rem; color: var(--fm-texto);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
body.form-moderno .form-control:hover { border-color: #c3cfdc; }
body.form-moderno .form-control:focus,
body.form-moderno .form-select:focus {
    border-color: var(--fm-acento); background-color: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fm-acento) 18%, transparent);
    outline: none;
}
body.form-moderno .form-control::placeholder { color: #9aa6b4; }
body.form-moderno .form-control.is-invalid { border-color: #dc3545; background-color: #fff8f8; }
body.form-moderno .input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.form-moderno .input-group-addon,
body.form-moderno .input-group-text {
    display: flex; align-items: center; padding: 0 14px;
    border: 1.5px solid var(--fm-borde); border-left: 0; border-radius: 0 10px 10px 0;
    background: #f1f5f9; color: var(--fm-gris);
}
body.form-moderno .form-check-input { width: 1.15em; height: 1.15em; margin-top: .2em; cursor: pointer; }
body.form-moderno .form-check-input:checked { background-color: var(--fm-acento); border-color: var(--fm-acento); }
body.form-moderno .form-check-label { font-weight: 500; cursor: pointer; }
body.form-moderno .error-message,
body.form-moderno [id$="Error"],
body.form-moderno [id$="_error"] { font-size: .8rem; font-weight: 600; }
body.form-moderno input[type="file"].form-control { padding-top: 9px; }

/* ---------- Botones de navegacion ---------- */
body.form-moderno .block-content.bg-body-light {
    background: #f6f8fb !important; border-top: 1px solid var(--fm-borde); padding: 16px 30px !important;
}
body.form-moderno [data-wizard="prev"],
body.form-moderno [data-wizard="next"],
body.form-moderno [data-wizard="finish"] {
    min-height: 46px; padding: 0 26px; border-radius: 12px; font-weight: 700; font-size: .95rem;
    transition: transform .15s, box-shadow .15s, background .15s;
}
body.form-moderno [data-wizard="prev"] {
    background: #fff !important; color: var(--fm-navy-700) !important; border: 1.5px solid var(--fm-borde) !important;
}
body.form-moderno [data-wizard="prev"]:hover { border-color: var(--fm-navy-600) !important; }
body.form-moderno [data-wizard="next"] {
    background: var(--fm-navy-700) !important; color: #fff !important; border: 0 !important;
    box-shadow: 0 8px 20px rgba(10, 46, 87, .25);
}
body.form-moderno [data-wizard="next"]:hover { background: var(--fm-navy-600) !important; transform: translateY(-1px); }
body.form-moderno [data-wizard="finish"] {
    background: linear-gradient(135deg, var(--fm-oro-claro), var(--fm-oro)) !important;
    color: var(--fm-navy-900) !important; border: 0 !important;
    box-shadow: 0 10px 24px rgba(226, 179, 60, .4);
}
body.form-moderno [data-wizard="finish"]:hover { transform: translateY(-1px); }
body.form-moderno .text-right { text-align: right; }

/* ---------- Pie ---------- */
.fm-pie { text-align: center; color: var(--fm-gris); font-size: .8rem; padding: 22px 10px 40px; }
.fm-pie a { color: var(--fm-navy-600); font-weight: 600; }

/* ---------- Modal de terminos ---------- */
body.form-moderno #modalTerminos .modal-content {
    background: var(--fm-navy-800) !important; border-radius: 18px; border-top: 5px solid var(--fm-oro) !important;
}
body.form-moderno #modalTerminos #btnContinuarTerminos {
    background: linear-gradient(135deg, var(--fm-oro-claro), var(--fm-oro)); border: 0; color: var(--fm-navy-900); font-weight: 700;
}

/* ---------- Celular ---------- */
@media (max-width: 768px) {
    .fm-hero { padding: 22px 4px 18px; gap: 14px; }
    .fm-hero .fm-escudos img { height: 56px; }
    .fm-hero .fm-ayuda { width: 100%; }
    body.form-moderno .tab-content { padding: 20px 16px 6px !important; }
    body.form-moderno .block-content.bg-body-light { padding: 14px 16px !important; }
    body.form-moderno [data-wizard="prev"],
    body.form-moderno [data-wizard="next"],
    body.form-moderno [data-wizard="finish"] { padding: 0 16px; width: 100%; }
    body.form-moderno .nav-tabs-block .nav-link { font-size: .8rem; padding: 8px 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    body.form-moderno * { transition: none !important; }
}

/* Pestañas clicables */
body.form-moderno .nav-tabs-block .nav-link { cursor: pointer; }

/* ============================================================
 * ALINEACION DENTRO DEL FORMULARIO
 * ============================================================ */

/* Grupos que venian envueltos en .container (sangria extra a la izquierda) */
body.form-moderno .tab-pane .form-group > .container { padding-left: 0; padding-right: 0; max-width: none; }

/* Casillas: casilla y texto en la misma linea, todas al mismo margen.
   Sirve aunque el contenedor sea .form-check, .from-check o un div simple. */
body.form-moderno .tab-pane div:has(> input.form-check-input),
body.form-moderno .tab-pane .fm-check-linea {
    display: flex; align-items: center; gap: 10px;
    padding-left: 0 !important; margin: 0 0 8px; min-height: 24px;
}
body.form-moderno .tab-pane .form-check-input {
    float: none !important; margin: 0 !important; position: static !important; flex-shrink: 0;
}
body.form-moderno .tab-pane div:has(> input.form-check-input) > label,
body.form-moderno .tab-pane .fm-check-linea > label { margin: 0; line-height: 1.35; }
/* Pregunta encima de las casillas (ej. "¿Realizó estudios en la Pre-ESOFA?") */
body.form-moderno .tab-pane .form-group > .container > label:first-child,
body.form-moderno .tab-pane .form-group > .container > label.form-check-label:first-child { display: block; margin-bottom: 10px; }

/* Textos de ayuda en azul (**...): mismo color y tamaño en todo el formulario */
body.form-moderno .tab-pane label.text-primary,
body.form-moderno .tab-pane .text-primary.form-check-label {
    color: var(--fm-navy-600) !important; font-weight: 600; font-size: .84rem;
}

/* Campos con icono a la derecha: misma altura y borde continuo */
body.form-moderno .input-group { flex-wrap: nowrap; align-items: stretch; }
body.form-moderno .input-group > .form-control { margin: 0 !important; min-height: 44px; }
body.form-moderno .input-group-addon,
body.form-moderno .input-group-text { height: auto !important; min-height: 44px; align-self: stretch; }

/* "Escoja un documento": mismo ancho que los demas campos */
body.form-moderno .tab-pane .d-flex > .form-control.me-2 { margin-right: 0 !important; }

/* Paso 5 (Padre / Madre / Apoderado): sin sangria extra y pestañas internas tipo botón */
body.form-moderno .tab-pane .tab-content { padding: 18px 0 0 !important; min-height: 0 !important; }
body.form-moderno .tab-pane > div > nav .nav-tabs,
body.form-moderno .tab-pane nav > .nav-tabs {
    border: 0; gap: 8px; background: #f1f5f9; padding: 6px; border-radius: 12px; display: inline-flex;
}
body.form-moderno .tab-pane nav > .nav-tabs .nav-link {
    border: 0 !important; border-radius: 9px !important; padding: 8px 18px;
    color: var(--fm-gris) !important; font-weight: 700; background: transparent;
}
body.form-moderno .tab-pane nav > .nav-tabs .nav-link.active {
    background: #fff !important; color: var(--fm-navy-700) !important; box-shadow: 0 2px 8px rgba(4, 21, 40, .1);
}
/* Subtitulos de columna ("Datos Personales del Padre", "Datos de nacimiento", "Datos de formación y laboral") */
body.form-moderno .tab-pane .row > [class*="col-"] > label.nav-link,
body.form-moderno .tab-pane label[for^="ds_"],
body.form-moderno .tab-pane .row > [class*="col-"] > .form-group > label.nav-link {
    display: flex !important; align-items: center; gap: 8px;
    padding: 0 0 8px !important; margin: 4px 0 16px; width: 100%;
    font-size: .92rem; font-weight: 800; color: var(--fm-navy-700) !important;
    border-bottom: 2px solid var(--fm-acento-suave); background: none !important;
}
body.form-moderno .tab-pane .row > [class*="col-"] > label.nav-link::before,
body.form-moderno .tab-pane label[for^="ds_"]::before,
body.form-moderno .tab-pane .row > [class*="col-"] > .form-group > label.nav-link::before {
    content: ''; width: 5px; height: 15px; border-radius: 3px; background: var(--fm-acento);
}

/* Foto carnet: zona de carga en vez del boton gris del navegador.
   Va por #foto e input[type=file] para que aplique en Chrome, Edge y
   Firefox (::file-selector-button) y en Safari/Chrome antiguos
   (::-webkit-file-upload-button). */
body.form-moderno #foto,
body.form-moderno .tab-pane input[type="file"] {
    display: block !important; width: 100% !important; box-sizing: border-box;
    padding: 14px !important; border: 2px dashed var(--fm-borde, #d6dee8) !important; border-radius: 12px !important;
    background: #fbfcfe !important; color: var(--fm-gris, #5b6675); font-size: .9rem; line-height: 1.4; cursor: pointer;
}
body.form-moderno #foto:hover,
body.form-moderno .tab-pane input[type="file"]:hover { border-color: var(--fm-acento, #2a9fd6) !important; }
body.form-moderno #foto.input-error,
body.form-moderno .tab-pane input[type="file"].input-error { border-color: #dc3545 !important; background: #fff7f7 !important; }
body.form-moderno #foto::file-selector-button,
body.form-moderno .tab-pane input[type="file"]::file-selector-button {
    margin-right: 14px; padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--fm-navy-700, #0b2545); color: #fff; font-weight: 700; font-family: inherit;
}
body.form-moderno #foto::-webkit-file-upload-button,
body.form-moderno .tab-pane input[type="file"]::-webkit-file-upload-button {
    margin-right: 14px; padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--fm-navy-700, #0b2545); color: #fff; font-weight: 700; font-family: inherit;
}
body.form-moderno #foto::file-selector-button:hover,
body.form-moderno .tab-pane input[type="file"]::file-selector-button:hover { background: var(--fm-acento, #2a9fd6); }

/* Etiquetas de casillas: sin la sangria de 17.5px que trae la plantilla,
   asi "Si / No / Civil..." quedan a la misma distancia de su casilla. */
body.form-moderno .tab-pane div:has(> input.form-check-input) > label,
body.form-moderno .tab-pane .fm-check-linea > label,
body.form-moderno .tab-pane .form-check-label { padding-left: 0; }
body.form-moderno .tab-pane .form-group > .container > label:first-child { padding-left: 0; }

/* ============================================================
   ALERTAS (SweetAlert2) con el estilo del formulario
   ============================================================ */
body.form-moderno .swal2-container { background: rgba(10, 30, 60, .5) !important; }
body.form-moderno .swal2-popup {
    width: min(34em, calc(100vw - 32px)); padding: 26px 24px 22px; border-radius: 18px;
    font-family: inherit; box-shadow: 0 24px 60px rgba(10, 30, 60, .28);
}
body.form-moderno .swal2-icon { margin: 6px auto 4px; transform: scale(.82); }
body.form-moderno .swal2-title { color: var(--fm-navy-700, #0a2e57); font-size: 1.3rem; font-weight: 800; padding: 6px 8px 0; line-height: 1.3; }
body.form-moderno .swal2-html-container { color: #4a5868; font-size: .95rem; line-height: 1.55; margin: 10px 6px 0; }
body.form-moderno .swal2-actions { gap: 10px; margin-top: 20px; }
body.form-moderno .swal2-styled { margin: 0 !important; border-radius: 10px !important; padding: 11px 22px !important; font-weight: 700 !important; font-size: .95rem !important; box-shadow: none !important; }
body.form-moderno .swal2-styled.swal2-confirm { background: var(--fm-navy-700, #0a2e57) !important; color: #fff !important; }
body.form-moderno .swal2-styled.swal2-confirm:hover { filter: brightness(1.12); }
body.form-moderno .swal2-styled.swal2-cancel { background: #eef2f7 !important; color: var(--fm-navy-700, #0a2e57) !important; }
body.form-moderno .swal2-styled:focus-visible { outline: 3px solid var(--fm-acento, #2f9fd8) !important; outline-offset: 2px; }
body.form-eofap .swal2-styled.swal2-confirm { background: var(--fm-acento, #c8372d) !important; }
body.form-moderno .swal2-icon.swal2-warning { border-color: #f2b33d; color: #e09a12; }
body.form-moderno .swal2-icon.swal2-info { border-color: var(--fm-acento, #2f9fd8); color: var(--fm-acento, #2f9fd8); }
body.form-moderno .swal2-icon.swal2-error { border-color: #e5484d; }
body.form-moderno .swal2-icon.swal2-error [class^='swal2-x-mark-line'] { background-color: #e5484d; }

/* textos dentro de las alertas */
.fm-swal-texto { margin: 0 0 8px; color: #33414f; }
.fm-swal-nota { margin: 10px 0 0; font-size: .86rem; color: #6b7785; }

/* alerta de campos faltantes, agrupados por paso */
.fm-swal-faltantes .swal2-html-container { text-align: left; }
.fm-swal-grupos { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.fm-swal-grupo { border: 1px solid #e6ebf2; border-radius: 12px; padding: 10px 12px 9px; margin-top: 8px; background: #fbfcfe; }
.fm-swal-paso { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--fm-navy-700, #0a2e57); font-size: .9rem; margin-bottom: 4px; }
.fm-swal-num {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--fm-navy-700, #0a2e57); color: #fff; font-size: .75rem;
}
body.form-eofap .fm-swal-num { background: var(--fm-acento, #c8372d); }
.fm-swal-cuenta { margin-left: auto; background: #fdeceb; color: #b42318; border-radius: 999px; padding: 1px 9px; font-size: .75rem; }
.fm-swal-chip {
    display: inline-block; margin: 4px 5px 0 0; padding: 3px 10px; border-radius: 999px;
    background: #fff; border: 1px solid #f3c7c3; color: #9f1d14; font-size: .8rem; font-weight: 600;
}
@media (max-width: 480px) {
    body.form-moderno .swal2-popup { padding: 22px 16px 18px; }
    body.form-moderno .swal2-title { font-size: 1.15rem; }
    body.form-moderno .swal2-actions { width: 100%; flex-direction: column-reverse; }
    body.form-moderno .swal2-styled { width: 100%; }
}
