/* =====================================================
   問い合わせモーダルフォーム専用CSS
   DigPat (旧 yasutake.net) - モダンSaaS型デザイン

   デザインコンセプト: 権威性と親しみやすさの調和
   - アイアンブルー (#192f60): 権威性・信頼性
   - マリーゴールド (#f39800): 革新性・価値
===================================================== */

/* モーダル背景オーバーレイ */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 47, 96, 0.85); /* アイアンブルーベース */
    backdrop-filter: blur(8px); /* モダンなぼかし効果 */
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.contact-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* モーダルコンテンツ */
.modal-content {
    background: white;
    border-radius: 24px; /* より丸みを帯びた角 */
    max-width: 900px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(25, 47, 96, 0.3); /* アイアンブルーのシャドウ */
    animation: slideUp 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

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

/* モーダルヘッダー */
.modal-header {
    background: linear-gradient(135deg, #192f60 0%, #1a3570 50%, #2a4580 100%); /* アイアンブルーグラデーション */
    color: white;
    padding: 35px 40px;
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* ヘッダー背景装飾 */
.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(243, 152, 0, 0.15), transparent); /* マリーゴールド装飾 */
    border-radius: 50%;
}

.modal-header h2 {
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: relative;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(243, 152, 0, 0.9); /* マリーゴールド */
    border-color: rgba(243, 152, 0, 1);
    transform: rotate(90deg) scale(1.05);
}

/* フォーム本体 */
#contactForm {
    padding: 40px;
}

/* 2カラムグリッドレイアウト */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ラベル */
label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #192f60; /* アイアンブルー */
    margin-bottom: 8px;
    display: block;
}

.required {
    color: #f39800; /* マリーゴールド */
    font-weight: 900;
    margin-left: 4px;
}

/* 入力フィールド共通スタイル */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f8fafc;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #f39800; /* マリーゴールド */
    background: white;
    box-shadow: 0 0 0 4px rgba(243, 152, 0, 0.1); /* マリーゴールドの光彩 */
}

input::placeholder,
textarea::placeholder {
    color: #94a3b8;
}

textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.6;
}

/* エラー状態 */
input.error,
textarea.error {
    border-color: #dc2626;
    background: #fef2f2;
}

.error-message {
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

input.error + .error-message,
textarea.error + .error-message {
    display: block;
}

/* 問い合わせ種別セクション */
.inquiry-types-section {
    background: linear-gradient(135deg, rgba(243, 152, 0, 0.05), rgba(243, 152, 0, 0.08)); /* マリーゴールド薄め */
    border: 2px solid rgba(243, 152, 0, 0.3);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 28px;
}

.section-label {
    font-size: 1.1rem;
    font-weight: 900;
    color: #192f60; /* アイアンブルー */
    margin-bottom: 8px;
    display: block;
}

.section-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 16px;
    margin-top: 0;
}

/* モーダル内チェックボックスグリッド */
.modal-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.modal-checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-checkbox-item:hover {
    border-color: #f39800; /* マリーゴールド */
    background: rgba(243, 152, 0, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 152, 0, 0.15);
}

.modal-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #f39800; /* マリーゴールド */
}

.modal-checkbox-item input[type="checkbox"]:checked + .modal-checkbox-label {
    color: #192f60; /* アイアンブルー */
    font-weight: 900;
}

.modal-checkbox-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

/* プライバシーポリシー同意チェックボックス */
.privacy-agreement {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 32px;
    padding: 22px;
    background: linear-gradient(135deg, rgba(25, 47, 96, 0.03), rgba(25, 47, 96, 0.05)); /* アイアンブルー薄め */
    border: 2px solid rgba(25, 47, 96, 0.2);
    border-radius: 12px;
}

.privacy-agreement input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #f39800; /* マリーゴールド */
    flex-shrink: 0;
    margin-top: 2px;
}

.privacy-agreement label {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #192f60; /* アイアンブルー */
    cursor: pointer;
}

.privacy-agreement a {
    color: #f39800; /* マリーゴールド */
    text-decoration: underline;
    font-weight: 700;
}

.privacy-agreement a:hover {
    color: #d97706; /* より濃いマリーゴールド */
}

/* 送信ボタン */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #f39800, #d97706); /* マリーゴールドグラデーション */
    color: white;
    font-size: 1.3rem;
    font-weight: 900;
    padding: 20px 44px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 12px 32px rgba(243, 152, 0, 0.4);
    letter-spacing: 0.3px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(243, 152, 0, 0.5);
    background: linear-gradient(135deg, #d97706, #92400e);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    margin-top: -13px;
    margin-left: -13px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ハニーポット（ボット対策用・人間には見えない） */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* 成功メッセージ */
.success-message {
    display: none;
    background: linear-gradient(135deg, rgba(25, 47, 96, 0.05), rgba(25, 47, 96, 0.08)); /* アイアンブルー薄め */
    border: 3px solid #192f60; /* アイアンブルー */
    border-radius: 20px;
    padding: 45px;
    text-align: center;
}

.success-message.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

.success-message h3 {
    font-size: 2rem;
    color: #192f60; /* アイアンブルー */
    margin-bottom: 16px;
    font-weight: 900;
}

.success-message p {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 28px;
}

.success-message .close-modal-btn {
    background: linear-gradient(135deg, #f39800, #d97706); /* マリーゴールド */
    color: white;
    font-size: 1.1rem;
    font-weight: 900;
    padding: 16px 44px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(243, 152, 0, 0.3);
}

.success-message .close-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(243, 152, 0, 0.4);
    background: linear-gradient(135deg, #d97706, #92400e);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .contact-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .modal-content {
        border-radius: 20px;
        margin-top: 20px;
    }

    .modal-header {
        padding: 24px 20px;
        border-radius: 20px 20px 0 0;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }

    #contactForm {
        padding: 28px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .submit-btn {
        font-size: 1.15rem;
        padding: 16px 32px;
    }

    .inquiry-types-section {
        padding: 22px 18px;
    }

    .success-message {
        padding: 32px 22px;
    }

    .success-message h3 {
        font-size: 1.6rem;
    }

    .success-message p {
        font-size: 1rem;
    }

    .modal-checkbox-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-checkbox-item {
        padding: 14px 16px;
    }
}
