/* ═══════════════════════════════════════════════════
   Feedback Widget — Escenario A (modal) y B (banner)
   Sigue el sistema de diseño del sitio CENDIS:
   fondo #031130, acento #644A9E, texto blanco, Karla.
   ═══════════════════════════════════════════════════ */

/* ── Overlay (misma base que .modal-principal del sitio) ── */
#cendis-feedback-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#cendis-feedback-overlay.fb-visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Tarjeta (misma estructura que .modal-contenido del sitio) ── */
#cendis-feedback-card {
    background-color: #031130;
    border-radius: 20px;
    padding: 36px 32px 28px;
    width: min(480px, 100%);
    color: white;
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

#cendis-feedback-overlay.fb-visible #cendis-feedback-card {
    transform: translateY(0);
}

/* ── Botón cerrar ── */
#fb-btn-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

#fb-btn-close:hover {
    color: #fff;
}

/* ── Etiqueta superior ── */
.fb-label {
    font-family: 'Karla-SemiBold', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #644A9E;
    margin-bottom: 6px;
}

/* ── Indicador de progreso ── */
.fb-progress {
    font-family: 'Karla', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 10px;
}

/* ── Pregunta ── */
.fb-title {
    font-family: 'Karla-SemiBold', sans-serif;
    font-size: 1.1rem;
    color: #ffffff;
    line-height: 1.45;
    margin-bottom: 24px;
}

/* ── Estrellas ── */
.fb-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.fb-star {
    font-size: 2.2rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.2);
    transition: color 0.12s ease, transform 0.1s ease;
    user-select: none;
    line-height: 1;
}

.fb-star.active {
    color: #fbbf24;
}

.fb-star:hover {
    transform: scale(1.15);
}

/* ── Textarea ── */
#fb-comment {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'Karla', sans-serif;
    color: #ffffff;
    resize: none;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 24px;
    transition: border-color 0.15s;
}

#fb-comment::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

#fb-comment:focus {
    border-color: #644A9E;
}

/* ── Botones de acción ── */
.fb-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Botón primario — igual que .boton.morado del sitio */
.fb-btn-primary {
    padding: 15px 32px;
    border-radius: 10px;
    background-color: #644A9E;
    color: white;
    border: none;
    font-family: 'Karla-SemiBold', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    line-height: normal;
}

.fb-btn-primary:hover:not(:disabled) {
    background-color: #7b5bb8;
}

.fb-btn-primary:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Botón secundario — igual que .opcion-cancelar del sitio */
.fb-btn-secondary {
    padding: 15px 32px;
    border-radius: 10px;
    border: 2px solid #644A9E;
    background-color: transparent;
    color: white;
    font-family: 'Karla', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    line-height: normal;
}

.fb-btn-secondary:hover {
    border-color: #7b5bb8;
    background-color: rgba(100, 74, 158, 0.15);
}

/* ── Pie ── */
.fb-footer {
    font-family: 'Karla', sans-serif;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 18px;
    margin-bottom: 0;
}

/* ── Pantalla de gracias ── */
.fb-thanks-icon {
    font-size: 3rem;
    color: #644A9E;
    margin-bottom: 12px;
}

/* ── Tarjeta con scroll para múltiples preguntas ── */
#cendis-feedback-card {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 74, 158, 0.5) transparent;
}

/* ── Lista de preguntas ── */
#fb-questions-list {
    text-align: left;
    margin-bottom: 24px;
}

/* ── Bloque individual de pregunta ── */
.fb-question-block {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.fb-question-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ── Textarea requerido para preguntas de tipo "text" ── */
.fb-answer-text {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: 'Karla', sans-serif;
    color: #ffffff;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.fb-answer-text::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.fb-answer-text:focus {
    border-color: #644A9E;
}

/* ── Textarea opcional bajo estrellas ── */
.fb-comment-optional {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: 'Karla', sans-serif;
    color: rgba(255, 255, 255, 0.8);
    resize: none;
    outline: none;
    box-sizing: border-box;
    margin-top: 12px;
    transition: border-color 0.15s;
}

.fb-comment-optional::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.fb-comment-optional:focus {
    border-color: rgba(100, 74, 158, 0.6);
}

/* ── Responsivo ── */
@media (max-width: 480px) {
    #cendis-feedback-overlay {
        align-items: flex-start;
        padding: 12px;
    }

    #cendis-feedback-card {
        padding: 20px 18px 18px;
        margin: auto;
        width: 100%;
    }

    #fb-btn-close {
        top: 12px;
        right: 14px;
        font-size: 1.6rem;
        color: rgba(255, 255, 255, 0.8);
    }

    .fb-progress {
        margin-bottom: 6px;
    }

    .fb-title {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .fb-star {
        font-size: 1.9rem;
    }

    #fb-comment {
        margin-bottom: 16px;
    }

    .fb-actions {
        flex-direction: column;
        gap: 10px;
    }

    .fb-btn-primary,
    .fb-btn-secondary {
        width: 100%;
        padding: 13px 20px;
    }

    .fb-footer {
        margin-top: 12px;
    }
}
