/* --- VARIABLES --- */
:root {
    --wisp-primary: #2EAADC;
    --wisp-secondary: #1775B3;
    --wisp-purple: #653190;
    --wisp-magenta: #8F2C87;
    --wisp-dark: #185065;
    --wisp-light: #f8f9fa;
    --wisp-border: #e0e0e0;
}

/* --- UTILITIES & LAYOUT --- */
.wisp-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    /* This replaces Bootstrap's p-5 */
    margin-bottom: 30px;
    overflow: hidden;
}

/* Ensure the header text looks good inside the card */
.wisp-card h4 {
    margin-top: 0;
    color: #185065;
}

.wisp-card p {
    color: #666;
}
.wisp-wrapper {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; /* Ensure font matches theme or load separately */
    max-width: 100%;
}

.wisp-wrapper * {
    box-sizing: border-box;
}

.wisp-text-center { text-align: center; }
.wisp-mb-3 { margin-bottom: 1rem; }
.wisp-mb-4 { margin-bottom: 1.5rem; }
.wisp-mt-4 { margin-top: 1.5rem; }

/* --- GRID SYSTEM (Replaces Bootstrap Grid) --- */
.wisp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .wisp-grid-2 {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}

/* --- BUTTONS (Replaces .btn) --- */
.wisp-btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
    border: 2px solid transparent;
    width: 100%; /* Full width in grid */
}

/* Primary Outline Button (for Yes/No) */
.wisp-btn-outline {
    background: transparent;
    border-color: var(--wisp-primary);
    color: var(--wisp-primary);
}

.wisp-btn-outline:hover {
    background-color: rgba(46, 170, 220, 0.1);
}

/* Active State for Yes/No */
.wisp-btn-outline.active-choice {
    background-color: var(--wisp-primary);
    color: white;
    box-shadow: 0 4px 10px rgba(46, 170, 220, 0.3);
}

/* Solid Action Button */
.wisp-btn-primary {
    background-color: var(--wisp-primary);
    color: white;
    border: none;
    width: auto; /* Allow auto width for main submit */
    min-width: 250px;
}

.wisp-btn-primary:hover {
    background-color: var(--wisp-secondary);
    transform: translateY(-2px);
}

/* --- FORMS (Replaces .form-control) --- */
.wisp-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--wisp-border);
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    transition: border-color 0.3s;
}

.wisp-input:focus {
    outline: none;
    border-color: var(--wisp-primary);
}

/* Checkbox specific styling */
.wisp-checkbox-group {
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid var(--wisp-border);
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wisp-checkbox-group input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* --- STATES GRID --- */
.wisp-states-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--wisp-border);
    border-radius: 10px;
    background: #fdfdfd;
}

.wisp-state-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

/* --- VISIBILITY & ANIMATIONS --- */
.question-block {
    display: block; /* Visible for editing */
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.hidden-step {
    display: none !important;
}

.wisp-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- REPORT STYLING --- */
.report-item {
    background: #fff;
    border-left: 5px solid var(--wisp-primary);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.report-item.ny-item { border-left-color: var(--wisp-magenta); }
.report-item.finra-item { border-left-color: var(--wisp-dark); }

.wisp-alert {
    background-color: #e3f2fd;
    color: #0d47a1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

/* --- OVERLAY / MODAL --- */
#programBuildOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    z-index: 99999; /* Very high to sit over WP admin bar */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.wisp-modal-box {
    width: 90%;
    max-width: 500px;
    text-align: center;
    padding: 20px;
}

/* Force white background for PDF generation */
#reportContent {
    background-color: #ffffff !important;
    color: #000000 !important;
    position: relative; 
    margin: 0 auto; 
    padding: 40px !important;
    max-width: 100%;
    box-sizing: border-box;
}

/* --- PDF HEADER STYLING --- */
.print-only-header {
    display: block; 
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 30px;
    background-color: #ffffff;
    width: 100%;
    text-align: center; /* Centers the text */
}

.wisp-pdf-logo {
    max-width: 250px;
    height: auto;
    margin: 0 auto 15px auto; 
    display: block;
}

.wisp-pdf-title {
    color: #185065;
    margin: 0 0 5px 0 !important;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center; 
}

.wisp-pdf-subtitle {
    color: #666666;
    margin: 0 !important;
    font-size: 14px;
    text-align: center;
}






/* --- NATIVE PRINT STYLES (AGGRESSIVE CLEANUP) --- */
@media print {
    /* 1. RESET THE PAGE AND ADMIN BAR */
    @page { margin: 0.5in; } /* Sets physical paper margins */
    
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        height: 100%;
        overflow: visible !important;
    }

    /* Remove the WordPress Admin Bar gap */
    html { margin-top: 0 !important; }
    #wpadminbar { display: none !important; }

    /* 2. HIDE THEME STRUCTURAL ELEMENTS (Display: none removes their space) */
    header, footer, nav, 
    #masthead, #colophon, #header, #footer, 
    .site-header, .site-footer, .widget-area, .sidebar,
    .elementor-location-header, .elementor-location-footer { 
        display: none !important; 
    }

    /* 3. HIDE EVERYTHING ELSE VISUALLY */
    body * {
        visibility: hidden;
    }

    /* 4. REVEAL AND POSITION THE REPORT */
    /* We make the report and all its children visible */
    #reportContent, #reportContent * {
        visibility: visible;
    }

    /* 5. FORCE POSITION TO TOP LEFT (The "Snap" Fix) */
    #reportContent {
        position: fixed; /* Fixed is stronger than absolute for breaking out of containers */
        left: 0;
        top: 0;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 99999; /* Ensure it sits on top of everything */
        background-color: white !important;
    }

    /* 6. HIDE INTERACTIVE ELEMENTS INSIDE REPORT */
    #reportActions, .wisp-btn, button, input[type="checkbox"] {
        display: none !important;
    }

    /* 7. ENSURE HEADER LAYOUT IS CORRECT */
    .print-only-header {
        display: block !important;
        text-align: center;
        margin-top: 0 !important;
    }
    
    .wisp-pdf-logo {
        margin: 0 auto 10px auto;
        max-width: 200px;
    }
    
    .wisp-pdf-title {
        text-align: center;
        margin-top: 0 !important;
    }
    
    /* 8. TYPOGRAPHY RESET (Optional, makes print cleaner) */
    p, h4, h5, li {
        color: #000 !important; /* Force black text for crisp printing */
    }
}