/* =========================================
   一条工務店 施主アンケート機能 スタイル
   Phase2 STEP1
   ========================================= */

/* ---- ラッパー ---- */
.ichijo-survey {
    max-width: 640px;
    margin: 24px auto;
    font-size: 16px;
    line-height: 1.7;
}

/* ---- 質問文 ---- */
.survey-question {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8e8e8;
}

/* ---- ログイン案内 ---- */
.survey-login-notice {
    background: #f0f4ff;
    border-left: 4px solid #4a6cf7;
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.survey-login-notice a {
    color: #4a6cf7;
    font-weight: 600;
    text-decoration: underline;
}

/* ---- お知らせ・エラーメッセージ ---- */
.survey-notice,
.survey-msg {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.survey-notice--closed {
    background: #f5f5f5;
    color: #666;
}
.survey-notice--ended {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    color: #795548;
}
.survey-msg--info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}
.survey-msg--error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #b71c1c;
}

/* ---- 回答フォーム ---- */
.survey-form {
    margin-top: 8px;
}

.survey-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.survey-choice-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 1em;
}
.survey-choice-label:hover {
    border-color: #4a6cf7;
    background: #f0f4ff;
}
.survey-choice-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #4a6cf7;
    flex-shrink: 0;
}

.survey-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.survey-submit-btn:hover {
    background: #3a5ce6;
}

/* ---- 集計結果 ---- */
.survey-results {
    margin-top: 8px;
}

.survey-total {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 16px;
}

.survey-result-item {
    margin-bottom: 16px;
}
.survey-result-item.survey-my-choice .survey-result-label {
    font-weight: 700;
    color: #4a6cf7;
}

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

.survey-result-label {
    font-size: 0.95em;
}

.survey-my-badge {
    display: inline-block;
    background: #4a6cf7;
    color: #fff;
    font-size: 0.72em;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.survey-result-bar-wrap {
    background: #e8e8e8;
    border-radius: 4px;
    height: 18px;
    overflow: hidden;
    margin-bottom: 4px;
}

.survey-result-bar {
    height: 100%;
    background: #4a6cf7;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

/* 自分の回答はバーの色を変える */
.survey-my-choice .survey-result-bar {
    background: #4a6cf7;
}

.survey-result-pct {
    font-size: 0.88em;
    color: #555;
}
.survey-result-pct small {
    color: #999;
}

.survey-answered-note {
    font-size: 0.85em;
    color: #888;
    margin-top: 16px;
}

/* ---- アンケート一覧 ---- */
.ichijo-survey-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.survey-list-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s;
}
.survey-list-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.survey-list-category {
    display: inline-block;
    font-size: 0.78em;
    background: #e8eeff;
    color: #4a6cf7;
    padding: 2px 10px;
    border-radius: 20px;
    align-self: flex-start;
}

.survey-badge-ended {
    display: inline-block;
    font-size: 0.75em;
    background: #f5f5f5;
    color: #999;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
}

.survey-list-title {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}
.survey-list-title:hover {
    color: #4a6cf7;
    text-decoration: underline;
}

.survey-list-count {
    font-size: 0.82em;
    color: #999;
}

.survey-list-empty {
    color: #999;
    text-align: center;
    padding: 24px;
}

/* ---- レスポンシブ対応 ---- */
@media (max-width: 600px) {
    .ichijo-survey {
        margin: 16px 0;
    }
    .survey-choice-label {
        padding: 12px 14px;
    }
    .survey-submit-btn {
        width: 100%;
        text-align: center;
    }
}
