/* ── FormModal reusable component ────────────────────────────────────────── */

.fm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fm-backdrop-in 150ms ease;
}

@keyframes fm-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fm-panel {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: fm-panel-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fm-panel-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.fm-panel--sm { max-width: 400px; }
.fm-panel--md { max-width: 520px; }
.fm-panel--lg { max-width: 680px; }

/* Header */
.fm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #F3F4F6;
    flex-shrink: 0;
}

.fm-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.fm-close {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms, background 150ms;
    flex-shrink: 0;
}

.fm-close:hover {
    color: #374151;
    background: #F3F4F6;
}

/* Body */
.fm-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
}

/* Footer */
.fm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #F3F4F6;
    flex-shrink: 0;
}

/* Mobile: bottom sheet */
@media (max-width: 640px) {
    .fm-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .fm-panel,
    .fm-panel--sm,
    .fm-panel--md,
    .fm-panel--lg {
        max-width: 100%;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
}
