/* ============================================
   フォーム全体
============================================ */
.form-wrapper {
    /* background: #fff; */
    margin: 0 auto;
    padding: 40px 0;
    border-radius: 20px;
    transition: filter 0.4s ease;
}

.form-wrapper.blur {
    filter: blur(6px);
    position: relative;
}

h1 {
    font-size: 22px;
    margin-bottom: 25px;
    text-align: center;
    display: none;
}

/* ============================================
   DL 2カラム
============================================ */
.form-dl {
    position: relative;
}

.form-dl dt,
.form-dl dd {
    padding: 14px 10px;
    border-top: 1px solid #d7b9c0;
}

.form-dl dt:first-of-type,
.form-dl dd:first-of-type {
    border-top: none;
}

.form-dl dt {
    float: left;
    width: 25%;
    max-width: 220px;
    padding-right: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.form-dl dt span {
    display: inline-block;
    text-align: right;
    width: 100%;
}

.form-dl dt span.req {
    color: #ff1e1e;
}

.form-dl dd {
    width: 75%;
    margin-left: calc(25% + 10px);
}

.form-dl dd .input-txt {
    display: inline-block;
    width: 30%;
    min-width: 200px;
}

/* float解除 */
.form-dl::after {
    content: "";
    display: block;
    clear: both;
}

/* ============================================
   フォーム部品
============================================ */
.form-dl input[type="text"],
.form-dl input[type="email"],
.form-dl input[type="date"],
.form-dl select,
.form-dl textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 15px;
    background-color: #f7f7f7;
}

.form-dl select {
    cursor: pointer;
}

textarea {
    height: 120px;
}

/* ============================================
   スリーサイズ（li→2カラム表へ変換）
============================================ */
.size-table {
    width: 100%;
    border-collapse: collapse;
}

.size-table th {
    width: 120px;
    padding: 6px 0;
    text-align: left;
}

.size-table td {
    padding: 6px 0;
}

/* ▼ チェックボックス横並び（flex） */
.checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    display: flex;
    flex-wrap: wrap;
    /* ← 横並び & 折り返し */
    gap: 12px;
    /* ← すき間 */
}

.checkbox-list li {
    margin: 0;
    padding: 0;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    /* テキストと□の高さ揃え */
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
    min-height: 44px;
    /* タップしやすい高さ */
}

/* チェックボックス自体 */
.checkbox-list input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* チェック時、ボタン風 */
/*
.checkbox-list input[type="checkbox"]:checked~span {
    background: #ff9d9d;
    color: #fff;
    padding: 5px 12px;
    border-radius: 8px;
}
*/

/* wrapperで選択アイコンを表示 */
.select-wrapper {
    position: relative;
    width: 100%;
}

/* select本体（iOS強化版） */
.select-wrapper select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 12px 40px 12px 12px;
    /* ←右にアイコン分の余白 */
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #f7f7f7;
}

/* ▼ アイコン */
.select-wrapper::after {
    content: "▼";
    font-size: 12px;
    color: #666;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ============================================
   ボタン
============================================ */
.submit-area {
    text-align: center;
    margin-top: 35px;
}

.modal-btn-area {
    margin-top: 18px;
    text-align: center;
}

.modal-btn {
    padding: 12px 20px;
    font-size: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin: 5px;
}

.modal-send {
    width: 60%;
    background: #ff9d9d;
    color: #fff;
}

.modal-back {
    width: 40%;
    background: #888;
    color: #fff;
}

.modal-send:hover {
    background: #ff7d7d;
}

.modal-back:hover {
    background: #666;
}

.modal-btn:hover {
    background: #ff7d7d;
}

.check-btn {
    width: 50%;
    padding: 16px;
    background: #ff9d9d;
    color: #fff;
    border: none;
    border-radius: 24.5px;
    font-size: 17px;
    cursor: pointer;
    transition: 0.3s ease;
}

.check-btn:hover{
    background: #ff636a;
}

/* ファイル選択UI */
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-label {
    display: inline-block;
    padding: 14px 18px;
    background: #888;
    color: #fff;
    border-radius: 22.5px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.25s;
}

.file-upload-label:hover {
    background: #ff636a;
}

#file-chosen {
    display: block;
    font-size: 14px;
    color: #555;
}

/* input本体を非表示にする */
.file-upload-input {
    display: none;
}

/* スマホ用調整 */
@media(max-width:480px) {
    .file-upload-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}

.file-clear-btn {
    padding: 8px 14px;
    background: #ccc;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: 0.2s;
    display: inline-block;
}

.file-clear-btn:hover {
    background: #bbb;
}

/* ============================================
   エラー項目
============================================ */
.error-field {
    border: 2px solid #ff4d4d !important;
    background: #ffecec;
}

/* ============================================
   モーダル
============================================ */
.modal-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 9900;
    opacity: 0;
    transition: all 0.4s ease;
}

.modal-bg.show {
    opacity: 1;
    background: rgba(0, 0, 0, 0.8);
}

.modal-box {
    background: #fff;
    width: 90%;
    max-width: 600px;
    padding: 25px;
    border-radius: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: all 0.35s cubic-bezier(.18, .89, .32, 1.28);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-box.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
}

.modal-table th,
.modal-table td {
    padding: 6px;
    border-bottom: 1px solid #eee;
}

