/**
 * ShadmanIT — Standalone Web Installer Stylesheet (installer.css)
 * 
 * Luxury dark theme, 6-step progress stepper, server checklist,
 * database tester, password strength meter, branding dropzones,
 * and responsive rules down to 360px.
 */

/* ==========================================================================
   Installer Container & Background Hierarchy
   ========================================================================== */
.installer-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2.75rem 1.25rem 3.5rem;
    background: #050608;
    background-image: radial-gradient(circle at 50% 0%, #151c2d 0%, #080b12 50%, #050608 100%);
    position: relative;
    overflow-x: hidden;
}

.installer-wrapper::before {
    content: "";
    position: absolute;
    top: -8%;
    left: 50%;
    transform: translateX(-50%);
    width: 650px;
    height: 380px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.10) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.installer-container {
    width: 100%;
    max-width: 980px;
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

/* ==========================================================================
   Brand Header
   ========================================================================== */
.installer-header {
    text-align: center;
    margin-bottom: 1.875rem;
}

.installer-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
    border: 1px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 8px 24px -4px rgba(220, 38, 38, 0.45);
    margin-bottom: 0.875rem;
    color: #ffffff;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.installer-title {
    font-size: 1.625rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.installer-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   Progress Stepper Navigation
   ========================================================================== */
.stepper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding: 0.625rem 1.125rem;
    background: rgba(13, 17, 27, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.stepper-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
    cursor: default;
    user-select: none;
}

.stepper-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    background: #090c14;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #64748b;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.stepper-text {
    display: flex;
    flex-direction: column;
}

.stepper-step-label {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #475569;
    font-family: var(--font-mono);
}

.stepper-step-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.stepper-divider {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0 0.625rem;
    transition: background-color 0.25s ease;
}

/* Active & Complete Stepper States */
.stepper-item.is-active .stepper-circle {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(220, 38, 38, 0.45);
}

.stepper-item.is-active .stepper-step-title {
    color: #ffffff;
    font-weight: 700;
}

.stepper-item.is-active .stepper-step-label {
    color: #ef4444;
}

.stepper-item.is-complete .stepper-circle {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.stepper-item.is-complete .stepper-step-title {
    color: #34d399;
}

.stepper-item.is-complete + .stepper-divider {
    background: rgba(16, 185, 129, 0.3);
}

/* Mobile Stepper Header */
.stepper-mobile-bar {
    display: none;
    padding: 0.875rem 1.125rem;
    background: #0d111b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 1.25rem;
}

.stepper-mobile-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.stepper-mobile-progress {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stepper-mobile-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Main Installer Card & Step Panes
   ========================================================================== */
.installer-card {
    background: #0d111b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.step-pane {
    display: none;
    padding: 2rem 2.25rem;
}

.step-pane.is-active {
    display: block;
    animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-heading {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.step-heading-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ef4444;
    font-family: var(--font-mono);
    margin-bottom: 0.25rem;
}

.step-heading-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.step-heading-desc {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    line-height: 1.45;
}

/* ==========================================================================
   Step 1: Server Environment Checklist
   ========================================================================== */
.check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 1.5rem;
}

.check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #080b12;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    min-height: 72px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.check-row:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: #0c101a;
}

.check-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.check-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
}

.check-req {
    font-size: 0.6875rem;
    color: #64748b;
    font-family: var(--font-mono);
}

