/**
 * ファイル名: assets/css/style.css
 * 屋根修理診断フォーム CSS 完全版（画像フォールバック対応）
 * 
 * 機能:
 * - 吹き出しタイトルデザイン
 * - レスポンシブ対応
 * - プログレスバー・ステップインジケーター
 * - 選択肢グリッド
 * - ファイルアップロード
 * - フォーム要素
 * - ボタンスタイル
 * - 画像アイコンとFontAwesomeフォールバック対応
 * 
 * 使用制限:
 * - 絵文字使用禁止
 * - アイコンはFontAwesome使用
 */

/* ===============================
   メインコンテナ
   =============================== */
.roof-repair-container {
    max-width: 100%;
    font-family: 'Hiragino Sans', 'ヒラギノ角ゴシック', 'Yu Gothic', 'メイリオ', sans-serif;
    position: relative;
    z-index: 1;
    background-color: #ffffff;
    color: #333;
    border-radius: 6px;
    border: 1px solid #42A9BB; /* 修正: #e0e0e0 から #42A9BB に変更 */
    margin: 0 0 25px 0;
}

/* iOS Safari ダークモード対策 */
@media (prefers-color-scheme: dark) {
    .roof-repair-container {
        background-color: #ffffff !important;
        color: #333 !important;
    }
    
    .roof-repair-container .question-step {
        background-color: #ffffff !important;
        color: #333 !important;
    }
}

/* iOS Safari 専用対策 */
@supports (-webkit-touch-callout: none) {
    .roof-repair-container {
        background-color: #ffffff !important;
        color: #333 !important;
    }
    
    .question-step {
        background-color: #ffffff !important;
    }
}

/* ===============================
   フォームカード
   =============================== */
.form-card {
    background: #fff;
    border-radius: 10px;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 2;
}

/* ===============================
   ヘッダー・タイトル（新デザイン）
   =============================== */
.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-title {
    background: linear-gradient(to bottom, #e8f6f8, #d4eff3);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px 6px 0 0;
}

.form-title-text {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    /* 滑らかな白い縁取り 6px */
    -webkit-text-stroke: 6px #fff;
    paint-order: stroke fill;
}

/* 【カンタン1分】と「無料」の色指定 */
.form-title-text .highlight {
    color: #42A9BB;
}

/* 旧スタイル互換用 */
.roof-repair-container .form-card .form-header .form-title span.highlight {
    color: #42A9BB !important;
}

/* アイコンスタイル */
.form-title i {
    color: #42A9BB;
    margin-right: 8px;
}

/* エリア名の色 */
.form-title .area-name {
    color: #42A9BB;
    font-weight: bold;
}

/* ヘッダーテキスト */
.form-header p {
    color: #666;
    font-size: 14px;
    padding: 8px 20px;
}

/* ヘッダーテキストのレスポンシブ表示切り替え */
.header-text-pc {
    display: block;
}

.header-text-mobile {
    display: none;
}

/* ===============================
   プログレス関連
   =============================== */
.progress-container {
    margin-bottom: 15px;
    padding: 0 20px;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
    font-size: 12px;
    transition: all 0.3s ease;
}

.step:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 16px;
    height: 2px;
    background: #e0e0e0;
    transform: translateY(-50%);
    z-index: -1;
}

.step.completed:not(:last-child)::before {
    background: #42A9BB;
}

.step.active {
    background: #42A9BB;
    color: white;
    transform: scale(1.1);
}

.step.completed {
    background: #42A9BB;
    color: white;
}

.step.completed::after {
    display: none;
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #42A9BB, #369fb1);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: var(--progress, 0%);
}

/* ===============================
   質問ステップ
   =============================== */
.question-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 10px;
}

.question-step.active {
    display: block;
    padding: 15px 20px 20px;
}

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

