/* ==========================================
   モーダルウィンドウ
========================================== */

/* モーダル全体（初期状態は非表示） */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow-y: auto;
}

/* モーダルが表示されているとき */
.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 背景オーバーレイ（暗い背景） */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

/* モーダルコンテンツ（中央の白いボックス） */
.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 10001;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.close-icon {
    width: 24px;
    height: 24px;
    color: #64748B;
}

/* モーダルヘッダー */
.modal-header {
    padding: 32px 32px 16px;
    text-align: center;
    border-bottom: 1px solid #E2E8F0;
}

.modal-title {
    font-size: 28px;
    font-weight: bold;
    color: #1E293B;
    margin: 0;
}

/* マイクロコピー（案1） */
.modal-microcopy {
    padding: 24px 32px;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-bottom: 1px solid #E2E8F0;
}

.microcopy-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
}

.microcopy-icon {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
}

.microcopy-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.microcopy-benefits p {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
    margin: 0;
}

.benefit-icon {
    width: 18px;
    height: 18px;
    color: var(--color-success);
    flex-shrink: 0;
}

/* モーダル内のフォームコンテナ */
.modal-form-container {
    padding: 32px;
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 24px 20px 12px;
    }

    .modal-title {
        font-size: 22px;
    }

    .modal-microcopy {
        padding: 20px;
    }

    .microcopy-main {
        font-size: 14px;
    }

    .microcopy-benefits p {
        font-size: 13px;
    }

    .modal-form-container {
        padding: 20px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
    }
}

/* Body固定（モーダル表示時にスクロール防止） */
body.modal-open {
    overflow: hidden;
}
