/**
 * Hoja de Estilos: Cuestionario de Evaluación (COCODI 2025)
 * CECyTE Nayarit
 */

:root {
    --bg-page: #edf2f7;
    --primary-dark: #0f172a;
    --emerald-green: #059669;
    --emerald-hover: #047857;
    --soft-blue-bg: #f0f7ff;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-page);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    padding: 1.25rem 1rem 2.5rem;
}

/* Regla global de bordes redondeados a 4px */
*, .card, .btn, .form-control, .form-select, .badge, .alert, .modal-content, .progress, .progress-bar, .input-group-text, .rounded-pill, .rounded-3, .rounded-4 {
    border-radius: 4px !important;
}

/* Contenedor Principal Centrado */
.survey-card {
    background: #ffffff;
    max-width: 980px;
    margin: 0 auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.02);
    padding: 2rem 2.75rem;
}

/* Banner de Logos */
.header-logos {
    text-align: center;
    margin-bottom: 1.5rem;
}

.header-logos img {
    max-height: 85px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.03));
}

/* Títulos */
.survey-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
    text-align: center;
}

.survey-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1.35rem;
}

/* Campos del Participante */
.participant-fields {
    margin-bottom: 2rem;
}

.field-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-label i {
    color: #0f172a;
    font-size: 1.05rem;
}

.custom-input {
    height: 48px;
    border-radius: 4px;
    border: 1.5px solid #e2e8f0;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: #1e293b;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.custom-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Barra de Progreso */
.progress-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.85rem;
    gap: 1.25rem;
}