.step-title,
.question-title {
    font-size: 22px;
    color: #2c5aa0;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.step-description {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* ===============================
   選択肢グリッド
   =============================== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.option {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
    z-index: 1;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 90px;
    justify-content: center;
}

.option:hover {
    border-color: #42A9BB;
    background: linear-gradient(135deg, rgba(66, 169, 187, 0.1), rgba(54, 159, 177, 0.1));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(66, 169, 187, 0.3);
    color: #2c5aa0;
}

.option:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(66, 169, 187, 0.2);
    background: linear-gradient(135deg, rgba(66, 169, 187, 0.15), rgba(54, 159, 177, 0.15));
}

.option:hover i,
.option:hover .option-icon i,
.option:hover .option-icon img {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.option:hover div:last-child,
.option:hover .option-text {
    font-weight: bold;
    transition: font-weight 0.2s ease;
}

.option.selected {
    border-color: #42A9BB;
    background: linear-gradient(135deg, #42A9BB, #369fb1);
    color: white;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 3px 10px rgba(66, 169, 187, 0.25);
}

.option-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.option-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.option-icon i {
    font-size: 32px;
    transition: transform 0.2s ease;
}

.option:hover .option-icon img,
.option:hover .option-icon i {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* ボタン内のアイコン用スタイル */
.button-icon {
    display: inline-flex !important;
    margin-right: 8px;
    vertical-align: middle;
}

.button-icon img {
    width: 20px !important;
    height: 20px !important;
}

.button-icon i {
    font-size: 20px !important;
}

/* 結果画面のアイコン用スタイル */
.result-icon-img {
    justify-content: center;
    margin-bottom: 20px;
}

.result-icon-img img {
    width: 48px !important;
    height: 48px !important;
}

.result-icon-img i {
    font-size: 48px !important;
    color: #42A9BB;
}

/* ファイルアップロードのアイコン用スタイル */
.upload-icon {
    margin: 0 auto 10px auto !important;  /* 修正: 中央寄せのマージン */
    display: flex !important;             /* 追加 */
    justify-content: center !important;   /* 追加 */
    align-items: center !important;       /* 追加 */
}

.upload-icon img {
    width: 48px !important;
    height: 48px !important;
}

.upload-icon i {
    font-size: 48px !important;
    color: #42A9BB;
}

.option-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.option-description {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 5px;
}

/* ===============================
   フォーム要素
   =============================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-input:focus {
    border-color: #42A9BB;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 169, 187, 0.1);
}

.form-group textarea,
.form-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ===============================
   ファイルアップロード
   =============================== */
.file-upload {
    position: relative;
    margin-bottom: 20px;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0.1px;
    height: 0.1px;
    overflow: hidden;
    z-index: -1;
}

.file-upload label,
.file-upload-label {
    display: block;
    padding: 30px;
    border: 2px dashed #e0e0e0;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: rgba(66, 169, 187, 0.3);
    user-select: none;
    -webkit-user-select: none;
    color: #6c757d;
}

.file-upload:hover label,
.file-upload-label:hover,
.file-upload-label:focus,
.file-upload-label:active {
    border-color: #42A9BB;
    background: #f8fdfe;
    outline: none;
}

.file-upload label i,
.file-upload-label i,
.file-upload label img,
.file-upload-label img {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin: 0 auto 10px auto;  /* 修正: margin-bottom から margin に変更 */
    display: block;
    color: #42A9BB;
    transition: transform 0.2s ease;
}

.file-upload:hover label i,
.file-upload-label:hover i,
.file-upload:hover label img,
.file-upload-label:hover img {
    transform: scale(1.1);
}

.file-upload.has-files label,
.file-upload.has-files .file-upload-label {
    border-color: #42A9BB;
    background: linear-gradient(135deg, rgba(66, 169, 187, 0.1), rgba(54, 159, 177, 0.1));
    color: #2c5aa0;
}

.file-upload.has-files label i,
.file-upload.has-files .file-upload-label i {
    color: #42A9BB;
}

.uploaded-files {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.uploaded-files h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #28a745;
}

.uploaded-file {
    padding: 5px 0;
    color: #6c757d;
    font-size: 14px;
}

/* ===============================
   ボタンスタイル
   =============================== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    z-index: 3;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, #42A9BB, #369fb1);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #369fb1, #2a8b9c);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e2e6ea;
    border-color: #dae0e5;
    transform: translateY(-1px);
}

.btn-submit {
    background: linear-gradient(135deg, #42A9BB, #369fb1);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 50px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #369fb1, #2a8b9c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 169, 187, 0.3);
}

.btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none !important;
    opacity: 0.6;
}

.button-container,
.form-navigation {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 25px;
    gap: 15px;
}

.btn-outline {
    background: white;
    color: #42A9BB;
    border: 2px solid #42A9BB;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline:hover {
    background: #42A9BB;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 169, 187, 0.3);
}

.btn-disabled {
    background: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ===============================
   結果画面
   =============================== */
.result-screen,
#resultScreen,
#diagnosisComplete,
#finalResult {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background-color: #ffffff;
    border-radius: 12px;
}

.result-screen.active,
#resultScreen.active,
#diagnosisComplete.active,
#finalResult.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.result-icon {
    font-size: 48px;
    color: #42A9BB;
    margin-bottom: 20px;
}

.result-title {
    color: #2c5aa0;
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: bold;
}

.result-message {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.result-screen p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

.completion-message {
    text-align: center;
    margin: 30px 0;
}

.completion-icon {
    font-size: 80px;
    color: #42A9BB;
    margin-bottom: 20px;
}

.completion-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

/* ===============================
   見積もりフォーム
   =============================== */
#quoteForm {
    display: none;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
    border-left: 4px solid #42A9BB;
}

.quote-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.quote-form {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.form-separator {
    display: flex;
    align-items: center;
    margin: 20px 0 30px 0;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: #ddd;
}

.separator-text {
    padding: 0 20px;
    color: #666;
    font-weight: bold;
    font-size: 14px;
}

.quote-form-buttons {
    margin-top: 30px;
    text-align: center;
}

#submitQuoteBtn {
    width: 100%;
    max-width: 400px;
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid #6c757d;
}

#submitQuoteBtn.btn-primary {
    background: #6c757d;
    color: white;
}

