/* =========================================================
 * 파일명: pblc-survey-ui.css
 * 용도  : 사용자 설문 / 투표 / 퀴즈 화면 전용 스타일
 * 특징  : discussion 화면과 유사한 카드형 UI + SurveyJS 커스텀
 * ========================================================= */

.psv-wrap,
.psl-wrap {
    /* max-width: 1280px; */
    width:100%;
    margin: 0 auto;
    padding: 24px 20px 60px;
    background: #f7f8fb;
    color: #222;
    /* font-family: "Malgun Gothic", "맑은 고딕", sans-serif; */
    box-sizing: border-box;
}

.psv-card,
.psl-card {
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 34, 58, 0.04);
    padding: 24px;
    margin-bottom: 20px;
}

.psv-page-title,
.psl-page-title {
    margin: 0 0 18px;
    font-size: 32px;
    line-height: 1.3;
    font-weight: 800;
    color: #111827;
}

.psv-title,
.psl-title {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.3;
    font-weight: 800;
    color: #111827;
}

.psv-desc,
.psl-desc {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.8;
    color: #4b5563;
}

.psv-meta,
.psl-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    align-items: center;
}

.psv-meta-item,
.psl-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f8fbff;
    border: 1px solid #dbe8fb;
    color: #355070;
    font-size: 14px;
    font-weight: 700;
}

.psv-meta-item strong,
.psl-meta-item strong {
    color: #111827;
}

.psv-chip,
.psl-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #edf4ff;
    color: #2f6fed;
    border: 1px solid #d6e5ff;
    font-size: 13px;
    font-weight: 800;
}

.psv-chip.type-survey,
.psl-chip.type-survey {
    background: #eef7ff;
    color: #1769d1;
}

.psv-chip.type-vote,
.psl-chip.type-vote {
    background: #eefaf0;
    color: #1d8f4d;
}

.psv-chip.type-quiz,
.psl-chip.type-quiz {
    background: #fff7ea;
    color: #b26a00;
}

.psl-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.psl-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
}

.psl-item-head {
    margin-bottom: 18px;
}

.psl-empty {
    padding: 32px 20px;
    text-align: center;
    color: #667085;
    font-size: 15px;
    line-height: 1.8;
}

.psv-section-title,
.psl-section-title {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.5;
    font-weight: 800;
    color: #111827;
}

.psv-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.psv-info-box {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #e4ecfa;
    background: #f9fbff;
}

.psv-info-box h4 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 800;
    color: #111827;
}

.psv-info-box p,
.psv-info-box div,
.psv-info-box span {
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
}

.psv-notice-box {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #e2eaf8;
    background: #fff;
}

.psv-notice-box h4 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.psv-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.psv-field {
    flex: 1 1 240px;
}

.psv-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #344054;
}

.psv-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d6deed;
    border-radius: 12px;
    box-sizing: border-box;
    background: #fff;
    font-size: 14px;
    color: #111827;
}

.psv-input:focus {
    outline: none;
    border-color: #2f6fed;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.10);
}

.psv-result-box,
.psv-history-box,
.psv-status-box {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #e5e9f2;
    background: #fff;
}

.psv-result-box.is-muted,
.psv-history-box.is-muted,
.psv-status-box.is-muted {
    background: #f9fbff;
    border-color: #e4ecfa;
}

.psv-result-box h4,
.psv-history-box h4,
.psv-status-box h4 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.psv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.psv-btn,
.psl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    min-height: 46px;
    padding: 10px 18px;
    border: 1px solid #c9d5ec;
    border-radius: 12px;
    background: #fff;
    color: #355070;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.psv-btn:hover,
.psl-btn:hover {
    border-color: #2f6fed;
    color: #2f6fed;
}

.psv-btn-primary,
.psl-btn-primary {
    background: #2f6fed;
    border-color: #2f6fed;
    color: #fff;
}

.psv-btn-primary:hover,
.psl-btn-primary:hover {
    background: #1f5de0;
    border-color: #1f5de0;
    color: #fff;
}

.psv-btn-soft {
    background: #f6f9ff;
    border-color: #d8e4fb;
    color: #2f6fed;
}

.psl-btn[aria-disabled='true'],
.psl-btn.is-disabled {
    background: #f4f6f8;
    border-color: #e4e7ec;
    color: #98a2b3;
    cursor: default;
    pointer-events: none;
}

.psv-survey-shell {
    overflow: hidden;
}

/* SurveyJS 오버라이드 */
.psv-survey-shell .sd-root-modern,
.psv-survey-shell .sd-root-modern * {
    font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
}

