.main {
    width: 100%;
    height: 350px;
    background-image: url(../contact/top.jpg);
    padding-top: 20px;
}

.main01 {
    background-color: #ffffff;
}

#sub_page_title {
    font-family: Avenir, "Open Sans", "Helvetica Neue", Helvetica, Arial, Verdana, Roboto, "游ゴシック", "Yu Gothic", "游ゴシック体", "YuGothic", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "Meiryo UI", "メイリオ", Meiryo, "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 2em;
    letter-spacing: 3px;
    width: 100%;
    text-align: center;
    text-shadow: 3px 3px 5px black;
    height: 200px;
    background-image: url(../contact/sub_top_bg.png);
    background-repeat: no-repeat;
    background-position: center top;
    padding-top: 155px;
    line-height: 24px;
}

.box {
    width: 225px;
    float: left;
    margin-right: 26.5px;
}

.box02 {
    width: 225px;
    float: right;
}

.centered {
    border: 2px solid #000;
    display: table;
    height: 180px;
    width: 225px;
    background-color: #FFFFFF;
}

.centered>div {
    display: table-cell;
    vertical-align: middle;
}

img.adapt {
    display: block;
    margin: 0 auto;
    max-height: 100px;
    max-width: 150px;
}

#formWrap form p {
    margin-top: 30px;
}

#formWrap {
    width: 980px;
    margin: 0 auto;
    color: #555;
    line-height: 120%;
    font-size: 90%;
}

table.formTable {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
}

table.formTable td,
table.formTable th {
    border: 1px solid #ccc;
    padding: 20px;
}

table.formTable th {
    width: 30%;
    font-weight: normal;
    background: #efefef;
    text-align: left;
}

.form-btns{display: flex; justify-content: center; gap: 20px;}
.form-btns input{padding: 12px 40px;}

/* --- 既存のコードの後に以下を追記、または既存の@mediaを書き換え --- */

@media screen and (max-width: 767px) {
    /* ヘッダーエリアの調整 */
    .main {
        height: auto;
        padding: 40px 0;
        background-size: cover;
    }
    #sub_page_title {
        height: auto;
        padding-top: 100px;
        font-size: 1.5em;
        background-size: contain;
    }

    /* フォーム全体の幅調整 */
    #formWrap {
        width: 95%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    #formWrap p[style*="text-align:right"] {
        text-align: left !important; /* 「確認ボタンを押してください」を左寄せに */
        margin-bottom: 15px;
    }

    /* テーブルを縦並びにする魔法のスタイル */
    table.formTable,
    table.formTable tbody,
    table.formTable tr,
    table.formTable th,
    table.formTable td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    table.formTable th {
        border-bottom: none;
        background: #f4f4f4; /* 項目名を少し目立たせる */
        padding: 10px 15px;
        font-weight: bold;
    }

    table.formTable td {
        border-top: none;
        padding: 10px 15px 20px 15px;
    }

    /* 入力項目（テキストボックス・セレクトボックス・テキストエリア）を横幅いっぱいに */
    table.formTable input[type="text"],
    table.formTable select,
    table.formTable textarea {
        width: 100% !important;
        height: auto;
        padding: 10px;
        font-size: 16px; /* iPhoneでズームされないための最小サイズ */
        border: 1px solid #ccc;
        border-radius: 4px;
        -webkit-appearance: none; /* iOSのデフォルトスタイルをリセット */
    }

    /* ラジオボタンとチェックボックスの並び */
    table.formTable input[type="radio"],
    table.formTable input[type="checkbox"] {
        margin: 10px 5px 10px 0;
        transform: scale(1.2); /* 少し大きくしてタップしやすく */
    }

    /* 送信ボタンエリア */
    #formWrap p[align="center"] {
        display: flex;
        flex-direction: column; /* ボタンを縦に並べる */
        gap: 10px;
    }

    #formWrap input[type="submit"],
    #formWrap input[type="reset"] {
        width: 100%;
        height: 50px;
        font-size: 1.1em;
    }

    .form-btns{flex-wrap: wrap;}
}