.progress-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.progress-track {
    flex-grow: 1;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #10b981;
    border-radius: 4px;
    width: 0%;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-counter {
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

/* Tarjetas de Acordeón de Componentes */
.component-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 1.15rem;
    overflow: hidden;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.component-card:hover {
    border-color: #cbd5e1;
}

.component-header {
    padding: 1.1rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.component-header:hover {
    background-color: #f8fafc;
}

.component-left {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.component-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
    line-height: 1.25;
    margin-bottom: 0.15rem;
}

.component-desc {
    font-size: 0.84rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0;
}

.component-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge-preguntas {
    background-color: #dcfce7;
    color: #15803d;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-preguntas.completo {
    background-color: #10b981;
    color: #ffffff;
}

.chevron-icon {
    font-size: 1.1rem;
    color: #475569;
    transition: transform 0.25s ease;
}

.component-card.open .chevron-icon {
    transform: rotate(180deg);
}

/* Contenido Expandido del Componente */
.component-body {
    background-color: var(--soft-blue-bg);
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    display: block;
}

.component-card.open .component-body {
    display: block;
}

/* Fila de Pregunta */
.question-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    gap: 1.5rem;
}

.question-item:last-child {
    border-bottom: none;
}

.question-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
}

.q-badge-num {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.q-badge-num.answered {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.q-text-content {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 0;
    line-height: 1.45;
}

.question-right {
    flex-shrink: 0;
    width: 250px;
}

.select-custom {
    height: 44px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    padding: 0.5rem 2.2rem 0.5rem 1rem;
    font-size: 0.9rem;
    color: #334155;
    background-color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.select-custom:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.select-custom.is-answered {
    border-color: #10b981;
    font-weight: 600;
    color: #0f172a;
}

/* Botón de Enviar */
.btn-enviar {
    background-color: var(--emerald-green);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 4px;
    height: 52px;
    width: 100%;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-shadow: none;
    transition: all 0.2s ease;
    margin-top: 2rem;
}

.btn-enviar:hover {
    background-color: var(--emerald-hover);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-enviar i {
    font-size: 1.15rem;
}

/* Pantalla Previa de Registro */
.step-instruction-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.35rem;
    font-size: 0.92rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-instruction-box i {
    font-size: 1.35rem;
    color: #0f172a;
    flex-shrink: 0;
}

.btn-comenzar {
    background-color: var(--emerald-green);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 4px;
    height: 52px;
    width: 100%;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-shadow: none;
    transition: all 0.2s ease;
    margin-top: 1.75rem;
}

.btn-comenzar:hover {
    background-color: var(--emerald-hover);
    transform: translateY(-1px);
    color: #ffffff;
}

.participant-summary-bar {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.85rem 1.15rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.participant-summary-bar .summary-avatar {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVIDAD MÓVIL (A TODA PANTALLA, SIN BORDES NI MÁRGENES GRISES)
   ========================================================================== */
@media (max-width: 768px) {
    html, body {
        background-color: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        min-height: 100vh !important;
        overflow-x: hidden;
    }

    .survey-card {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem 1.15rem 3rem !important;
    }

    .header-logos {
        margin-bottom: 0.85rem !important;
    }

    .header-logos img {
        max-height: 62px !important;
    }

    .survey-title {
        font-size: 1.55rem !important;
        margin-bottom: 0.25rem !important;
    }

    .survey-subtitle {
        font-size: 0.92rem !important;
        margin-bottom: 1.35rem !important;
    }

    #pantallaRegistro {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .step-instruction-box {
        padding: 0.85rem 1rem !important;
        font-size: 0.88rem !important;
        margin-bottom: 1.35rem !important;
    }

    .field-label {
        font-size: 0.88rem !important;
        margin-bottom: 0.4rem !important;
    }

    .custom-input {
        font-size: 0.95rem !important;
        height: 48px !important;
    }

    .btn-comenzar {
        width: 100% !important;
        height: 50px !important;
        margin-top: 1.5rem !important;
        font-size: 1rem !important;
    }

    .steps-nav-bar {
        gap: 0.35rem !important;
        margin-bottom: 1.25rem !important;
    }

    .step-pill {
        padding: 0.5rem 0.35rem !important;
        font-size: 0.8rem !important;
    }

    .step-pill .step-text {
        display: none !important;
    }

    .participant-summary-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.65rem !important;
        padding: 0.75rem 0.9rem !important;
        margin-bottom: 1.25rem !important;
    }

    .participant-summary-bar > div:last-child {
        width: 100% !important;
        text-align: right !important;
    }

    .progress-wrapper {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.4rem !important;
        margin-bottom: 1.25rem !important;
    }

    .progress-track {
        width: 100% !important;
        margin: 0 !important;
    }

    .component-card {
        border-radius: 4px !important;
        margin-bottom: 1rem !important;
    }

    .component-header {
        padding: 0.85rem 0.95rem !important;
    }

    .component-left {
        gap: 0.75rem !important;
    }

    .icon-circle {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.15rem !important;
    }

    .component-name {
        font-size: 0.95rem !important;
    }

    .component-desc {
        font-size: 0.78rem !important;
    }

    .badge-preguntas {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.55rem !important;
    }

    .component-body {
        padding: 0.35rem 0.5rem 0.75rem !important;
    }

    .question-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.65rem !important;
        padding: 0.85rem 0.35rem !important;
    }

    .question-left {
        gap: 0.65rem !important;
    }

    .q-text-content {
        font-size: 0.9rem !important;
        line-height: 1.45 !important;
    }

    .question-right {
        width: 100% !important;
    }

    .select-custom {
        width: 100% !important;
        height: 44px !important;
        font-size: 0.9rem !important;
    }

    .section-nav-footer {
        flex-direction: column-reverse !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
        padding-top: 1.25rem !important;
    }

    .btn-nav-prev,
    .btn-nav-next,
    #btnEnviarDatos {
        width: 100% !important;
        min-width: 100% !important;
        justify-content: center !important;
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
    }
}

/* ==========================================================================
   ESTILOS PARA FLUJO DE SECCIONES (PANTALLA POR COMPONENTE) Y AGRADECIMIENTO
   ========================================================================== */

/* Barra de Navegación por Secciones / Pasos */
.steps-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.step-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    flex-grow: 1;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.step-pill.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.step-pill.completed {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-pill.active .step-num {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.step-pill.completed .step-num {
    background: #15803d;
    color: #ffffff;
}

/* Cabecera Destacada de la Sección Actual */
.section-header-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin-bottom: 0.25rem;
}

.section-desc {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 0;
}

/* Barra de Botones de Navegación de Sección */
.section-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1.5px solid #e2e8f0;
    gap: 1rem;
}

.btn-nav-prev {
    background: #475569;
    border: 1px solid #475569;
    color: #ffffff;
    border-radius: 4px;
    font-weight: 700;
    padding: 0.72rem 1.5rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-nav-prev:hover {
    background: #334155;
    border-color: #334155;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-nav-next {
    background: var(--emerald-green);
    border: 1px solid transparent;
    color: #ffffff;
    border-radius: 4px;
    font-weight: 700;
    padding: 0.7rem 1.65rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-nav-next:hover {
    background: var(--emerald-hover);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Pantalla de Agradecimiento Final */
.thankyou-card {
    text-align: center;
    padding: 2.5rem 1rem 1rem;
}

.thankyou-icon-wrap {
    width: 76px;
    height: 76px;
    border-radius: 4px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #15803d;
    font-size: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.thankyou-title {
    font-size: 2.15rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 0.75rem;
}

.thankyou-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    max-width: 680px;
    margin: 0 auto 2.25rem;
    line-height: 1.6;
}

.thankyou-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1.75rem 2rem;
    max-width: 720px;
    margin: 0 auto 2.25rem;
    text-align: left;
}

.kpi-mini-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1rem;
    text-align: center;
}

.section-questions-card {
    background-color: var(--soft-blue-bg);
    border: 1.5px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.75rem 1.25rem;
}

.step-pill {
    cursor: pointer;
}

/* Overlay / Modal de Bloqueo "Guardando evaluación..." */
.overlay-guardando {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.overlay-guardando-contenido {
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    padding: 2.25rem 2.5rem;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: animFadeInScale 0.25s ease-out;
}

@keyframes animFadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bloqueo del formulario mientras se envía */
.form-bloqueado {
    pointer-events: none !important;
    user-select: none !important;
    opacity: 0.6;
}

/* Modales Personalizados de Aviso y Confirmación */
.modal .modal-content {
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 10px 10px -5px rgba(15, 23, 42, 0.05);
}

.modal .modal-header {
    border-bottom: 1px solid #f1f5f9;
}

.modal-backdrop.show {
    opacity: 0.65;
    backdrop-filter: blur(2px);
}


