/* --- Contact Section --- */
.contact-section {
    padding: 80px 20px; /* 上下の余白 */
    background-color: #f8f8f8; /* 背景色 */
    text-align: center; /* 中央寄せ */
}

.contact-container {
    max-width: 800px; /* フォームの最大幅 */
    margin: 0 auto; /* 中央配置 */
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* 影 */
}

.contact-title {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.contact-description {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.6;
}

.contact-form {
    display: flex;
    flex-direction: column; /* 縦に並べる */
    gap: 25px; /* 各入力グループ間のスペース */
}

.form-group {
    text-align: left; /* ラベルと入力欄を左寄せ */
}

.form-label {
    display: block; /* ブロック要素にして改行 */
    font-size: 0.95em;
    color: #555;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-input,
.form-textarea {
    width: 100%; /* 親要素の幅いっぱいに広げる */
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.5rem;
    font-family: 'Arial', sans-serif; /* フォントを調整 */
    color: #333;
    box-sizing: border-box; /* paddingとborderをwidthに含める */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    border-color: #007bff; /* フォーカス時のボーダー色 */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); /* フォーカス時の影 */
    outline: none; /* デフォルトのアウトラインを消す */
}

.form-textarea {
    resize: vertical; /* 縦方向のみリサイズ可能に */
    min-height: 80px; /* 最小の高さ */
}

.submit-button {
    background-color: #007bff; /* ボタンの背景色 */
    color: #fff; /* ボタンの文字色 */
    padding: 16px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    align-self: center; /* フォーム内で中央寄せ */
    width: auto; /* ボタンの幅はコンテンツに合わせる */
    min-width: 200px; /* 最小幅 */
    margin-top: 20px; /* 上部の余白 */
}

.submit-button:hover {
    background-color: #0056b3; /* ホバー時の色 */
    transform: translateY(-2px); /* 少し上に浮き上がる */
}

.submit-button:active {
    transform: translateY(0); /* クリック時 */
}

/* --- 確認画面と完了画面のスタイル --- */
.confirmation-details {
    text-align: left;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    word-wrap: break-word; /* 長い単語がはみ出さないように */
}

.confirmation-details p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
}

.confirmation-details p:last-child {
    margin-bottom: 0;
}

.confirmation-details strong {
    color: #333;
}

.confirmation-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
}

.confirmation-actions form {
    display: flex; /* ボタンを横並びにするため */
    gap: 20px;
    justify-content: center;
    width: 100%; /* 親要素に合わせる */
}


/* 修正する / トップに戻る ボタンの共通スタイル */
.button {
    background-color: #6c757d; /* グレー系の色 */
    color: #fff;
    padding: 14px 25px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-width: 150px;
}

.button:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* エラーメッセージのスタイル */
.error-messages {
    list-style: none;
    padding: 15px;
    margin: 0 auto 20px;
    background-color: #ffe5e5;
    color: #d8000c;
    border: 1px solid #d8000c;
    border-radius: 5px;
    max-width: 500px;
    text-align: left;
}

.error-messages li {
    margin-bottom: 5px;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 768px) {
    .contact-section {
        padding: 50px 15px;
    }

    .contact-container {
        padding: 25px;
    }

    .contact-title {
        font-size: 2em;
    }

    .contact-description {
        font-size: 1em;
        margin-bottom: 30px;
    }

    .contact-form {
        gap: 20px;
    }

    .form-input,
    .form-textarea {
        padding: 12px 15px;
    }

    .submit-button {
        padding: 14px 25px;
        font-size: 1em;
        min-width: 150px;
    }

    .confirmation-details {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 30px 10px;
    }

    .contact-container {
        padding: 20px;
        box-shadow: none; /* スマホでは影をなくしても良い */
    }

    .contact-title {
        font-size: 1.8em;
    }

    .contact-description {
        font-size: 0.9em;
        margin-bottom: 20px;
    }

    .form-input,
    .form-textarea {
        font-size: 0.9em;
    }

    .submit-button {
        width: 100%; /* スマホではボタンを横幅いっぱいに */
        min-width: unset;
    }
    .confirmation-actions {
        flex-direction: column;
        gap: 15px;
    }
    .confirmation-actions form {
        flex-direction: column;
        gap: 15px;
    }
    .button,
    .submit-button {
        width: 100%;
        min-width: unset;
    }
}