/* =========================================================
   🔵 AUTH (LOGIN / FORGOT / RESET)
========================================================= */

.auth-bg {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    height: 100vh;
    margin: 0;
}

.auth-overlay {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6));
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    background: #ffffff;
    border-radius: 12px;
}

.auth-brand {
    text-align: center;
    color: #ffffff;
    margin-bottom: 20px;
}

.auth-lang-switch {
    position: static;
    display: flex;
    align-items: center;
}

.auth-lang-switch a {
    color: #fff;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.4);
}

.auth-lang-switch a.active {
    background: #fff;
    color: #1e3c72;
    font-weight: bold;
}


/* =========================================================
   🔷 NAVBAR
========================================================= */

.navbar-app {
    background: linear-gradient(135deg, #1e3c72, #193261);
}

.navbar-brand {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-sidebar-btn {
    text-decoration: none;
}

.lang-dropdown-btn {
    background: transparent !important;
    border: 0 !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: none !important;
}

.lang-dropdown-btn:hover {
    opacity: 0.85;
}

.user-menu-mobile {
    background: #1e3c72;
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 5px 20px rgba(0,0,0,.25);
}

.user-menu-mobile .dropdown-item,
.user-menu-mobile .dropdown-item-text,
.user-menu-mobile a {
    color: #fff;
}

.user-menu-mobile .dropdown-divider {
    border-color: rgba(255,255,255,.15);
}

.user-menu-mobile .dropdown-item:hover {
    background: rgba(255,255,255,.1);
}


/* =========================================================
   📌 SIDEBAR (FINAL LIMPIO Y ESTABLE)
========================================================= */

#sidebarMenu {
    background: #f8fafc;
    min-height: 100vh;
    overflow-y: auto;

    border-right: none;
    box-shadow: 1px 0 0 #e5e7eb;

    padding: 0 !important;
    margin: 0 !important;
}

/* Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

/* Título */
.sidebar-title-desktop {
    padding: 15px 15px 5px 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: .5px;
}

/* Links */
.sidebar-link {
    color: #212529 !important;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 2px 8px;
    display: flex;
    align-items: center;
    transition: all 0.25s ease;
}

.sidebar-link:hover {
    background-color: #e9ecef;
    transform: translateX(3px);
    color: #000 !important;
}

.sidebar-link.active {
    background-color: #e2e6ea;
    border-left: 4px solid #2a5298;
}

.sidebar-link i {
    font-size: 16px;
}


/* =========================================================
   🌑 BACKDROP
========================================================= */

#sidebarBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    display: none;
}

#sidebarBackdrop.active {
    display: block;
}


/* =========================================================
   🎯 UTILIDADES
========================================================= */

.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
}


/* =========================================================
   🧠 FIXES LAYOUT
========================================================= */

main {
    min-width: 0;
    background: transparent;
}

body {
    overflow-x: hidden;
}

html, body {
    height: 100%;
}


/* =========================================================
   📱 MOBILE (SIDEBAR OVERLAY)
========================================================= */

@media (max-width: 767px) {

    #sidebarMenu {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100%;
        z-index: 1050;

        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    #sidebarMenu.show {
        transform: translateX(0);
    }

}


/* =========================================================
   💻 DESKTOP
========================================================= */

@media (min-width: 768px) {

    #sidebarMenu {
        position: relative;
        transform: none;
    }

    #sidebarBackdrop {
        display: none !important;
    }

    .mobile-sidebar-btn {
        display: none;
    }

    #closeSidebar {
        display: none;
    }

}





.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 10px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.drop-zone:hover {
    background: #f1f3f5;
}

.drop-zone.dragover {
    border-color: #2a5298;
    background: #e9f0ff;
}

/* =========================================================
   ACORDEÓN DE SECCIONES
   ========================================================= */

#questionnaireSectionsAccordion {
    display: block;
    padding-bottom: 40px;
}

#questionnaireSectionsAccordion .accordion-item {
    margin: 0 0 10px 0 !important;
    border: 1px solid #d6e4f0 !important;
    border-radius: 6px !important;
    background-color: #f4f8fc;
    overflow: hidden;
}

/*
 * Bootstrap elimina el borde superior entre items consecutivos.
 * Lo restauramos para mantenerlos visualmente independientes.
 */
#questionnaireSectionsAccordion .accordion-item:not(:first-of-type) {
    border-top: 1px solid #d6e4f0 !important;
}

/*
 * Evita reglas heredadas que puedan sumar margen superior.
 */
#questionnaireSectionsAccordion .accordion-item + .accordion-item {
    margin-top: 0 !important;
}

/*
 * Solo el último item pierde su margen inferior.
 */
#questionnaireSectionsAccordion .accordion-item:last-child {
    margin-bottom: 0 !important;
}

#questionnaireSectionsAccordion .accordion-button {
    background-color: #edf5fb;
    color: #24445f;
    box-shadow: none;
    transition: background-color .2s ease, color .2s ease;
}

#questionnaireSectionsAccordion .accordion-button:hover {
    background-color: #e0eef8;
}

#questionnaireSectionsAccordion .accordion-button:not(.collapsed) {
    background-color: #cfe5f7;
    color: #173a59;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08);
}

#questionnaireSectionsAccordion .accordion-button:focus {
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

#questionnaireSectionsAccordion .accordion-body {
    background-color: #ffffff;
}

