/**
 * Survey Mobile — survey.css
 * Estilos do sistema de pesquisa de satisfação no mobile-view.
 * @since 3.53.0
 * @updated Auditoria 183 — forçar sync SFTP
 */

/* ═══════════════════════════════════════════════════════════ */
/* BANNER / CARD NA HOME                                       */
/* ═══════════════════════════════════════════════════════════ */

.survey-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: linear-gradient(135deg, #1a2035 0%, #253352 100%);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin: var(--space-3) 0;
    box-shadow: var(--shadow-sm);
    color: #fff;
    cursor: pointer;
    transition: transform var(--transition-fast);
    animation: surveySlideIn 0.4s ease;
}

.survey-banner:active {
    transform: scale(0.98);
}

@keyframes surveySlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.survey-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: rgba(189, 160, 95, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #bda05f;
    font-size: 22px;
}

.survey-banner-info {
    flex: 1;
    min-width: 0;
}

.survey-banner-label {
    font-size: var(--font-xs);
    opacity: 0.85;
    font-weight: var(--weight-medium);
    color: #fff;
    display: block;
    margin-bottom: 2px;
}

.survey-banner-title {
    font-size: var(--font-xl);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: #fff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.survey-banner-sub {
    font-size: var(--font-xs);
    opacity: 0.7;
    color: #bda05f;
    font-weight: var(--weight-medium);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.survey-banner-arrow {
    flex-shrink: 0;
    color: #bda05f;
    font-size: 18px;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════ */
/* MODAL (FULLSCREEN MOBILE)                                   */
/* ═══════════════════════════════════════════════════════════ */

.survey-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    z-index: 9999999999;
    display: flex;
    flex-direction: column;
}

/* Padrão B — oculta head__app e nav.atalhosApp ao abrir o survey modal */
body.survey-modal-open .head__app,
body.survey-modal-open .headApp,
body.survey-modal-open nav.atalhosApp,
body.survey-modal-open .atalhosApp {
    display: none !important;
}

.survey-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.survey-modal-header {
    background: #0C1E34;
    color: #fff;
    padding: 16px 16px 12px;
    position: relative;
}

.survey-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border-radius: 50%;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.survey-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
    padding-right: 40px;
}

.survey-modal-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.survey-modal-progress {
    height: 4px;
    background: #e5e7eb;
    position: relative;
}

.survey-modal-progress-bar {
    height: 100%;
    background: #bda05f;
    transition: width 0.3s ease;
    width: 0;
}

.survey-progress-text {
    position: absolute;
    right: 8px;
    top: 6px;
    font-size: 10px;
    color: #6b7280;
}

.survey-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.survey-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.survey-btn-submit {
    width: 100%;
    background: #0C1E34;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.survey-btn-submit:hover {
    opacity: 0.9;
}

.survey-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════ */
/* QUESTIONS IN MODAL                                          */
/* ═══════════════════════════════════════════════════════════ */

.survey-question {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s;
    border: 2px solid transparent;
}

.survey-question.survey-q-error {
    border-color: #ef4444;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.survey-q-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.survey-q-num {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.survey-q-required {
    color: #ef4444;
    font-weight: bold;
    font-size: 14px;
}

.survey-q-text {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Text input */
.survey-input-text {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    color: #1f2937;
    background: #f9fafb;
}

.survey-input-text:focus {
    outline: none;
    border-color: #bda05f;
}

/* Choice cards (single + multi) */
.survey-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.survey-choice-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.survey-choice-card input {
    display: none;
}

.survey-choice-card.selected {
    border-color: #bda05f;
    background: rgba(189, 160, 95, 0.08);
}

.survey-choice-label {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.survey-choice-card.selected .survey-choice-label {
    color: #1f2937;
    font-weight: 600;
}

/* Scale buttons */
.survey-scale {
    text-align: center;
}

.survey-scale-btns {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.survey-scale-btn {
    width: 38px;
    height: 38px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.survey-scale-btn.selected {
    background: #bda05f;
    border-color: #bda05f;
    color: #fff;
}

.survey-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    padding: 0 4px;
}

/* NPS buttons */
.survey-nps {
    text-align: center;
}

.survey-nps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    margin: 2px;
    transition: all 0.2s;
    opacity: 0.7;
}

.survey-nps-btn.selected {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nps-detractor { background: #ef4444; }
.nps-passive { background: #f59e0b; }
.nps-promoter { background: #10b981; }

.survey-nps-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 6px;
    padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════ */
/* FEEDBACK (THANK YOU SCREEN)                                 */
/* ═══════════════════════════════════════════════════════════ */

.survey-feedback {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.survey-feedback-content {
    background: #fff;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    animation: surveyFeedbackIn 0.4s ease;
}

@keyframes surveyFeedbackIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.survey-feedback-icon {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 12px;
}

.survey-feedback-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.survey-feedback-content p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.survey-feedback-reward {
    margin-top: 16px;
    padding: 12px;
    background: rgba(189, 160, 95, 0.1);
    border-radius: 10px;
    color: #bda05f;
    font-weight: 600;
    font-size: 15px;
}

.survey-feedback-reward i {
    margin-right: 6px;
}

.survey-btn-close-feedback {
    margin-top: 20px;
    background: #0C1E34;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════ */
/* HISTÓRICO DE PESQUISAS (modal Padrão B via article.modal)   */
/* ═══════════════════════════════════════════════════════════ */

/* Survey-history-modal adota Padrão B (header + nav bottom visíveis).
   O z-index precisa ficar ACIMA do head__app (999999999 em style.css:178)
   para o conteúdo do modal não ser sobreposto, mas o modal se encaixa
   ENTRE head__app (top:56px) e nav.atalhosApp (bottom ~57px) via
   pharus-modal.css (regra article.modal.open). Não escondemos mais
   head__app/bottom-nav — isso é explicitamente Padrão A (fullscreen). */
#survey-history-modal.open {
    z-index: 9999999999;
}
/* Blindagem: nenhum pseudo-overlay deste modal especifico. */
#survey-history-modal.open::before,
#survey-history-modal.open::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
}

.survey-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.survey-history-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
}

.survey-history-loading i {
    margin-right: 6px;
    color: var(--main-color, #3B82F6);
}

.survey-history-card {
    background: #fff;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.survey-history-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-bottom: 1px solid var(--border-light, #e5e7eb);
}

.survey-history-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.survey-history-card-info {
    flex: 1;
    min-width: 0;
}

.survey-history-card-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.survey-history-card-date {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

.survey-history-card-body {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.survey-history-qa {
    border-left: 3px solid var(--main-color, #3B82F6);
    padding: 2px 0 2px 10px;
}

.survey-history-q {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    margin-bottom: 2px;
    line-height: 1.4;
}

.survey-history-a {
    font-size: 13px;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.survey-history-a strong {
    color: var(--main-color, #3B82F6);
    font-size: 14px;
}