#submitQuoteBtn.btn-primary:hover {
    background: #5a6268;
    border-color: #5a6268;
}

#submitQuoteBtn.btn-submit {
    background: linear-gradient(135deg, #42A9BB, #369fb1) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(66, 169, 187, 0.3);
}

#submitQuoteBtn.btn-submit:hover {
    background: linear-gradient(135deg, #369fb1, #2a8b9c) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 169, 187, 0.4);
}

#submitQuoteBtn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none;
    border-color: #ccc !important;
}

/* ===============================
   エラー表示
   =============================== */
.form-input.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}

/* ===============================
   その他のユーティリティ
   =============================== */
.file-upload-label.drag-over {
    border-color: #42A9BB !important;
    background: linear-gradient(135deg, rgba(66, 169, 187, 0.2), rgba(54, 159, 177, 0.2)) !important;
    transform: scale(1.02);
}

.option.touch-active {
    background: linear-gradient(135deg, rgba(66, 169, 187, 0.1), rgba(54, 159, 177, 0.1));
    transform: scale(1.0);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid #42A9BB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================
   カスタムスクロールバー
   =============================== */
.form-textarea::-webkit-scrollbar {
    width: 8px;
}

.form-textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.form-textarea::-webkit-scrollbar-thumb {
    background: #42A9BB;
    border-radius: 4px;
}

.form-textarea::-webkit-scrollbar-thumb:hover {
    background: #369fb1;
}

/* ===============================
   アクセシビリティ
   =============================== */
html {
    scroll-behavior: smooth;
}

.option:focus,
.btn:focus,
.file-upload-label:focus {
    outline: 3px solid rgba(66, 169, 187, 0.5);
    outline-offset: 2px;
}

/* 動きを減らす設定に対応 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .option:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* ===============================
   iOS Safari専用対策
   =============================== */
@supports (-webkit-touch-callout: none) {
    .file-upload-label {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    
    .file-upload input[type="file"] {
        position: absolute;
        left: -9999px;
        top: -9999px;
        visibility: hidden;
    }
}

/* ===============================
   レスポンシブ対応 - タブレット
   =============================== */
@media (max-width: 768px) {
    /* ヘッダーテキストの表示切り替え */
    .header-text-pc {
        display: none;
    }
    
    .header-text-mobile {
        display: block;
    }
    
    /* コンテナ調整 - 横幅いっぱい */
    .roof-repair-container {
        padding: 0;
        margin: 0;
        border: none;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .form-card {
        padding: 0;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
    }
    
    /* タイトル調整 */
    .form-header {
        margin-bottom: 15px;
    }
    
    .form-title {
        padding: 12px 10px;
        border-radius: 0;
    }
    
    .form-title-text {
        font-size: 18px;
        -webkit-text-stroke: 4px #fff;
    }
    
    .form-title .area-name {
        color: #42A9BB;
    }
    
    .form-header p {
        font-size: 13px;
        color: #666;
        padding: 8px 10px;
    }
    
    /* プログレス調整 */
    .progress-container {
        margin-bottom: 15px;
        padding: 0 10px;
    }
    
    .step-indicator {
        gap: 4px;
    }
    
    .step {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .step:not(:last-child)::before {
        width: 8px;
    }
    
    /* 質問ステップ調整 */
    .question-step {
        padding: 15px 10px;
        margin-bottom: 5px;
    }
    
    .question-step.active {
        padding: 15px 10px;
    }
    
    .step-title,
    .question-title {
        font-size: 17px;
        margin-bottom: 12px;
    }
    
    .step-description {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    /* 選択肢グリッド調整 */
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .option {
        padding: 12px 8px;
        margin-bottom: 0;
        min-height: 80px;
        border-radius: 10px;
    }
    
    .option:active {
        background: rgba(66, 169, 187, 0.1);
        transform: none;
        box-shadow: none;
    }
    
    .option-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .option-icon img {
        width: 24px;
        height: 24px;
    }
    
    .option-icon i {
        font-size: 20px;
    }
    
    .button-icon img {
        width: 16px !important;
        height: 16px !important;
    }
    
    .button-icon i {
        font-size: 16px !important;
    }
    
    .result-icon-img img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .result-icon-img i {
        font-size: 40px !important;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .option-description {
        font-size: 12px;
        margin-top: 3px;
    }
    
    /* ステップインジケーター調整 */
    .step-indicator {
        gap: 3px;
        margin-bottom: 10px;
    }
    
    .step {
        margin: 1px;
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .step:not(:last-child)::before {
        width: 8px;
    }
    
    /* フォーム要素調整 */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
    }
    
    /* ボタン調整 */
    .button-container,
    .form-navigation {
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
        justify-content: flex-end;
        align-items: flex-end;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* ファイルアップロード調整 */
    .file-upload-label {
        padding: 12px 8px;
        min-height: 50px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .file-upload-label i,
    .file-upload-label img,
    .upload-icon i,
    .upload-icon img {
        font-size: 18px;
        width: 18px;
        height: 18px;
        margin-bottom: 3px;
    }
    
    .file-upload-label small {
        font-size: 11px;
        line-height: 1.3;
    }
    
    /* 結果画面調整 */
    #resultScreen,
    #diagnosisComplete,
    #finalResult {
        padding: 15px 10px;
    }
    
    .result-icon {
        font-size: 40px;
    }
    
    .result-title {
        font-size: 20px;
    }
    
    .result-message {
        font-size: 14px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin: 15px 0;
    }
    
    .btn-outline,
    .action-buttons .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
        justify-content: center;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .quote-form {
        padding: 10px;
        margin-top: 15px;
    }
    
    .completion-icon {
        font-size: 50px;
    }
    
    #quoteForm {
        padding: 10px;
        margin-top: 10px;
    }
}

/* ===============================
   レスポンシブ対応 - スマホ
   =============================== */
@media (max-width: 480px) {
    /* コンテナ調整 - 横幅いっぱい */
    .roof-repair-container {
        padding: 0;
        margin: 0;
        border: none;
        border-radius: 0;
        width: 100%;
    }
    
    .form-card {
        padding: 0;
        margin: 0;
        border-radius: 0;
        background: white;
    }
    
    /* タイトル調整 */
    .form-header {
        margin-bottom: 12px;
    }
    
    .form-title {
        padding: 10px 8px;
        border-radius: 0;
    }
    
    .form-title-text {
        font-size: 16px;
        -webkit-text-stroke: 3px #fff;
    }
    
    .form-header p {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    /* プログレス調整 */
    .progress-container {
        padding: 0 8px;
    }
    
    .step-indicator {
        gap: 3px;
    }
    
    .step {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }
    
    .step:not(:last-child)::before {
        width: 6px;
    }
    
    /* 質問ステップ調整 */
    .question-step {
        margin: 0;
        padding: 12px 8px;
    }
    
    .question-step.active {
        padding: 12px 8px;
    }
    
    .step-title,
    .question-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .step-description {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    /* 選択肢調整 */
    .options-grid {
        gap: 6px;
    }
    
    .option {
        padding: 10px 6px;
        min-height: 70px;
        border-radius: 8px;
    }
    
    .option-icon {
        font-size: 22px;
        margin-bottom: 5px;
    }
    
    .option-icon img {
        width: 22px;
        height: 22px;
    }
    
    .option-icon i {
        font-size: 22px;
    }
    
    .option-text {
        font-size: 12px;
    }
    
    .button-icon img {
        width: 14px !important;
        height: 14px !important;
    }
    
    .button-icon i {
        font-size: 14px !important;
    }
    
    /* フォーム要素調整 */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* iOSのズーム防止 */
    }
    
    /* ボタン調整 */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-submit {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    /* ファイルアップロード調整 */
    .file-upload-label {
        padding: 15px 8px;
        min-height: 60px;
    }
    
    .file-upload-label i,
    .file-upload-label img,
    .upload-icon i,
    .upload-icon img {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
    
    /* その他調整 */
    .action-buttons {
        gap: 10px;
    }
    
    .btn-outline,
    .action-buttons .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .completion-message p {
        font-size: 14px;
    }
    
    .progress-container {
        margin-bottom: 10px;
    }
    
    #resultScreen,
    #diagnosisComplete,
    #finalResult {
        margin: 5px;
    }
}

/* ===============================
   タッチデバイス専用
   =============================== */
@media (pointer: coarse) {
    .option {
        padding: 18px;
        min-height: 60px;
    }
    
    .option:hover {
        transform: none;
        box-shadow: none;
        background: white;
        border-color: #e0e0e0;
        color: inherit;
    }
    
    .option:active {
        background: linear-gradient(135deg, rgba(66, 169, 187, 0.1), rgba(54, 159, 177, 0.1));
        transform: none;
        box-shadow: none;
    }
    
    .file-upload-label {
        min-height: 90px;
        padding: 20px;
    }
    
    .btn {
        min-height: 44px;
        padding: 12px 30px;
    }
}

/* ===============================
   印刷スタイル
   =============================== */
@media print {
    .roof-repair-container {
        box-shadow: none;
        padding: 0;
    }
    
    .form-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn,
    .form-navigation {
        display: none;
    }
}


/* ===============================
   スマホ版改行対応
   =============================== */

/* PC版では改行を非表示 */
.mobile-break {
    display: none;
}

/* タブレット以下で改行を表示 */
@media (max-width: 768px) {
    .mobile-break {
        display: block;
    }
}

/* スマホ版では改行を表示 */
@media (max-width: 480px) {
    .mobile-break {
        display: block;
    }
    
    /* タイトルの行間調整 */
    .form-title {
        line-height: 1.3;
    }
}
/* ===============================
   スマホ版 新デザイン（sp-mode）
   =============================== */
.roof-repair-container.roof-repair-sp-mode {
    width: calc(100% + 30px) !important;
    margin: 0 !important;
    margin-left: -15px !important;
    margin-right: -15px !important;
    margin-bottom: 25px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: linear-gradient(180deg, #5AC8DB 0%, #42A9BB 100%) !important;
    background-color: transparent !important;
    max-width: none !important;
    font-family: 'Noto Sans JP', sans-serif;
}

/* ダークモードでもsp-modeのグラデーションを維持 */
@media (prefers-color-scheme: dark) {
    .roof-repair-container.roof-repair-sp-mode {
        background: linear-gradient(180deg, #5AC8DB 0%, #42A9BB 100%) !important;
        background-color: transparent !important;
    }
}

.roof-repair-sp-mode .form-card {
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
}

/* スマホ版ヘッダー（グラデーション内） */
.roof-repair-sp-mode .form-header {
    padding: 25px 20px 12px;
    text-align: left;
    background: transparent;
    margin-bottom: 0;
}

.roof-repair-sp-mode .form-title {
    background: transparent;
    padding: 0;
    margin-bottom: 5px;
    display: block;
    border-radius: 0;
}

.roof-repair-sp-mode .sp-title-sub {
    font-size: 27px;
    font-weight: bold;
    color: #ffffff;
    display: block;
    margin-bottom: 3px;
    line-height: 1.2;
    -webkit-text-stroke: 0;
}

.roof-repair-sp-mode .sp-title-main {
    font-size: 32px;
    font-weight: bold;
    color: #ffffff;
    display: block;
    line-height: 1.2;
    -webkit-text-stroke: 0;
}

.roof-repair-sp-mode .sp-header-subtext {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 0;
}

/* スマホ版プログレス（グラデーション内） */
.roof-repair-sp-mode .progress-container {
    padding: 0;
    margin-bottom: 0;
    background: transparent;
}

.roof-repair-sp-mode .step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 4px;
}

.roof-repair-sp-mode .step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 10px;
}

.roof-repair-sp-mode .step.active {
    background: #ffffff;
    color: #42A9BB;
    transform: scale(1.1);
}

.roof-repair-sp-mode .step.completed {
    background: #ffffff;
    color: #42A9BB;
}

.roof-repair-sp-mode .step:not(:last-child)::before {
    display: none;
}

.roof-repair-sp-mode .progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 0;
}

.roof-repair-sp-mode .progress-bar::before {
    background: #ffffff;
}

/* スマホ版コンテンツカード */
.roof-repair-sp-mode .sp-question-wrapper {
    padding: 12px 15px 20px;
    background: transparent;
}

.roof-repair-sp-mode .question-step {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.roof-repair-sp-mode .question-step.active {
    padding: 0;
}

/* スマホ版質問タイトルバー */
.roof-repair-sp-mode .sp-title-bar {
    background: #2D8A9A;
    padding: 5px 15px;
}

.roof-repair-sp-mode .sp-title-bar .step-title {
    font-size: 16px;
    color: #ffffff;
    text-align: center;
    font-weight: bold;
    margin: 0;
}

.roof-repair-sp-mode .sp-q-number {
    color: #FFE066;
}

/* スマホ版選択肢エリア */
.roof-repair-sp-mode .sp-options-area {
    padding: 15px 12px 20px;
    background: #ffffff;
}

.roof-repair-sp-mode .sp-options-area .options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

/* スマホ版立体的な選択肢 */
.roof-repair-sp-mode .sp-options-area .option {
    padding: 15px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 85px;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 4px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-bottom: 2px solid #c0c0c0;
}

.roof-repair-sp-mode .sp-options-area .option:active {
    border-color: #42A9BB;
    background: linear-gradient(180deg, #f0f9fa 0%, #e8f4f6 100%);
    transform: translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid #42A9BB;
}

.roof-repair-sp-mode .sp-options-area .option.selected {
    border-color: #42A9BB;
    background: linear-gradient(180deg, #e8f6f8 0%, #d4eff3 100%);
}

.roof-repair-sp-mode .sp-options-area .option-icon {
    font-size: 26px;
    margin-bottom: 8px;
    color: #42A9BB;
}

.roof-repair-sp-mode .sp-options-area .option-text {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
}

.roof-repair-sp-mode .sp-options-area .option-description {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* スマホ版フォーム要素 */
.roof-repair-sp-mode .sp-options-area .form-group {
    margin-bottom: 15px;
}

.roof-repair-sp-mode .sp-options-area .form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.roof-repair-sp-mode .sp-options-area .form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.roof-repair-sp-mode .sp-options-area .form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* スマホ版ボタン */
.roof-repair-sp-mode .sp-options-area .button-container {
    margin-top: 15px;
    text-align: center;
}

.roof-repair-sp-mode .sp-options-area .btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
}

.roof-repair-sp-mode .sp-options-area .btn-primary {
    background: #42A9BB;
    color: #fff;
    border: none;
}

.roof-repair-sp-mode .sp-options-area .btn-submit {
    background: linear-gradient(180deg, #42A9BB 0%, #3899AA 100%);
    color: #fff;
    border: none;
    width: 100%;
    padding: 15px;
}

/* スマホ版ファイルアップロード */
.roof-repair-sp-mode .sp-options-area .file-upload-label {
    border: 2px dashed #42A9BB;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
}

/* スマホ版結果画面 */
.roof-repair-sp-mode .sp-options-area .result-screen {
    text-align: center;
    padding: 20px;
}

.roof-repair-sp-mode .sp-options-area .result-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 15px 0;
}

.roof-repair-sp-mode .sp-options-area .result-message {
    color: #666;
    line-height: 1.6;
}

.roof-repair-sp-mode .sp-options-area .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.roof-repair-sp-mode .sp-options-area .btn-outline {
    background: #fff;
    border: 2px solid #42A9BB;
    color: #42A9BB;
}

/* スマホ版送信ボタン（オレンジ） */
.roof-repair-sp-mode .sp-options-area .btn-submit-orange {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(180deg, #F37E00 0%, #E06D00 100%);
    box-shadow: 0 4px 0 #B85800, 0 6px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.roof-repair-sp-mode .sp-options-area .btn-submit-orange:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #B85800, 0 3px 5px rgba(0, 0, 0, 0.15);
}

.roof-repair-sp-mode .sp-options-area .btn-tag {
    background: #ffffff;
    color: #F37E00;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 4px;
    margin-right: 12px;
}

.roof-repair-sp-mode .sp-options-area .btn-submit-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;


/* PC版 btn-submit-orange */
.roof-repair-container .btn-submit-orange {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 18px 24px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    background: linear-gradient(180deg, #F37E00 0%, #E06D00 100%) !important;
    box-shadow: 0 4px 0 #B85800, 0 6px 10px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.roof-repair-container .btn-submit-orange:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 0 #B85800, 0 8px 15px rgba(0, 0, 0, 0.2) !important;
}

.roof-repair-container .btn-submit-orange:active {
    transform: translateY(2px) !important;
    box-shadow: 0 2px 0 #B85800, 0 3px 5px rgba(0, 0, 0, 0.15) !important;
}

.roof-repair-container .btn-tag {
    background: #ffffff !important;
    color: #F37E00 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    padding: 5px 12px !important;
    border-radius: 4px !important;
    margin-right: 15px !important;
}

.roof-repair-container .btn-submit-text {
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: bold !important;
}