.questionnaire-section-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    line-height: 1.35;
}

/* =========================================================
   MENSAJES INFORMATIVOS COMPACTOS
   ========================================================= */

.questionnaire-info-note,
.questionnaire-normal-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: .45rem;
    max-width: 100%;
    margin: 10px 0;
    color: #6c757d;
    text-align: center;
}

.questionnaire-info-note .bi,
.questionnaire-normal-note .bi {
    flex: 0 0 auto;
    margin-top: .28rem;
    font-size: 1rem;
}

.questionnaire-info-note .badge,
.questionnaire-normal-note .badge {
    max-width: min(100%, 900px);
    padding: .55rem .85rem;
    white-space: normal;
    text-align: left;
    line-height: 1.45;
}

.questionnaire-info-note .badge {
    font-weight: 500;
    font-size: 1rem;
}

.questionnaire-normal-note .badge {
    font-weight: 600;
}


/* =========================================================
   INDICADOR DE PREGUNTA OBLIGATORIA
   ========================================================= */

.questionnaire-required-marker {
    display: inline-block;
    margin-left: .28rem;
    color: #dc3545;
    font-weight: 700;
    line-height: 1;
}


/* Campos simples: pregunta a la izquierda y control a la derecha */
.questionnaire-field-row {
    margin: 0;
}

.questionnaire-field-label .form-label {
    margin-bottom: 0;
}

.questionnaire-field-control {
    min-width: 0;
}

/*
 * En móvil se conserva el formato tradicional:
 * pregunta arriba y campo abajo.
 */
@media (max-width: 767.98px) {
    .questionnaire-field-label .form-label {
        display: block;
        margin-bottom: .45rem;
    }

    .questionnaire-field-control {
        margin-top: .15rem;
    }
}




.client-footer {
    width: 100%;
    padding: 14px 0;
    font-size: 0.85rem;
}

/* Footer para layout principal */
.client-footer-main {
    color: #0b2f5b; /* azul oscuro */
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
}

/* Footer para login/auth */
.client-footer-auth {
    color: #d4af37; /* gold */
    background-color: transparent;
}

.client-footer-auth a {
    color: #f1c232;
    text-decoration: none;
}

.client-footer-auth a:hover {
    color: #ffd966;
    text-decoration: underline;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-wrapper {
    flex: 1;
}

.auth-bg {
    min-height: 100vh;
}

.auth-overlay {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Footer login */
.client-footer-auth {
    color: #d4af37;
    background-color: transparent;
    padding: 12px 0 18px;
    font-size: 0.85rem;
}

.questionnaire-invalid-highlight {
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 10px;
    background-color: rgba(220, 53, 69, 0.06);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.questionnaire-invalid-control .ts-control {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.sidebar-section-title {
    padding: 0 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

/* ==================================================
   LOGIN - ACCIONES SUPERIORES
   ================================================== */

.auth-top-actions {
    position: absolute;
    top: 12px;
    right: 18px;
    z-index: 1050;

    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-contact-btn {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: #fff;
    background: transparent;

    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;

    font-size: 17px;
}

.auth-contact-btn:hover,
.auth-contact-btn:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.75);
    outline: none;
}


/* ==================================================
   LOGIN - POPUP DE CONTACTO
   ================================================== */

.auth-contact-popup {
    position: absolute;
    top: 58px;
    right: 18px;

    width: 320px;

    padding: 16px;

    background: #ffffff;
    color: #212529;

    border: 1px solid #dfe3e8;
    border-radius: 10px;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);

    z-index: 2000;
}

.auth-contact-popup-arrow {
    position: absolute;
    top: -8px;
    right: 184px;

    width: 16px;
    height: 16px;

    background: #ffffff;

    border-left: 1px solid #dfe3e8;
    border-top: 1px solid #dfe3e8;

    transform: rotate(45deg);
}

.auth-contact-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;
    padding-bottom: 10px;

    color: #1e3c72;

    border-bottom: 1px solid #e9ecef;
}

.auth-contact-popup-close {
    padding: 2px 4px;

    border: 0;
    background: transparent;

    color: #6c757d;
    font-size: 14px;

    cursor: pointer;
}

.auth-contact-popup-close:hover {
    color: #212529;
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 10px 0;

    border-bottom: 1px solid #f0f0f0;
}

.contact-row:last-child {
    border-bottom: 0;
}

.contact-row-icon {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    border-radius: 50%;

    background: #f2f5f9;

    color: #1e3c72;
    font-size: 16px;
}

.contact-row-label {
    display: block;

    margin-bottom: 2px;

    color: #6c757d;

    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.contact-row-value {
    display: inline-block;

    color: #1e3c72;

    font-weight: 500;
    text-decoration: none;
}

.contact-row-value:hover {
    text-decoration: underline;
}

@media (max-width: 575.98px) {

    .auth-contact-popup {
        left: 10px;
        right: 10px;

        width: auto;
    }

    /*
     * En móvil el popup ocupa casi todo el ancho,
     * por lo que ocultamos la flecha.
     */
    .auth-contact-popup-arrow {
        display: none;
    }
}

.auth-help-link {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    color: #1e3c72;

    font-size: 13px;
    font-weight: 500;

    text-decoration: none;
}

.auth-help-link:hover {
    color: #142b52;

    text-decoration: underline;
}

.auth-help-link i {
    font-size: 14px;
}