/* ============================================================
   VENTAMAX — INSTALLER STYLES
   Premium, modern wizard design
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --ins-primary: #667eea;
    --ins-primary-light: #a5b4fc;
    --ins-secondary: #764ba2;
    --ins-success: #10b981;
    --ins-success-light: #6ee7b7;
    --ins-danger: #ef4444;
    --ins-warning: #f59e0b;
    --ins-bg: #0f0f1a;
    --ins-card-bg: rgba(22, 22, 40, 0.92);
    --ins-surface: rgba(255, 255, 255, 0.04);
    --ins-surface-hover: rgba(255, 255, 255, 0.07);
    --ins-border: rgba(255, 255, 255, 0.07);
    --ins-text: #d1d1e0;
    --ins-text-muted: #7a7a95;
    --ins-radius: 1.5rem;
    --ins-radius-sm: 0.875rem;
}

/* ── Base ── */
.installer-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ins-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

.installer-page .container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Animated Background ── */
.installer-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 20%, rgba(102, 126, 234, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 80%, rgba(118, 75, 162, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 300px 300px at 60% 30%, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: installer-bg-drift 20s ease-in-out infinite;
}

@keyframes installer-bg-drift {
    0%, 100% { transform: scale(1) translate(0, 0); }
    33% { transform: scale(1.02) translate(1%, -1%); }
    66% { transform: scale(0.98) translate(-1%, 1%); }
}

/* ── Card ── */
.install-card {
    border-radius: var(--ins-radius);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 24px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: none;
    overflow: hidden;
    background: var(--ins-card-bg);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    position: relative;
    z-index: 1;
    animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Header ── */
.install-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #5b21b6 100%);
    background-size: 200% 200%;
    animation: header-gradient 8s ease infinite;
    color: #fff;
    padding: 2.25rem 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes header-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.install-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.6;
}

.install-header h2 {
    position: relative;
    z-index: 1;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.install-header p {
    position: relative;
    z-index: 1;
    opacity: 0.75;
    font-size: 0.92rem;
    font-weight: 400;
}

.install-header .install-version {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 0.7rem;
    opacity: 0.45;
    z-index: 1;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ── Body ── */
.install-body {
    padding: 2.5rem 3rem 2rem;
    color: var(--ins-text);
}

.install-body h4 {
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.3px;
}

.install-body h6 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.install-body .text-dark {
    color: #fff !important;
}

.install-body .text-muted {
    color: var(--ins-text-muted) !important;
    font-size: 0.9rem;
}

/* ── Step Indicator ── */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 0;
    padding: 1.25rem 0 0.5rem;
}

.step {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ins-surface);
    color: var(--ins-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.06);
    z-index: 1;
}

.step-connector {
    width: 80px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.step-connector.completed {
    background: var(--ins-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.step-connector.active {
    background: linear-gradient(90deg, var(--ins-success), var(--ins-primary));
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.25);
}

.step-connector.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: connector-shimmer 2s ease-in-out infinite;
}

@keyframes connector-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.step.active {
    background: linear-gradient(135deg, var(--ins-primary), var(--ins-secondary));
    color: #fff;
    box-shadow:
        0 0 0 4px rgba(102, 126, 234, 0.2),
        0 6px 20px rgba(102, 126, 234, 0.35);
    border-color: transparent;
    transform: scale(1.15);
    animation: step-pulse 2.5s ease-in-out infinite;
}

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 0 6px 20px rgba(102, 126, 234, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1), 0 6px 20px rgba(102, 126, 234, 0.4); }
}

.step.completed {
    background: var(--ins-success);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.step .step-label {
    position: absolute;
    bottom: -24px;
    font-size: 0.68rem;
    color: var(--ins-text-muted);
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.step.active .step-label {
    color: var(--ins-primary-light);
}

.step.completed .step-label {
    color: var(--ins-success-light);
}

/* ── Form Overrides (Dark Theme) ── */
.install-body .form-control,
.install-body .form-select {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--ins-border);
    color: #fff !important;
    border-radius: var(--ins-radius-sm);
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.install-body .form-control:focus,
.install-body .form-select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--ins-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12), 0 0 20px rgba(102, 126, 234, 0.06);
    color: #fff !important;
}

/* Fix dropdown options default white background */
.install-body .form-select option {
    background-color: #161628;
    color: #fff;
}

/* Ensure filled inputs keep dark background */
.install-body .form-control:not(:placeholder-shown) {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
}

/* WebKit autofill fix for dark theme */
.install-body .form-control:-webkit-autofill,
.install-body .form-control:-webkit-autofill:hover, 
.install-body .form-control:-webkit-autofill:focus, 
.install-body .form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1e1e30 inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
}

.install-body .form-control::placeholder {
    color: #5a5a70;
}

/* Fix placeholder visibility causing overlap in floating labels */
.install-body .form-floating > .form-control::placeholder {
    color: transparent;
}
.install-body .form-floating > .form-control:focus::placeholder {
    color: #5a5a70;
}

/* Floating label — default (empty field) */
.install-body .form-floating > label {
    color: #b8b8d0;
    font-size: 0.9rem;
}