.check-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.check-chip svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.check-chip.chip-passed {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.check-chip.chip-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.check-chip.chip-failed {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ==========================================================================
   Step 2: Database Configuration & Tester
   ========================================================================== */
.db-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.db-grid-full {
    grid-column: 1 / -1;
}

.db-test-box {
    margin-top: 1rem;
    margin-bottom: 1.25rem;
    padding: 14px 16px;
    background: #080b12;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.db-test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.db-test-header h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.db-test-header p {
    font-size: 0.6875rem;
    color: #64748b;
}

.db-test-status {
    font-size: 0.8125rem;
    display: none;
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.db-error-wrapper,
.db-success-wrapper {
    width: 100%;
}

.cpanel-instructions-box {
    background: rgba(12, 14, 20, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 0.875rem 1rem;
}

.cpanel-guide-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #cbd5e1;
    font-size: 0.75rem;
    line-height: 1.6;
}

.cpanel-step-item {
    margin-bottom: 0.25rem;
    color: #e2e8f0;
}

.tech-details-toggle {
    margin-top: 0.75rem;
}

.tech-details-toggle summary {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0;
    list-style: none;
}

.tech-details-toggle summary::-webkit-details-marker {
    display: none;
}

.tech-details-toggle summary:hover {
    color: #e2e8f0;
}

.tech-details-toggle[open] .details-chevron {
    transform: rotate(90deg);
}

.tech-details-content {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: #04060a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: #cbd5e1;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ==========================================================================
   Step 4: Password Strength Indicator
   ========================================================================== */
.password-meter {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    margin-top: 0.5rem;
    overflow: hidden;
    position: relative;
}

.password-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: var(--radius-full);
}

.password-meter-fill.strength-weak { width: 33%; background: #ef4444; }
.password-meter-fill.strength-medium { width: 66%; background: #f59e0b; }
.password-meter-fill.strength-strong { width: 100%; background: #10b981; }

.password-strength-text {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: #64748b;
    margin-top: 0.25rem;
    text-align: right;
}

/* ==========================================================================
   Step 5: Branding Upload Dropzones
   ========================================================================== */
.branding-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dropzone {
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    background: #080b12;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.dropzone:hover, .dropzone.dragover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    width: 32px;
    height: 32px;
    color: #64748b;
    margin-bottom: 0.625rem;
}

.dropzone-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.dropzone-desc {
    font-size: 0.6875rem;
    color: #94a3b8;
    line-height: 1.35;
}

.dropzone-preview {
    max-height: 70px;
    max-width: 85%;
    object-fit: contain;
    margin-bottom: 0.5rem;
    border-radius: 6px;
}

/* ==========================================================================
   Step 6: Installation Progress Pipeline & Success
   ========================================================================== */
#installReviewCard {
    background: #080b12;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.pipeline-box {
    padding: 1.5rem;
    background: #080b12;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.pipeline-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.pipeline-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ef4444, #f87171);
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.pipeline-step-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pipeline-step-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: #64748b;
    transition: color 0.2s ease;
}

.pipeline-step-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.pipeline-step-row.is-active {
    color: #ffffff;
    font-weight: 600;
}

.pipeline-step-row.is-active .pipeline-step-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.pipeline-step-row.is-done {
    color: #34d399;
}

.pipeline-step-row.is-done .pipeline-step-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

#installSuccessBox {
    background: rgba(6, 78, 59, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ==========================================================================
   Navigation Action Buttons & CTA Specifications
   ========================================================================== */
.installer-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.installer-footer-actions.justify-end {
    justify-content: flex-end;
}

/* Strict CTA button rules: Auto-width, 48px height, 24px horizontal padding */
.installer-footer-actions .btn {
    height: 48px;
    min-height: 48px;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

/* Prevent any button SVG from uncontrolled expansion */
.installer-footer-actions .btn svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Primary Button (Continue CTA) */
.installer-footer-actions .btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
}

.installer-footer-actions .btn-primary:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    border-color: rgba(248, 113, 113, 0.6);
    box-shadow: 0 6px 22px rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
    color: #ffffff;
}

.installer-footer-actions .btn-primary:hover svg.btn-arrow,
.installer-footer-actions .btn-primary:hover svg:last-child {
    transform: translateX(3px);
}

.installer-footer-actions .btn-primary:active {
    transform: translateY(0);
}

.installer-footer-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

/* Secondary Button */
.installer-footer-actions .btn-secondary {
    background: #080b12;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.installer-footer-actions .btn-secondary:hover {
    background: #0f1422;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Outline / Back Button */
.installer-footer-actions .btn-outline {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.installer-footer-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.installer-footer-actions .btn-outline:hover svg:first-child {
    transform: translateX(-3px);
}

/* ==========================================================================
   Responsive Rules
   ========================================================================== */
@media (max-width: 900px) {
    .stepper-nav {
        display: none;
    }

    .stepper-mobile-bar {
        display: block;
    }

    .branding-grid {
        grid-template-columns: 1fr;
    }

    .check-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .installer-wrapper {
        padding: 1.5rem 1rem 2.5rem;
    }

    .step-pane {
        padding: 1.5rem 1.125rem;
    }

    .installer-title {
        font-size: 1.375rem;
    }

    .db-grid {
        grid-template-columns: 1fr;
    }

    .installer-footer-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .installer-footer-actions .btn {
        width: 100%;
    }

    .installer-footer-actions.justify-end {
        justify-content: stretch;
    }
}
