:root {
    --cmi-navy: #0f2c4c;
    --cmi-blue: #1b4f86;
    --cmi-accent: #c9a227;
    --cmi-bg: #f4f7fb;
}

body.cuestionario-page {
    background: var(--cmi-bg);
    font-family: "Source Sans Pro", "Segoe UI", sans-serif;
    color: #1f2933;
}

.cuest-wrap {
    max-width: 920px;
    margin: 2rem auto 4rem;
}

.cuest-hero {
    background: linear-gradient(135deg, var(--cmi-navy), var(--cmi-blue));
    color: #fff;
    border-radius: 16px;
    padding: 1.75rem 2rem;
    box-shadow: 0 12px 30px rgba(15, 44, 76, .18);
}

.cuest-hero img {
    max-height: 72px;
    background: #fff;
    border-radius: 8px;
    padding: .35rem .6rem;
}

.cuest-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem;
    margin-top: 1.25rem;
    box-shadow: 0 8px 24px rgba(15, 44, 76, .08);
}

.step-panel { display: none; }
.step-panel.active { display: block; }

.cuestionario-page .progress {
    height: 10px;
    border-radius: 999px;
    background: #e6edf5;
    overflow: hidden;
}
.cuestionario-page .progress-bar,
.cuestionario-page #cuest-progress {
    background-color: #1b80c1;
    background-image: linear-gradient(90deg, #1b80c1, #27348b, #89bd24);
    background-repeat: no-repeat;
    background-position: left center;
}

.campo { margin-bottom: 1.15rem; }
.campo label.campo-label {
    font-weight: 600;
    margin-bottom: .4rem;
    display: block;
}
.campo .req { color: #c0392b; }

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: .85rem 0 .35rem;
    z-index: 8;
    border-top: 1px solid #e5e7eb;
}

.cuest-step-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.cuest-step-pills .cuest-pill {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #4b5563;
    border-radius: 999px;
    font-size: .78rem;
    padding: .2rem .65rem;
    line-height: 1.3;
}
.cuest-step-pills .cuest-pill.is-done {
    background: #eef6e3;
    border-color: #89bd24;
    color: #3f6212;
    cursor: pointer;
}
.cuest-step-pills .cuest-pill.is-current {
    background: #27348b;
    border-color: #27348b;
    color: #fff;
    cursor: default;
}
.cuest-step-pills .cuest-pill.is-todo {
    opacity: .55;
    cursor: not-allowed;
}
.cuest-step-pills .cuest-pill.is-done:hover {
    background: #89bd24;
    color: #fff;
}