/* Floating label — when field has value OR is focused (label floats up) */
.install-body .form-floating > .form-control:focus ~ label,
.install-body .form-floating > .form-control:not(:placeholder-shown) ~ label,
.install-body .form-floating > .form-select ~ label {
    color: var(--ins-primary-light) !important;
    opacity: 1;
}

/* Ensure label icons inherit color */
.install-body .form-floating > label i {
    color: inherit;
}

.install-body .form-text {
    color: var(--ins-text-muted) !important;
    font-size: 0.78rem;
}

.install-body .input-group-text {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ins-border);
    color: var(--ins-text-muted);
    border-radius: var(--ins-radius-sm);
}

/* Disabled/readonly fields */
.install-body .form-control:disabled,
.install-body .form-control[readonly] {
    background: rgba(255, 255, 255, 0.02);
    color: #8b8ba0;
    opacity: 0.8;
}

/* ── Requirements List ── */
.install-body .list-group {
    border-radius: var(--ins-radius-sm) !important;
    overflow: hidden;
    border: 1px solid var(--ins-border) !important;
}

.install-body .list-group-item {
    background: var(--ins-surface);
    border-color: var(--ins-border);
    color: var(--ins-text);
    transition: all 0.25s ease;
    padding: 0.85rem 1.25rem;
}

.install-body .list-group-item:hover {
    background: var(--ins-surface-hover);
    transform: translateX(2px);
}

.install-body .list-group-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Badges in list items */
.install-body .badge.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.45em 0.85em;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.install-body .badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.45em 0.85em;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

/* ── Alerts inside installer ── */
.install-body .alert {
    border-radius: var(--ins-radius-sm);
    backdrop-filter: blur(8px);
}

.install-body .alert-success {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 1px solid rgba(16, 185, 129, 0.18) !important;
    color: var(--ins-success-light) !important;
}

.install-body .alert-success .text-success {
    color: var(--ins-success-light) !important;
}

.install-body .alert-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
}

.install-body .alert-info {
    background: rgba(102, 126, 234, 0.08) !important;
    border: 1px solid rgba(102, 126, 234, 0.18) !important;
    color: var(--ins-primary-light) !important;
}

.install-body .alert-secondary {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: var(--ins-text-muted) !important;
}

/* ── Buttons ── */
.install-body .btn-primary,
.install-body .btn-success {
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-body .btn-primary {
    background: linear-gradient(135deg, var(--ins-primary) 0%, var(--ins-secondary) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.install-body .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.install-body .btn-primary:active {
    transform: translateY(0);
}

.install-body .btn-success {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.install-body .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.install-body .btn-primary::after,
.install-body .btn-success::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.install-body .btn-primary:hover::after,
.install-body .btn-success:hover::after {
    left: 100%;
}

.install-body .btn-light {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ins-text);
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.install-body .btn-light:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.06);
}

.install-body .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ins-text);
    transition: all 0.3s ease;
}

.install-body .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── Section Dividers ── */
.install-body .border-bottom {
    border-color: var(--ins-border) !important;
}

.install-body .border-end {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.install-body .border-top {
    border-color: var(--ins-border) !important;
}

/* ── Progress (Password Strength) ── */
.install-body .progress {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.install-body .progress-bar {
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

/* ── Section headers (Step 3 colored headings) ── */
.install-body .text-primary {
    color: var(--ins-primary-light) !important;
}

.install-body .text-success {
    color: var(--ins-success-light) !important;
}

.install-body .text-warning {
    color: #fbbf24 !important;
}

.install-body .text-danger {
    color: #fca5a5 !important;
}

.install-body .text-info {
    color: var(--ins-primary-light) !important;
}

/* Purple accent for license section */
.install-body .border-purple {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.install-body .border-purple:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12), 0 0 20px rgba(139, 92, 246, 0.06);
}

/* ── Footer ── */
.install-footer {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 1rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.78rem;
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

/* ── Floating Particles (decorative) ── */
.install-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.install-particle:nth-child(1) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.07), transparent 65%);
    top: -150px;
    right: -100px;
    animation: installer-float 18s ease-in-out infinite;
}

.install-particle:nth-child(2) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.07), transparent 65%);
    bottom: -100px;
    left: -100px;
    animation: installer-float 14s ease-in-out infinite reverse;
}

@keyframes installer-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

/* ── Scrollbar (WebKit) ── */
.installer-page::-webkit-scrollbar {
    width: 6px;
}

.installer-page::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.installer-page::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.installer-page::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .install-body {
        padding: 1.75rem 1.5rem;
    }

    .install-header {
        padding: 1.75rem 1.5rem 1.5rem;
    }

    .step {
        width: 38px;
        height: 38px;
        font-size: 0.8rem;
    }

    .step-connector {
        width: 40px;
    }

    .step .step-label {
        font-size: 0.6rem;
    }

    .install-card {
        border-radius: 1rem;
    }
}

@media (max-width: 480px) {
    .install-body {
        padding: 1.25rem 1rem;
    }

    .step .step-label {
        display: none;
    }

    .step-connector {
        width: 28px;
    }

    .install-header h2 {
        font-size: 1.25rem;
    }
}