.modal-table td {
    display: block;
    line-height: 180%;
}

/* 横並び用 Flex */
.size-flex {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 各ブロック */
.size-item {
    flex: 1;
    min-width: 80px;
    width: 20%;
}

.size-item label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: bold;
}

.size-item select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* iOSでのselect押しやすさ改善 */
select {
    -webkit-appearance: none;
    /* iOS標準の細いデザインを無効化 */
    appearance: none;
    width: 100%;
    padding: 14px 16px;
    /* ← 高さUP！ */
    font-size: 16px;
    /* iPhoneでは16pxで拡大防止 */
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #fff;
    box-sizing: border-box;
}

/* ▼ 下矢印アイコン（疑似要素で追加） */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    padding-right: 40px;
    /* 矢印分の余白 */
}

.select-wrapper::after {
    content: "▼";
    font-size: 12px;
    color: #777;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}


/* ============================================
   スマホ最適化（768px以下）
============================================ */
@media (max-width: 768px) {

    /* ラッパー */
    .form-wrapper {
        padding: 22px 10px;
        border-radius: 16px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 18px;
    }

    /* -------------------------
       DL → 1カラムレイアウト
    ------------------------- */
    .form-dl {
        width: 100%;
    }

    .form-dl dt {
        width: 100%;
        float: none;
        padding: 12px 0 4px;
        border-top: 1px solid #d7b9c0;
        text-align: left;
        margin: 0;
        display: block;
    }

    .form-dl dt span {
        width: 100%;
        text-align: left;
        font-size: 15px;
    }

    .form-dl dd {
        width: 100%;
        margin: 0 0 14px 0;
        padding: 0 10px;
        border-top: none;
    }

    .form-dl dd .input-txt {
        width: 100%;
        min-width: 0;
        display: block;
    }

    /* -------------------------
       スリーサイズ（スマホ用並び）
    ------------------------- */
    /* 横並び用 Flex */
    .size-flex {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* ← 2列で完全に幅を揃える */
        gap: 12px;
        width: 100%;
    }

    .size-item {
        width: 100%;
        box-sizing: border-box;
    }

    /* -------------------------
       チェックボックス
    ------------------------- */
    .checkbox-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        white-space: nowrap;
    }

    .checkbox-list label {
        width: auto;
        font-size: 15px;
        padding: 10px 8px;
        min-height: 40px;
    }

    /* チェックボックス自体 */
    .checkbox-list input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    /* チェック時、ボタン風 */
    .checkbox-list input[type="checkbox"]:checked~span {
        background: #ff9d9d;
        color: #fff;
        padding: 0;
        border-radius: 0;
    }

    /* -------------------------
       ファイル選択UI
    ------------------------- */
    .file-upload-wrapper {
        display: block;
        align-items: baseline;
        gap: 12px;
    }

    .file-upload-label {
        display: inline-block;
        padding: 14px 18px;
        background: #888;
        color: #fff;
        border-radius: 22.5px;
        cursor: pointer;
        font-size: 14px;
        transition: 0.25s;
        width: 60%;
        text-align: center;
    }

    .file-upload-label:hover {
        background: #ff7d7d;
    }

    #file-chosen {
        display: block;
        font-size: 12px;
        color: #555;
        padding: 5px;
    }

    .file-clear-btn {
        padding: 5px 10px;
        background: #ccc;
        border-radius: 10px;
        border: none;
        cursor: pointer;
        font-size: 13px;
        color: #333;
        transition: 0.2s;
        display: inline-block;
        margin: 0 0 0 5px;
        vertical-align: bottom;
    }

    .file-clear-btn:hover {
        background: #bbb;
    }

    /* -------------------------
       ボタン
    ------------------------- */
    .check-btn {
        width: 100%;
        font-size: 17px;
        padding: 16px;
    }

    .modal-btn-area {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .modal-send,
    .modal-back {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* -------------------------
       モーダル
    ------------------------- */
    .modal-box {
        width: 92%;
        max-width: 92%;
        padding: 20px;
        border-radius: 14px;
        max-height: 85vh;
    }

    .modal-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .modal-table th,
    .modal-table td {
        font-size: 14px;
        padding: 6px;
    }

    /* ===============================
   日付入力：カレンダーアイコン追加
=============================== */

    /* ラッパー必須 */
    .date-wrapper {
        position: relative;
        width: 35%;
        min-width: 200px;
    }

    /* date本体（iOS対策） */
    /* 日付入力の高さを他inputと完全に揃える */
    .date-wrapper input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        box-sizing: border-box;

        padding: 12px 40px 12px 12px !important;
        /* ← 他の input と同じにする */

        height: 48px !important;
        /* ★ここが重要：高さを強制固定 */

        font-size: 16px;
        border-radius: 10px;
        border: 1px solid #ccc;
        background: #fff;
        color: #555;
    }

    /* ▼カレンダーアイコン */
    .date-wrapper::after {
        content: "\1F4C5";
        /* 📅 絵文字：確実に表示できる */
        font-size: 20px;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #888;
        pointer-events: none;
    }

    /* placeholder のための色調整（iOS向け） */
    .date-wrapper input[type="date"]:invalid {
        color: #999;
    }

    .form-dl dd .input-txt {
        display: inline-block;
        width: 50%;
        min-width: 200px;
    }
}