/* ========================================
   CTAセクション - レスポンシブ対応
   ======================================== */

/* タブレット対応 (768px - 991px) */
@media (max-width: 991px) {
    .section-cta h2 {
        font-size: 32px !important;
    }
    
    .section-cta > div > div:first-child p {
        font-size: 16px !important;
    }
    
    /* 診断カード */
    .section-cta > div > div:nth-child(2) {
        padding: 40px 40px !important;
    }
    
    .section-cta h3 {
        font-size: 24px !important;
    }
    
    /* フォームグリッドを1列に */
    #contactForm > div:nth-child(1),
    #contactForm > div:nth-child(2) {
        grid-template-columns: 1fr !important;
    }
}

/* モバイル対応 (max-width: 767px) */
@media (max-width: 767px) {
    .section-cta {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    
    .section-cta h2 {
        font-size: 26px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }
    
    .section-cta > div > div:first-child {
        margin-bottom: 30px !important;
    }
    
    .section-cta > div > div:first-child p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    /* 診断カード */
    .section-cta > div > div:nth-child(2) {
        padding: 30px 20px !important;
        border-radius: 12px !important;
    }
    
    /* アイコンバッジ */
    .section-cta .icon-badge {
        width: 60px !important;
        height: 60px !important;
        font-size: 24px !important;
        margin: 0 auto 16px !important;
    }
    
    .section-cta h3 {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    
    .section-cta h3 + p {
        font-size: 13px !important;
        margin-top: 8px !important;
    }
    
    /* フォーム */
    #contactForm {
        margin-top: 25px !important;
    }
    
    #contactForm > div:nth-child(1),
    #contactForm > div:nth-child(2) {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-bottom: 15px !important;
    }
    
    #contactForm label {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }
    
    #contactForm input,
    #contactForm textarea {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    #contactForm button {
        padding: 16px 24px !important;
        font-size: 16px !important;
        border-radius: 32px !important;
    }
    
    #contactForm button i {
        font-size: 16px !important;
    }
    
    /* 診断内容グリッド */
    .section-cta > div > div:nth-child(2) > div:last-child > div:nth-child(2) {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child > div:nth-child(2) > div {
        padding: 16px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child > div:nth-child(2) > div > div:first-child {
        font-size: 28px !important;
        margin-bottom: 6px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child > div:nth-child(2) h5 {
        font-size: 13px !important;
        margin-bottom: 4px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child > div:nth-child(2) p {
        font-size: 11px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child h4 {
        font-size: 16px !important;
        margin-bottom: 16px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child {
        margin-top: 25px !important;
        padding-top: 20px !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child > p {
        font-size: 12px !important;
    }
}

/* 極小スクリーン対応 (max-width: 480px) */
@media (max-width: 480px) {
    .section-cta h2 {
        font-size: 22px !important;
    }
    
    .section-cta > div > div:nth-child(2) {
        padding: 25px 16px !important;
    }
    
    .section-cta h3 {
        font-size: 18px !important;
    }
    
    .section-cta .icon-badge {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    #contactForm button {
        padding: 14px 20px !important;
        font-size: 15px !important;
    }
}

/* 固定フッターCTAの追加（オプション） */
@media (max-width: 991px) {
    .fixed-cta-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #2D7EF7, #64A8FF);
        padding: 12px 20px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .fixed-cta-mobile.active {
        transform: translateY(0);
    }
    
    .fixed-cta-mobile a {
        color: white;
        text-decoration: none;
        font-weight: 700;
        font-size: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .fixed-cta-mobile i {
        font-size: 18px;
    }
    
    /* スクロール時に表示 */
    body.scrolled .fixed-cta-mobile {
        transform: translateY(0);
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .section-cta > div > div:nth-child(2) {
        background: rgba(30, 41, 59, 0.95) !important;
    }
    
    .section-cta h3 {
        color: #f1f5f9 !important;
    }
    
    .section-cta h3 + p {
        color: #cbd5e1 !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child > div:nth-child(2) > div {
        background: rgba(15, 23, 42, 0.8) !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child h4 {
        color: #f1f5f9 !important;
    }
    
    .section-cta > div > div:nth-child(2) > div:last-child h5 {
        color: #f1f5f9 !important;
    }
    
    #contactForm label {
        color: #94a3b8 !important;
    }
    
    #contactForm input,
    #contactForm textarea {
        background: rgba(15, 23, 42, 0.5) !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }
    
    #contactForm input:focus,
    #contactForm textarea:focus {
        border-color: #3b82f6 !important;
        background: rgba(15, 23, 42, 0.7) !important;
    }
}

/* アクセシビリティ: フォーカス表示の強化 */
#contactForm input:focus,
#contactForm textarea:focus {
    outline: 3px solid rgba(59, 130, 246, 0.3);
    outline-offset: 2px;
    border-color: #3b82f6 !important;
}

#contactForm button:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 3px;
}

/* アクセシビリティ: ハイコントラストモード */
@media (prefers-contrast: high) {
    .section-cta h2,
    .section-cta h3 {
        text-shadow: none !important;
    }
    
    #contactForm input,
    #contactForm textarea {
        border-width: 3px !important;
    }
    
    #contactForm button {
        border: 3px solid #ffffff !important;
    }
}

/* 印刷対応 */
@media print {
    .section-cta {
        page-break-inside: avoid;
        background: white !important;
    }
    
    .section-cta h2,
    .section-cta h3 {
        color: black !important;
    }
    
    #contactForm button {
        display: none !important;
    }
    
    .section-cta::after {
        content: "お問い合わせはウェブサイトからお願いします";
        display: block;
        text-align: center;
        margin-top: 20px;
        font-size: 14px;
        color: #64748b;
    }
}