.btn-cmi {
    background: var(--cmi-navy);
    border-color: var(--cmi-navy);
    color: #fff;
}
.btn-cmi:hover { background: var(--cmi-blue); color: #fff; }

.help-text { color: #6b7280; font-size: .9rem; }

.tabla-normas {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    margin: .75rem 0 1rem;
    background: #fff;
}
.tabla-normas thead th {
    background: #27348b;
    color: #fff;
    font-weight: 600;
    padding: .65rem .75rem;
    text-align: left;
    vertical-align: middle;
}
.tabla-normas td {
    border: 1px solid #dbe3ee;
    padding: .7rem .75rem;
    vertical-align: top;
}
.tabla-normas tbody tr:nth-child(even) {
    background: #f4f7fb;
}
.tabla-normas tbody tr:hover {
    background: #eef6e3;
}
.tabla-normas tbody tr:has(input:checked) {
    background: #eef6e3;
    box-shadow: inset 3px 0 0 #89bd24;
}
.tabla-normas-check {
    width: 2.2rem;
    text-align: center;
    vertical-align: middle !important;
}
.tabla-normas-label {
    display: block;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
    color: inherit;
}
.tabla-normas-label strong {
    display: block;
    color: #27348b;
    font-size: .95rem;
    margin-bottom: .2rem;
}
.tabla-normas-label span {
    display: block;
    color: #374151;
    line-height: 1.4;
}
.tabla-normas .custom-control {
    padding-left: 1.35rem;
    min-height: 1.25rem;
}

/* Validación visual: verde OK / rojo error (en lugar de gris) */
.cuestionario-page .form-control.is-valid,
.cuestionario-page select.is-valid,
.cuestionario-page textarea.is-valid {
    background-color: #e8f7ee !important;
    border-color: #28a745 !important;
    box-shadow: 0 0 0 .15rem rgba(40, 167, 69, .18);
}

.cuestionario-page .form-control.is-invalid,
.cuestionario-page select.is-invalid,
.cuestionario-page textarea.is-invalid {
    background-color: #fdecea !important;
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 .15rem rgba(220, 53, 69, .18);
}

.cuestionario-page .form-control[readonly].is-valid {
    background-color: #e8f7ee !important;
}

.cuestionario-page .form-control[readonly].is-invalid {
    background-color: #fdecea !important;
}

.cuestionario-page .opciones.is-valid {
    background-color: #e8f7ee;
    border: 1px solid #28a745;
    border-radius: .4rem;
    padding: .55rem .75rem;
}

.cuestionario-page .opciones.is-invalid {
    background-color: #fdecea;
    border: 1px solid #dc3545;
    border-radius: .4rem;
    padding: .55rem .75rem;
}

.campo-feedback {
    display: none;
    font-size: .85rem;
    margin-top: .25rem;
}
.campo-feedback.show-ok { display: block; color: #1e7e34; }
.campo-feedback.show-error { display: block; color: #c0392b; }

.login-page, body.hold-transition.login-page {
    background: linear-gradient(160deg, #0f2c4c, #1b4f86) !important;
}

.brand-link .brand-image-cmi {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
    opacity: 1;
}

.badge-estatus-enviada { background: #17a2b8; }
.badge-estatus-en_revision { background: #ffc107; color: #212529; }
.badge-estatus-cotizacion { background: #28a745; }
.badge-estatus-descartada { background: #6c757d; }
.badge-estatus-baja { background: #dc3545; }
.badge-estatus-borrador { background: #6c757d; }

.envios-resumen {
    display: block;
    margin-top: .25rem;
    font-size: .75rem;
    color: #4b5563;
    font-weight: 600;
    white-space: nowrap;
}
.envios-resumen.envios-alto {
    color: #c0392b;
}

.formularios-col {
    min-width: 11rem;
    max-width: 14rem;
}
.formularios-resumen .formulario-badge {
    font-size: .72rem;
    font-weight: 600;
    white-space: normal;
    line-height: 1.35;
}
.formularios-resumen .formulario-icon {
    display: inline-block;
    min-width: .85rem;
}

.campana-intro {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #374151;
}
.campana-intro p:last-child {
    margin-bottom: 0;
}
.campana-pregunta {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e5e7eb;
}
.campana-pregunta:last-of-type {
    border-bottom: 0;
}
.campana-pregunta-num {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #27348b;
    margin-bottom: .35rem;
}
.campana-pregunta-titulo {
    font-weight: 700;
    margin-bottom: .25rem;
    color: #111827;
}
.campana-pregunta-texto {
    margin-bottom: .85rem;
    color: #1f2937;
}
.campana-opcion {
    padding: .45rem .65rem;
    margin-bottom: .35rem;
    border-radius: .35rem;
    background: #f9fafb;
}
.campana-opcion .form-check-label {
    cursor: pointer;
    width: 100%;
}
.campana-cierre {
    background: #f4f7fb;
    border-left: 4px solid #27348b;
    padding: 1rem 1.15rem;
    margin: 1.5rem 0;
}
.asesor-contacto-datos a {
    color: #1b4f86 !important;
    font-weight: 600;
    text-decoration: underline;
}
.asesor-contacto-datos a:hover,
.asesor-contacto-datos a:focus {
    color: #27348b !important;
}
.cuest-card .alert .asesor-contacto-datos a {
    color: #1b4f86 !important;
}
.cmi-public-footer {
    margin-top: 2rem;
    background: #0f2c4c;
    color: #e8eef5;
    padding: 1.75rem 1rem 2rem;
    font-size: .92rem;
    line-height: 1.55;
}
.cmi-public-footer-inner {
    max-width: 720px;
    margin: 0 auto;
}
.cmi-public-footer a {
    color: #ffffff;
}
.cmi-public-footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: .85rem;
}

.molino-box { position: relative; }
.molino-results {
    list-style: none;
    margin: .25rem 0 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 44, 76, .12);
    z-index: 20;
    position: absolute;
    left: 0;
    right: 0;
}
.molino-item {
    padding: .55rem .75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f3f8;
}
.molino-item:last-child { border-bottom: 0; }
.molino-item:hover,
.molino-item.is-active { background: #eef4fb; }
.molino-item small {
    display: block;
    color: #6b7280;
    font-size: .8rem;
}
.molino-cod {
    font-weight: 700;
    color: #1b4f86;
    margin-right: .35rem;
}
.molino-empty {
    padding: .7rem .75rem;
    color: #6b7280;
}
.dash-envio-bloque {
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    height: 100%;
    background: #f8fafc;
}
.dash-envio-largo {
    border-left: 4px solid #17a2b8;
}
.dash-envio-breve {
    border-left: 4px solid #343a40;
}
.dash-envio-bloque h5 {
    font-weight: 700;
    margin-bottom: .35rem;
    color: #0f2c4c;
}
.dash-recientes-bloque {
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    padding: .75rem 1rem 0;
    margin-bottom: 0;
    background: #f8fafc;
}
.dash-recientes-bloque legend {
    font-size: .95rem;
    font-weight: 700;
    color: #0f2c4c;
    width: auto;
    padding: 0 .35rem;
    margin-bottom: 0;
}
.dash-recientes-titulo {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .75rem;
}
.dash-recientes-filtros .form-group {
    margin-bottom: .75rem;
}
.molino-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .85rem;
    border: 1px solid #c9d6e8;
    border-radius: 8px;
    background: #f4f8fc;
    font-weight: 600;
}
