/* Flow Modal CSS Styling */

.vfw-modal {
    position: fixed;
    inset: 0;
    z-index: var(--vfw-z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(3, 2, 23, 0.45); /* Soft premium backdrop overlay */
    padding: var(--vfw-space-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--vfw-transition-fast), visibility var(--vfw-transition-fast);
    backdrop-filter: blur(2px);
}

.vfw-theme-dark .vfw-modal {
    background-color: rgba(3, 2, 23, 0.70);
}

/* Modal Content Card */
.vfw-modal-content {
    background-color: var(--vfw-color-background);
    border: 1.5px solid var(--vfw-color-border);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--vfw-shadow-bottom-xl);
    transform: scale(0.95);
    transition: transform var(--vfw-transition-fast), background-color var(--vfw-transition-normal), border-color var(--vfw-transition-normal);
}

.vfw-modal-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.vfw-modal-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.vfw-modal-visible .vfw-modal-content {
    transform: scale(1);
}

.vfw-body-scroll-locked {
    overflow: hidden;
}

/* ==========================================================================
   Header & Close Button
   ========================================================================== */
.vfw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
}

.vfw-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem; /* 24px */
    font-weight: 800;
    color: var(--vfw-color-text);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.vfw-modal-close {
    background: transparent;
    border: none;
    font-size: 1.15rem;
    color: var(--vfw-color-text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    transition: all var(--vfw-transition-fast);
}

.vfw-modal-close:hover {
    background-color: var(--vfw-color-surface);
    color: var(--vfw-color-text);
}

/* ==========================================================================
   Modal Body & Footer
   ========================================================================== */
.vfw-modal-body {
    padding: 0 24px 20px 24px;
    color: var(--vfw-color-text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.vfw-modal-body-text {
    margin: 0 0 20px 0;
}

.vfw-modal-footer {
    display: flex;
    justify-content: flex-start; /* Left-aligned buttons */
    gap: 12px;
    padding: 0 24px 24px 24px;
}

/* ==========================================================================
   Illustration Variant
   ========================================================================== */
.vfw-modal-illustration-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

/* Pure CSS grid pattern placeholder */
.vfw-modal-illustration-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--vfw-color-background);
    background-image:
        linear-gradient(45deg, var(--vfw-color-surface) 25%, transparent 25%),
        linear-gradient(-45deg, var(--vfw-color-surface) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--vfw-color-surface) 75%),
        linear-gradient(-45deg, transparent 75%, var(--vfw-color-surface) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    border-bottom: 1.5px solid var(--vfw-color-border);
}

/* Overlay close button inside image */
.vfw-modal-close-overlay {
    position: absolute;
    top: 16px;
    right: 16px;
    background-color: var(--vfw-color-background);
    border: 1.5px solid var(--vfw-color-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--vfw-color-text-muted);
    box-shadow: var(--vfw-shadow-bottom-sm);
    transition: all var(--vfw-transition-fast);
    z-index: 10;
}

.vfw-modal-close-overlay:hover {
    border-color: var(--vfw-color-primary);
    color: var(--vfw-color-primary);
    background-color: var(--vfw-color-surface);
}

.vfw-modal-close-overlay svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* ==========================================================================
   Login / Form Variant
   ========================================================================== */
.vfw-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.vfw-modal-form .vfw-input-group {
    width: 100%;
}

/* ==========================================================================
   Mobile Modifier (Sizing Scale)
   ========================================================================== */
.vfw-modal-mobile .vfw-modal-content,
@media (max-width: 767px) {
    .vfw-modal {
        padding: 16px;
    }

    .vfw-modal-content {
        border-radius: 12px;
        max-width: calc(100% - 16px);
    }

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

    .vfw-modal-title {
        font-size: 1.25rem;
    }

    .vfw-modal-body {
        padding: 0 20px 16px 20px;
        font-size: 0.925rem;
    }

    .vfw-modal-body-text {
        margin-bottom: 16px;
    }

    .vfw-modal-footer {
        padding: 0 20px 20px 20px;
        gap: 10px;
    }

    .vfw-modal-illustration-container {
        height: 140px;
    }

    .vfw-modal-illustration-placeholder {
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }
}

/* ==========================================================================
   Static / Mockup Renderings inside Grid
   ========================================================================== */
.vfw-modal-static {
    position: relative;
    inset: auto;
    z-index: 1;
    background-color: transparent;
    padding: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
    width: 100%;
}

.vfw-modal-static .vfw-modal-content {
    transform: none;
    max-height: none;
    overflow-y: visible;
    box-shadow: none;
}
