/* ========================================
   外壁・屋根 診断システム スタイル
   ======================================== */

/* リセット・ベース */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7f9;
    min-height: 100vh;
}

/* コンテナ */
.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

/* ヘッダー */
.header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #15683c 0%, #0d4a2a 100%);
    color: #fff;
}

.header-logo {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* メイン */
.main {
    flex: 1;
    padding: 0;
}

/* スクリーン共通 */
.screen {
    display: none;
    padding: 24px 20px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* ========================================
   スタート画面
   ======================================== */
.start-content {
    text-align: center;
    padding: 20px 0;
}

.start-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 24px;
    border-radius: 30px;
    margin-bottom: 24px;
}

.start-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.4;
    color: #15683c;
    margin-bottom: 20px;
}

.start-description {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

.start-warning {
    background-color: #fff8e1;
    border: 1px solid #ffcc02;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 32px;
    font-size: 14px;
    color: #795548;
}

.warning-icon {
    margin-right: 8px;
}

.start-note {
    font-size: 12px;
    color: #999;
    margin-top: 16px;
}

/* ========================================
   進捗バー
   ======================================== */
.progress-container {
    margin-bottom: 24px;
}

.progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #15683c 0%, #2e7d52 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: right;
    font-size: 13px;
    color: #666;
}

/* ========================================
   質問画面
   ======================================== */
.question-container {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    position: relative;
}

.option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.option-label:hover {
    border-color: #15683c;
    background-color: #f0f7f3;
}

.option-input:checked + .option-label {
    border-color: #15683c;
    background-color: #e8f5e9;
}

.option-checkbox,
.option-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-radio {
    border-radius: 50%;
}

.option-input:checked + .option-label .option-checkbox,
.option-input:checked + .option-label .option-radio {
    background-color: #15683c;
    border-color: #15683c;
}

.option-input:checked + .option-label .option-checkbox::after,
.option-input:checked + .option-label .option-radio::after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.option-text {
    flex: 1;
}

/* ナビゲーションボタン */
.navigation-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* ========================================
   フォーム画面
   ======================================== */
.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-title {
    font-size: 24px;
    font-weight: bold;
    color: #15683c;
    margin-bottom: 12px;
}

.form-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.form-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #e3f2fd;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #1565c0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.required {
    background-color: #e53935;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #15683c;
}

.form-input.error {
    border-color: #e53935;
}

.error-message {
    display: block;
    font-size: 12px;
    color: #e53935;
    margin-top: 6px;
    min-height: 18px;
}

/* チェックボックス */
.checkbox-group {
    margin-top: 24px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-text {
    font-size: 14px;
    color: #666;
}

.checkbox-text a {
    color: #15683c;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

/* ========================================
   ボタン
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6b00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background-color: #eee;
}

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

.btn-lg {
    padding: 18px 32px;
    font-size: 17px;
    border-radius: 12px;
}

.btn-arrow {
    transition: transform 0.2s ease;
}

.btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ========================================
   ローディング
   ======================================== */
.loading-content {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #15683c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    color: #666;
}

/* ========================================
   結果画面
   ======================================== */
.result-screen {
    padding: 24px 20px;
}

.result-complete {
    text-align: center;
    padding: 24px;
    background-color: #e8f5e9;
    border-radius: 16px;
    margin-bottom: 24px;
}

.complete-icon {
    width: 56px;
    height: 56px;
    background-color: #15683c;
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.complete-text {
    font-size: 18px;
    font-weight: bold;
    color: #15683c;
    margin-bottom: 8px;
}

.complete-note {
    font-size: 13px;
    color: #666;
}

/* 結果カード */
.result-card {
    border: 3px solid;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
}

.result-header {
    padding: 16px 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-level {
    font-size: 16px;
}

.result-level strong {
    font-size: 20px;
}

.result-score {
    font-size: 14px;
    opacity: 0.9;
}

.result-body {
    padding: 24px 20px;
}

.result-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
}

.result-summary {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
}

.result-comments {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.comments-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.comments-list {
    list-style: none;
}

.comments-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.comments-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ff6b00;
    font-weight: bold;
}

/* CTAセクション */
.cta-section {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-radius: 16px;
    padding: 28px 20px;
    margin-bottom: 24px;
    text-align: center;
}

.cta-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.cta-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cta-btn {
    flex-direction: row;
    text-align: left;
    padding: 16px 20px;
}

.cta-btn-icon {
    font-size: 24px;
    margin-right: 4px;
}

.cta-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cta-btn-main {
    font-size: 16px;
    font-weight: bold;
}

.cta-btn-sub {
    font-size: 12px;
    opacity: 0.8;
}

/* 回答内容アコーディオン */
.answers-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 24px;
}

.answers-toggle {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    list-style: none;
}

.answers-toggle::-webkit-details-marker {
    display: none;
}

.answers-toggle::after {
    content: '▼';
    float: right;
    font-size: 12px;
    transition: transform 0.2s ease;
}

details[open] .answers-toggle::after {
    transform: rotate(180deg);
}

.answers-content {
    padding: 0 20px 20px;
}

.answer-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.answer-item:last-child {
    border-bottom: none;
}

.answer-question {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.answer-value {
    font-size: 14px;
    color: #333;
}

/* 戻るリンク */
.back-to-top {
    text-align: center;
}

.link-back {
    font-size: 14px;
    color: #666;
    text-decoration: none;
}

.link-back:hover {
    color: #15683c;
}

/* フッター */
.footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.footer-text {
    font-size: 12px;
    color: #999;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (min-width: 480px) {
    .form-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .navigation-buttons {
        justify-content: space-between;
    }
}