.psv-survey-shell .sd-root-modern {
    --sjs-corner-radius: 16px;
    --sjs-base-unit: 8px;
    --sjs-primary-backcolor: #2f6fed;
    --sjs-primary-backcolor-dark: #1f5de0;
    --sjs-primary-forecolor: #ffffff;
    --sjs-general-backcolor: #ffffff;
    --sjs-secondary-backcolor: #f8fbff;
    --sjs-question-background: #ffffff;
    --sjs-questionpanel-hovercolor: #f8fbff;
    --sjs-shadow-small: 0 4px 14px rgba(15, 34, 58, 0.04);
    --sjs-border-default: #e5e9f2;
}

.psv-survey-shell .sd-body {
    padding-top: 0;
}

.psv-survey-shell .sd-title {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
}

.psv-survey-shell .sd-description {
    color: #4b5563;
    line-height: 1.8;
}

.psv-survey-shell .sd-page,
.psv-survey-shell .sd-question,
.psv-survey-shell .sd-panel {
    border-radius: 18px;
}

.psv-survey-shell .sd-page {
    background: #fff;
    border: 1px solid #e5e9f2;
    box-shadow: 0 4px 14px rgba(15, 34, 58, 0.04);
    padding: 24px;
}

.psv-survey-shell .sd-question {
    border: 1px solid #edf1f7;
    background: #fcfdff;
    padding: 20px;
    margin-bottom: 14px;
}

.psv-survey-shell .sd-question__title {
    font-size: 18px;
    line-height: 1.7;
    font-weight: 800;
    color: #111827;
}

.psv-survey-shell .sd-item {
    border-radius: 12px;
}

.psv-survey-shell .sd-selectbase__item,
.psv-survey-shell .sd-choice {
    padding-top: 4px;
    padding-bottom: 4px;
}

.psv-survey-shell .sd-input,
.psv-survey-shell input.sd-input,
.psv-survey-shell textarea.sd-input,
.psv-survey-shell .sd-dropdown {
    border-radius: 12px;
    border-color: #d6deed;
}

.psv-survey-shell .sd-btn {
    border-radius: 12px;
    font-weight: 800;
}

.psv-survey-shell .sd-navigation__next-btn,
.psv-survey-shell .sd-navigation__complete-btn,
.psv-survey-shell .sd-navigation__prev-btn {
    min-width: 110px;
    min-height: 46px;
}

.psv-survey-shell .sd-progress {
    margin-bottom: 16px;
}

