@charset "UTF-8";

/* モーダル全体のオーバーレイ */
.modern-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modern-modal.active {
    display: flex;
}

/* モーダル本体 */
.modern-modal-container {
    background: #fff;
    width: 90%;
    max-width: 800px;
    height: 80%;
    max-height: 700px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-up 0.3s ease-out;
}

@keyframes modal-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 固定ヘッダー */
.modern-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modern-modal-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modern-modal-back {
    cursor: pointer;
    color: #666;
    display: none;
    /* ステップ2で表示 */
    align-items: center;
    gap: 5px;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.2s;
}

.modern-modal-back:hover {
    background: #f5f5f5;
}

.modern-modal-close {
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999;
}

/* スクロールエリア（ボディ） */
.modern-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

/* 固定フッター */
.modern-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: none;
    /* 市区町村選択時のみ表示 */
    justify-content: space-between;
    align-items: center;
    background: #fff;
    gap: 15px;
}

/* ボタン類 */
.modern-btn-clear {
    color: #666;
    text-decoration: underline;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
}

.modern-btn-submit {
    background: #ff8da1;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 141, 161, 0.4);
    transition: all 0.3s;
}

.modern-btn-submit:hover {
    background: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

/* 都道府県・市区町村リスト共通 */
.selection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.selection-list li {
    position: relative !important;
    /* 子要素 (::after) の absolute 配置の起点とする */
    width: auto !important;
    height: auto !important;
}

/* 都道府県アイテム（ボタン型） */
.pref-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    color: #555;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pref-item:hover {
    border-color: #ff8da1;
    color: #ff8da1;
    background: #fffafa;
}

.pref-item::after {
    content: "〉";
    position: absolute;
    right: 15px;
    font-size: 12px;
    color: #bbb;
}

/* 市区町村アイテム（チェックボックス型） */
.city-item {
    background: #fff;
    border: 1px solid #eee;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.city-item:hover {
    background: #fdf2f2;
}

.city-item input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.city-item input[type="checkbox"]:checked {
    background: #ff8da1;
    border-color: #ff8da1;
}

.city-item input[type="checkbox"]:checked::after {
    content: "✔";
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 14px;
}

.city-name {
    font-size: 15px;
    color: #333;
    flex: 1;
}

.city-count {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* 「全て」用特殊スタイル */
.city-item.all-select {
    grid-column: 1 / -1;
    border: 1px solid #ffdae0;
    background: #fffafa;
    margin-bottom: 5px;
    font-weight: bold;
}

/* レスポンシブ調整 */
@media screen and (max-width: 768px) {
    .modern-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .selection-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .modern-modal-header {
        padding: 12px 15px;
    }

    .modern-modal-title {
        font-size: 16px;
    }
}