/* assets/css/wizard.css */

/* Variables (Design System 2026) */
:root {
    --w-primary: #3b82f6;
    /* Action Blue */
    --w-primary-hover: #2563eb;
    --w-secondary: #0B1D45;
    /* Corporate Navy */
    --w-bg: #f1f5f9;
    /* Body BG */
    --w-text: #0B1D45;
    /* Text matches Navy */
    --w-border: #e2e8f0;
    --w-success: #22c55e;
    --w-overlay: rgba(11, 29, 69, 0.75);
    /* Lower opacity as requested */
}

/* Container */
.wizard-container {
    max-width: 800px;
    margin: 0 auto;
    /* Margin handled by positioning in focus mode */
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--w-border);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    /* Default static height */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 10;
}

/* Immersive Focus Mode (Fixed Centered) */
.wizard-container.focused {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
    /* Removed scale to prevent blur/shifting */
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    /* Safety margin */
    z-index: 1000000;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
    border-color: var(--w-primary);
}

.wizard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--w-overlay);
    backdrop-filter: blur(4px);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.wizard-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Header (Fixed Top) */
.wizard-header {
    background: var(--w-secondary);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    /* Never shrink */
}

.wizard-title {
    color: #fff;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.wizard-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Body (Scrollable Middle) */
.wizard-body {
    padding: 30px;
    flex: 1 1 auto;
    /* Grow and shrink */
    overflow-y: auto;
    /* Scroll ONLY inside here */
    min-height: 0;
    /* Crucial for flex overflow */
}

/* Footer (Fixed Bottom) */
.wizard-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--w-border);
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Never shrink */
}

/* Typography & Sizing Adjustments */
.step-question {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--w-text);
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    /* reliable grid */
    gap: 15px;
    width: 100%;
}

.selection-card {
    border: 2px solid var(--w-border);
    border-radius: 12px;
    padding: 20px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    position: relative;
    background: #fff;
}

.card-icon {
    font-size: 2rem;
    /* Stabilized icon size */
    color: #64748b;
    transition: color 0.2s;
}

.card-text {
    font-weight: 500;
    font-size: 0.95rem;
    /* Stabilized text size */
    color: var(--w-text);
    line-height: 1.3;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .wizard-container.focused {
        width: 95%;
        max-height: 85vh;
    }

    .wizard-body {
        padding: 20px;
    }

    .selection-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        /* Force 2 columns */
        gap: 10px;
        /* Smaller gap */
    }

    .selection-card {
        padding: 15px 5px;
        /* Compact padding */
        min-height: 110px;
    }

    .card-icon {
        font-size: 1.8rem;
    }

    .card-text {
        font-size: 0.85rem;
    }
}

.progress-track {
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--w-success);
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* Selection Cards */
.selection-card:hover {
    border-color: var(--w-primary);
    background: #eff6ff;
    transform: translateY(-2px);
    z-index: 10;
}

.selection-card.selected {
    border-color: var(--w-primary);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Card Icon */
.card-icon {
    font-size: 2.2rem;
    color: var(--w-primary);
    margin-bottom: 12px;
    display: block;
}

.card-text {
    font-weight: 600;
    color: var(--w-secondary);
    font-size: 0.95rem;
    line-height: 1.3;
}

/* Tick Mark */
.card-tick {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--w-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.selection-card.selected .card-tick {
    opacity: 1;
    transform: scale(1);
}

/* Form Inputs */
.w-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--w-text);
    font-size: 0.95rem;
}

.w-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--w-border);
    border-radius: 12px;
    font-size: 1rem;
    transition: 0.3s;
}

.w-input:focus {
    border-color: var(--w-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Footer & Buttons */
.wizard-footer {
    padding: 20px 40px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--w-border);
    background: #fdfdfd;
}

.btn-w-prev {
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-w-prev:hover {
    background: #f1f5f9;
    color: var(--w-secondary);
}

.btn-w-next {
    background: var(--w-primary);
    color: white;
    border: none;
    padding: 14px 45px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-w-next:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-w-next:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Mobile */
@media (max-width: 991px) {
    .wizard-container {
        margin: 20px 0;
        border-radius: 16px;
        min-height: auto;
        /* Allow auto height on mobile */
    }

    /* Mobile Focus: Full Screen Overlay feel without confusing scaling */
    .wizard-container.focused {
        transform: none;
        /* No scaling on mobile */
        position: relative;
        /* Keep flow */
        z-index: 10000;
        box-shadow: 0 0 0 100vmax rgba(11, 29, 69, 0.95);
        /* Fake overlay via shadow if needed, but we have real overlay */
    }

    .selection-grid {
        grid-template-columns: 1fr;
        /* Force 1 col */
    }

    .wizard-header {
        padding: 20px;
    }

    .wizard-body {
        padding: 25px 20px;
        min-height: 400px;
    }

    .wizard-footer {
        padding: 20px;
        flex-direction: column-reverse;
        /* Stack buttons */
        gap: 15px;
    }

    .btn-w-next,
    .btn-w-prev {
        width: 100%;
        /* Full width */
        justify-content: center;
    }

    .btn-w-prev {
        margin-top: 10px;
    }
}