.psv-survey-shell .sd-progress__bar {
    background: linear-gradient(90deg, #2f6fed, #6fa0ff);
}

.psv-survey-shell .sd-completedpage {
    border: 1px solid #e3ebfb;
    border-radius: 16px;
    background: #f8fbff;
    padding: 24px;
}

.psv-state-kv {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.psv-state-kv strong {
    color: #111827;
}

.psv-help-text {
    margin-top: 8px;
    color: #667085;
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 900px) {
    .psv-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .psv-wrap,
    .psl-wrap {
        padding: 16px 12px 40px;
    }

    .psv-card,
    .psl-card {
        padding: 18px;
    }

    .psv-page-title,
    .psl-page-title,
    .psv-title,
    .psl-title {
        font-size: 26px;
    }

    .psv-actions,
    .psv-form-row,
    .psv-meta,
    .psl-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .psv-btn,
    .psl-btn {
        width: 100%;
    }

    .psl-list {
        grid-template-columns: 1fr;
    }

    .psv-survey-shell .sd-page,
    .psv-survey-shell .sd-question {
        padding: 16px;
    }
}

/* =========================================================
 * 모바일 전용 보정
 * 기준: 화면 가로폭 768px 이하
 * 목적:
 *  - 설문 정보영역 / 카드리스트 / 액션버튼을 1열 적층
 *  - SurveyJS 내부 여백과 버튼 크기를 모바일 친화적으로 조정
 *  - 보조 텍스트 색상을 진하게 해 가독성 개선
 * ========================================================= */
@media (max-width: 768px) {

    /* ---------- 외곽 / 카드 ---------- */
    .psv-wrap,
    .psl-wrap {
        padding: 16px 12px 36px;
    }

    .psv-card,
    .psl-card,
    .psv-info-box,
    .psv-notice-box,
    .psv-result-box,
    .psv-history-box,
    .psv-status-box,
    .psv-survey-shell .sd-page,
    .psv-survey-shell .sd-question,
    .psv-survey-shell .sd-completedpage {
        padding: 16px;
    }

    .psv-card,
    .psl-card {
        margin-bottom: 18px;
    }

    /* ---------- 다열 -> 1열 적층 ---------- */
    .psv-info-grid,
    .psl-list {
        grid-template-columns: 1fr;
    }

    .psv-actions,
    .psv-form-row,
    .psv-meta,
    .psl-meta,
    .psv-state-kv {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .psv-field {
        flex: none;
        width: 100%;
    }

    /* ---------- 제목 / 설명 / 보조텍스트 ---------- */
    .psv-desc,
    .psl-desc,
    .psv-help-text,
    .psl-empty,
    .psv-info-box p,
    .psv-info-box div,
    .psv-info-box span {
        color: #475569;
    }

    .psv-page-title,
    .psl-page-title,
    .psv-title,
    .psl-title {
        font-size: 28px;
        line-height: 1.35;
    }

    .psv-section-title,
    .psl-section-title,
    .psv-result-box h4,
    .psv-history-box h4,
    .psv-status-box h4,
    .psv-notice-box h4 {
        font-size: 20px;
        line-height: 1.45;
    }

    .psv-desc,
    .psl-desc,
    .psv-info-box p,
    .psv-info-box div,
    .psv-info-box span,
    .psv-help-text,
    .psl-empty {
        font-size: 15px;
        line-height: 1.8;
    }

    .psv-meta-item,
    .psl-meta-item,
    .psv-chip,
    .psl-chip {
        font-size: 14px;
    }

    /* ---------- 입력 / 버튼 ---------- */
    .psv-input,
    .psv-btn,
    .psl-btn,
    .psv-survey-shell .sd-btn,
    .psv-survey-shell .sd-navigation__next-btn,
    .psv-survey-shell .sd-navigation__complete-btn,
    .psv-survey-shell .sd-navigation__prev-btn {
        min-height: 46px;
        font-size: 15px;
    }

    .psv-btn,
    .psl-btn {
        width: 100%;
    }

    .psv-field label {
        font-size: 15px;
        color: #1f2937;
    }

    .psv-input {
        padding: 0 12px;
    }

    /* ---------- SurveyJS 내부 가독성 ---------- */
    .psv-survey-shell .sd-title {
        font-size: 24px;
        line-height: 1.4;
    }

    .psv-survey-shell .sd-description,
    .psv-survey-shell .sd-completedpage,
    .psv-survey-shell .sd-item__control-label,
    .psv-survey-shell .sd-comment,
    .psv-survey-shell .sd-text {
        color: #475569;
        font-size: 15px;
        line-height: 1.75;
    }

    .psv-survey-shell .sd-question__title {
        font-size: 18px;
        line-height: 1.7;
    }
}

/* =========================================================
 * 모바일 전용 보정
 * 기준 참조:
 *  - pblc-comm-main_rev.css 의 모바일 카드/버튼/텍스트 밀도
 *  - survey 화면 전용 class(psv / psl) 구조에 맞춘 재정의
 * 적용 위치:
 *  - pblc-survey-ui.css 맨 아래
 * ========================================================= */
@media (max-width: 768px) {

    /* ---------- 외곽 / 기본 여백 ---------- */
    .psv-wrap,
    .psl-wrap {
        padding: 16px 12px 40px;
        background: #f4f6fb;
    }

    .psv-card,
    .psl-card {
        padding: 16px;
        margin-bottom: 18px;
        border-radius: 18px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    }

    /* ---------- 타이틀 / 설명 ---------- */
    .psv-page-title,
    .psl-page-title {
        font-size: 30px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .psv-title,
    .psl-title {
        font-size: 24px;
        line-height: 1.35;
        margin-bottom: 10px;
    }

    .psv-section-title,
    .psl-section-title,
    .psv-result-box h4,
    .psv-history-box h4,
    .psv-status-box h4,
    .psv-notice-box h4,
    .psv-info-box h4 {
        font-size: 20px;
        line-height: 1.45;
    }

    .psv-desc,
    .psl-desc,
    .psl-empty,
    .psv-help-text,
    .psv-info-box p,
    .psv-info-box div,
    .psv-info-box span,
    .psv-result-box,
    .psv-history-box,
    .psv-status-box,
    .psv-notice-box {
        font-size: 15px;
        line-height: 1.75;
        color: #475569;
    }

    /* ---------- 메타 / chip ---------- */
    .psv-meta,
    .psl-meta,
    .psv-actions,
    .psv-form-row,
    .psv-state-kv {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .psv-meta-item,
    .psl-meta-item {
        width: 100%;
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
        box-sizing: border-box;
    }

    .psv-chip,
    .psl-chip {
        width: auto;
        max-width: fit-content;
        min-height: 30px;
        padding: 6px 12px;
        font-size: 13px;
        align-self: flex-start;
    }

    /* ---------- 정보 영역 / 리스트 ---------- */
    .psv-info-grid,
    .psl-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .psv-info-box,
    .psv-notice-box,
    .psv-result-box,
    .psv-history-box,
    .psv-status-box {
        padding: 16px;
        border-radius: 16px;
    }

    .psl-item {
        min-height: auto;
    }

    .psl-item-head {
        margin-bottom: 14px;
    }

    /* ---------- 입력 ---------- */
    .psv-field {
        flex: none;
        width: 100%;
    }

    .psv-field label {
        font-size: 15px;
        font-weight: 800;
        color: #1f2937;
        margin-bottom: 6px;
    }

    .psv-input {
        width: 100%;
        height: 46px;
        padding: 0 12px;
        font-size: 15px;
        border-radius: 12px;
    }

    /* ---------- 버튼 ---------- */
    .psv-btn,
    .psl-btn {
        width: 100%;
        min-height: 46px;
        padding: 10px 16px;
        font-size: 15px;
        border-radius: 12px;
    }

    /* ---------- SurveyJS ---------- */
    .psv-survey-shell .sd-page,
    .psv-survey-shell .sd-question,
    .psv-survey-shell .sd-completedpage {
        padding: 16px;
        border-radius: 16px;
    }

    .psv-survey-shell .sd-title {
        font-size: 24px;
        line-height: 1.4;
    }

    .psv-survey-shell .sd-description,
    .psv-survey-shell .sd-completedpage,
    .psv-survey-shell .sd-item__control-label,
    .psv-survey-shell .sd-comment,
    .psv-survey-shell .sd-text,
    .psv-survey-shell .sd-input,
    .psv-survey-shell textarea.sd-input {
        font-size: 15px;
        line-height: 1.75;
        color: #475569;
    }

    .psv-survey-shell .sd-question {
        margin-bottom: 12px;
        padding: 16px;
    }

    .psv-survey-shell .sd-question__title {
        font-size: 18px;
        line-height: 1.7;
    }

    .psv-survey-shell .sd-selectbase__item,
    .psv-survey-shell .sd-choice {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .psv-survey-shell .sd-input,
    .psv-survey-shell input.sd-input,
    .psv-survey-shell textarea.sd-input,
    .psv-survey-shell .sd-dropdown {
        min-height: 46px;
        border-radius: 12px;
        font-size: 15px;
    }

    .psv-survey-shell textarea.sd-input {
        min-height: 110px;
    }

    .psv-survey-shell .sd-btn,
    .psv-survey-shell .sd-navigation__next-btn,
    .psv-survey-shell .sd-navigation__complete-btn,
    .psv-survey-shell .sd-navigation__prev-btn {
        min-height: 46px;
        font-size: 15px;
        border-radius: 12px;
    }

    .psv-survey-shell .sd-navigation {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .psv-survey-shell .sd-navigation__next-btn,
    .psv-survey-shell .sd-navigation__complete-btn,
    .psv-survey-shell .sd-navigation__prev-btn {
        width: 100%;
        min-width: 0;
    }

    .psv-survey-shell .sd-progress {
        margin-bottom: 14px;
    }
}

/* =========================================================
 * 설문 상세 상단 이동 영역
 * - 메인으로 돌아가기 / 다른 설문조사 이동
 * - movableFormList는 컨트롤러에서 권한 체크 완료된 목록만 전달해야 함
 * ========================================================= */
.psv-move-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #edf1f7;
}

.psv-back-btn,
.psv-move-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 16px;
    border: 1px solid #b9c7e4;
    border-radius: 12px;
    background: #fff;
    color: #2f5aa7;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.psv-back-btn:hover,
.psv-move-submit-btn:hover {
    border-color: #2f6fed;
    color: #2f6fed;
    background: #f8fbff;
    text-decoration: none;
}

.psv-survey-move-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.psv-survey-move-label {
    font-size: 14px;
    font-weight: 800;
    color: #111827;
}

.psv-survey-move-select {
    min-width: 300px;
    height: 38px;
    padding: 0 36px 0 12px;
    border: 1px solid #b9c7e4;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
}

.psv-survey-move-select:focus {
    outline: none;
    border-color: #2f6fed;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.10);
}

.psv-move-submit-btn {
    background: #2f6fed;
    border-color: #2f6fed;
    color: #fff;
}

.psv-move-submit-btn:hover {
    background: #1f5de0;
    border-color: #1f5de0;
    color: #fff;
}

@media (max-width: 768px) {
    .psv-move-row,
    .psv-survey-move-box {
        align-items: stretch;
        flex-direction: column;
    }

    .psv-back-btn,
    .psv-survey-move-select,
    .psv-move-submit-btn {
        width: 100%;
    }
}
