html {
    width: 100%;
    overflow-x: hidden;
}

html,
body {
    height: 100%;
    /* HTMLとBodyの高さをビューポートに合わせる */
    margin: 0; /* ← 既にリセットされています */
    padding: 0;
    width: 100%;
}
/* -------------------------------------------
   ページ全体とヘッダーのデザイン
------------------------------------------- */
/* ページ全体を囲むコンテナ */
.contact-page-container {
    /* 💡 変更: 最大幅を解除し、paddingを0に（フォーム部分で改めて中央寄せするため） */
    max-width: 100%; /* 画面幅いっぱい */
    margin: 0;
    padding: 0;
}
/* -------------------- 0. メインビジュアル/ページヘッダー (グレーの部分) -------------------- */
.page-header-section {
    /* グラデーション */
    background: linear-gradient(to right, #f7f7f7 0%, #a6a6a6 100%);
    min-height: 300px; 
    position: relative;
    overflow: hidden; 
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    width: 100%;
}

/* 大きいロゴの最適化 */
.logo-large {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    text-align: center;
    max-width: 350px; 
    max-height: 250px;
}

.large-logo-img {
    max-width: 100%; /* 親要素に収まるように自動縮小 */
    max-height: 100%; 
    width: auto;
    height: auto; 
    display: block; 
    margin: 0 auto 5px;
}

/* -------------------- キャッチコピーエリア -------------------- */
.catchphrase-area {
    /* 修正点2: Flexboxの挙動で、コンテンツブロック全体を右側に寄せる */
    margin-left: auto;
    /* 縦位置を真ん中に設定 */
    align-self: center;
    position: relative;
    right: 100px;
    font-size: 80px;
    font-weight: 800;
}

/* -------------------------------------------
   フォームコンテナ (背景色のグレーが始まる部分)
------------------------------------------- */
.contact-form-wrapper {
    /* 💡 変更: 最大幅を解除し、背景を画面幅いっぱいに広げる */
    background-color: #e6e6e6;
    padding: 0 0 2em; /* 上下のパディングは維持、左右は0 */
    box-sizing: border-box;
    max-width: 100%; /* 画面幅いっぱい */
    margin: 0;
}

/* CF7のデフォルトのラッパー div.wpcf7 に適用 */
div.wpcf7 {
    /* 💡 変更: フォーム内容の最大幅を設定し、中央寄せ */
    background-color: transparent !important; /* 親要素の背景色を継承 */
    padding: 0 !important; /* CF7のデフォルトパディングをリセット */
    box-sizing: border-box;
    max-width: 960px; /* フォームコンテンツ自体の最大幅をここで設定 */
    margin: 0 auto; /* 中央寄せ */
}

/* -------------------- お問い合わせメッセージエリア -------------------- */
.form-message-container {
    background-color: #fff; /* 白い背景 */
    padding: 2px 2px; /* 上下の余白 */
    text-align: center;
    width: 100%; 
    box-sizing: border-box; 
    /* 💡 追記: ヘッダー直下に白い帯が来る場合、メインビジュアルとの間に隙間がないか確認する */
}

.form-message-top {
    font-size: 30px; 
    font-weight: 700;
    line-height: 1.5;
    color: #333;
    /* メッセージを中央に配置する設定のみ残す */
    display: block;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
}

.cf7-area {
    padding: 70px 20px 0; /* フォーム全体のパディング */
    box-sizing: border-box;
}
/* -------------------------------------------
   各フォームフィールドのスタイル
------------------------------------------- */
/* 各入力フィールドのコンテナ (Pタグ) */
div.wpcf7 form p {
    margin-bottom: 1.3em;
    padding: 0 1em;
    /* 💡 追加: フィールドコンテナの最大幅を設定し、中央寄せ */
    max-width: 650px; 
    margin-left: auto;
    margin-right: auto;
}

/* ラベルのスタイル */
div.wpcf7 form label {
    display: block;
    font-size: 1.6em;
    color: #333;
    font-weight: bold;
}

/* 入力フィールド (text, email, tel, select) の共通スタイル */
div.wpcf7 form input:not([type="submit"]),
div.wpcf7 form select {
    background-color: #ffffff;
    border: none;
    border-radius: 0;
    padding: 0.8em 1em;
    width: 100%;
    box-sizing: border-box;
    display: block;
    font-size: 0.8em;
    /* 💡 変更: 入力欄の横幅は画像に合わせて450pxに制限 */
    max-width: 700px;
    box-shadow: none; /* 画像に合わせて影を解除 */
    margin-left: -5px; /* max-width設定時に左寄せにする */
    margin-top: 10px;
    border-radius: 35px;
}

/* テキストエリアのスタイル */
div.wpcf7 form textarea {
    /* テキストエリアは幅いっぱいに広げるため、 max-width を解除 */
    max-width: 700px;
    width: 100%;
    min-height: 250px; /* 💡 変更: 高さを大きくするため 250px -> 350px に変更 */
    background-color: #ffffff;
    border: none;
    border-radius: 35px; /* 角を丸く */
    padding: 1.5em; 
    box-sizing: border-box;
    display: block;
    box-shadow: none; /* 画像に合わせて影を解除 */
    font-size: 1.2em;
}

/* -------------------------------------------
   プライバシーポリシーのテキストと送信ボタン
------------------------------------------- */
/* プライバシーポリシーの確認テキスト */
.privacy-policy-text {
    text-align: center;
    font-size: 1em;
    margin-top: 1.5em; 
    /* 💡 追加: 中央寄せのテキストの最大幅を設定 */
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* 送信ボタンのスタイル */
div.wpcf7 form input[type="submit"] {
    background-color: #ffffff;
    color: #333;
    border-radius: 35px;
    padding: 0.9em 2em;
    font-size: 1.5em;
    cursor: pointer;
    display: block;
    width: auto;
    margin: 2em auto 1em; /* 上下の余白と中央寄せ */
    transition: background-color 0.3s;
    border: none;
}

div.wpcf7 form input[type="submit"]:hover {
    background-color: #f0f0f0;
}

div.wpcf7 form input[type="button"] {
    background-color: #ffffff;
    color: #333;
    border-radius: 35px;
    padding: 0.5em 1.4em;
    font-size: 1.4em;
    cursor: pointer;
    width: auto;
    margin: 0.5em auto; /* 上下の余白と中央寄せ */
    transition: background-color 0.3s;
    border: none;
}

/*サンクスページ用スタイル*/
/* -------------------------------------------
   サンクスページ専用のスタイル (追記)
   - .contact-form-wrapperをFlexboxにして中央寄せ
------------------------------------------- */

.thanks-contents-wrapper {
    /* 💡 既存のスタイルを維持 */
    background-color: #e5e5e5;
    /* paddingはサンクスページ表示時に上書きまたは調整 */
    
    /* 💡 中央寄せのための設定 (修正点: min-heightを追加) */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直方向中央寄せ */
    align-items: center; /* 水平方向中央寄せ (子要素に対して) */
    text-align: center; 
    
    /* 💡 修正点: 垂直方向の中央寄せを機能させるために最低限の高さを確保 */
    /* フォームを非表示にしたページでは、画面の半分(50vh)を最低限の高さとします */
    min-height: 50vh; 
    
    /* フォームが表示されないサンクスページでのパディング調整 */
    padding-bottom: 50px;
}

/* Thanksコンテンツを中央でまとめるコンテナ */
.thanks-content {
    /* 中央に配置されるコンテンツの最大幅と余白 */
    max-width: 600px;
    padding: 140px 40px 60px; /* ユーザー指定のパディングを維持 */
    
    /* 💡 追記: thanks-content内のテキストを中央寄せ (念のため) */
    text-align: center; 
}

/* ... (以下、その他のスタイルは維持) ... */

/* チェックマーク画像のスタイル */
.thanks-check-mark {
    width: 100px; 
    height: auto;
    display: block; 
    margin: 10px auto; /* block要素を水平中央寄せ */
}

/* メインメッセージのスタイル */
.thanks-message {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-top: 30px; 
    margin-bottom: 10px;
}

/* ==================== レスポンシブ対応 ==================== */

/* タブレット対応 (1024px以下) */
@media (max-width: 1024px) {
    .page-header-section {
        min-height: 350px;
    }

    .catchphrase-area {
        right: 80px;
        font-size: 60px;
    }

    .logo-large {
        max-width: 300px;
    }

    .cf7-area {
        padding: 50px 20px 0;
    }

    div.wpcf7 form p {
        max-width: 600px;
    }

    div.wpcf7 form input:not([type="submit"]),
    div.wpcf7 form select,
    div.wpcf7 form textarea {
        max-width: 600px;
    }
}

/* タブレット対応 (768px以下) */
@media (max-width: 768px) {
    .contact-page-container {
        max-width: 100%;
        padding: 0;
    }

    .page-header-section {
        min-height: 280px;
    }

    .header-content {
        width: 100%;
        padding: 0 15px;
    }

    .logo-large {
        max-width: 250px;
        left: 10px;
    }

    .catchphrase-area {
        right: 60px;
        font-size: 50px;
    }

    .contact-form-wrapper {
        max-width: 100%;
        padding: 0 0 1.5em;
    }

    div.wpcf7 {
        max-width: 100%;
        padding: 0 !important;
    }

    .form-message-container {
        padding: 20px 15px;
    }

    .form-message-top {
        font-size: 24px;
    }

    .cf7-area {
        padding: 40px 15px 0;
    }

    div.wpcf7 form p {
        max-width: 100%;
        padding: 0 10px;
        margin-bottom: 1em;
    }

    div.wpcf7 form label {
        font-size: 1.4em;
    }

    div.wpcf7 form input:not([type="submit"]),
    div.wpcf7 form select {
        max-width: 100%;
        padding: 0.7em 0.8em;
        font-size: 0.9em;
        margin-left: 0;
    }

    div.wpcf7 form textarea {
        max-width: 100%;
        min-height: 200px;
        padding: 1.2em;
    }

    .privacy-policy-text {
        max-width: 100%;
        padding: 0 15px;
        font-size: 0.9em;
    }

    div.wpcf7 form input[type="submit"],
    div.wpcf7 form input[type="button"] {
        font-size: 1.2em;
        padding: 0.8em 1.6em;
    }

    .thanks-contents-wrapper {
        min-height: 50vh;
        padding: 80px 20px 40px;
    }

    .thanks-content {
        max-width: 100%;
        padding: 40px 20px;
    }

    .thanks-check-mark {
        width: 80px;
    }

    .thanks-message {
        font-size: 28px;
        margin-top: 20px;
    }
}

/* スマホ対応 (600px以下) */
@media (max-width: 600px) {
    .page-header-section {
        min-height: 250px;
    }

    .header-content {
        padding: 0 10px;
    }

    .logo-large {
        max-width: 200px;
        left: 5px;
    }

    .large-logo-img {
        max-width: 100%;
    }

    .catchphrase-area {
        right: 40px;
        font-size: 40px;
    }

    .form-message-container {
        padding: 15px 12px;
    }

    .form-message-top {
        font-size: 20px;
        line-height: 1.4;
    }

    .cf7-area {
        padding: 30px 12px 0;
    }

    div.wpcf7 form p {
        max-width: 100%;
        padding: 0 8px;
        margin-bottom: 0.9em;
    }

    div.wpcf7 form label {
        font-size: 1.2em;
        color: #333;
    }

    div.wpcf7 form input:not([type="submit"]),
    div.wpcf7 form select {
        max-width: 100%;
        padding: 0.6em 0.8em;
        font-size: 1em;
    }

    div.wpcf7 form textarea {
        max-width: 100%;
        min-height: 180px;
        padding: 1em;
        font-size: 1em;
    }

    .privacy-policy-text {
        padding: 0 12px;
        font-size: 0.85em;
    }

    div.wpcf7 form input[type="submit"],
    div.wpcf7 form input[type="button"] {
        font-size: 1.1em;
        padding: 0.7em 1.4em;
        margin: 1.5em auto 1em;
    }

    .thanks-contents-wrapper {
        min-height: 50vh;
        padding: 60px 15px 30px;
    }

    .thanks-content {
        max-width: 100%;
        padding: 30px 15px;
    }

    .thanks-check-mark {
        width: 70px;
    }

    .thanks-message {
        font-size: 24px;
        margin-top: 15px;
    }
}

/* 小さいスマホ対応 (480px以下) */
@media (max-width: 480px) {
    .page-header-section {
        min-height: 220px;
    }

    .logo-large {
        max-width: 150px;
    }

    .catchphrase-area {
        right: 30px;
        font-size: 32px;
    }

    .form-message-top {
        font-size: 18px;
    }

    .cf7-area {
        padding: 25px 10px 0;
    }

    div.wpcf7 form p {
        padding: 0 6px;
    }

    div.wpcf7 form label {
        font-size: 1em;
    }

    div.wpcf7 form input:not([type="submit"]),
    div.wpcf7 form select,
    div.wpcf7 form textarea {
        max-width: 100%;
        font-size: 1em;
        padding: 0.6em;
    }

    div.wpcf7 form textarea {
        min-height: 160px;
    }

    .privacy-policy-text {
        font-size: 0.8em;
        padding: 0 10px;
    }

    div.wpcf7 form input[type="submit"],
    div.wpcf7 form input[type="button"] {
        font-size: 1em;
        padding: 0.6em 1.2em;
    }

    .thanks-contents-wrapper {
        padding: 50px 10px 25px;
    }

    .thanks-content {
        padding: 25px 10px;
    }

    .thanks-check-mark {
        width: 60px;
    }

    .thanks-message {
        font-size: 20px;
    }
}