/**
 * CryptoExchange - Installation Wizard Styles
 * Professional dark-themed multi-step installer
 */

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #475569;
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    --gradient-2: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* === Installer Container === */
.installer-wrap {
    width: 100%;
    max-width: 720px;
}

.installer-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.installer-logo i {
    font-size: 2.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.installer-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 0.5rem;
}

.installer-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* === Progress Steps === */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
}

.progress-step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

.progress-step.done .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

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

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

.progress-step.done .step-label {
    color: var(--success);
}

.progress-line {
    width: 50px;
    height: 2px;
    background: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.progress-line.done {
    background: var(--success);
}

/* === Card === */
.installer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header i {
    font-size: 1.25rem;
    color: var(--primary-light);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.card-header .step-tag {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

.card-body {
    padding: 2rem;
}

.card-footer {
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.mono {
    font-family: 'Courier New', monospace;
}

.form-select {
    appearance: auto;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* === Requirements Check List === */
.req-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    border: 1px solid transparent;
}

.req-item.pass {
    border-color: rgba(16, 185, 129, 0.2);
}

.req-item.fail {
    border-color: rgba(239, 68, 68, 0.2);
}

.req-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.req-item.pass .req-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.req-item.fail .req-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.req-label {
    flex: 1;
}

.req-value {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-test {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
}

.btn-test:hover {
    background: rgba(6, 182, 212, 0.25);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
}

/* === Alerts === */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

/* === Test Connection Result === */
.test-result {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    display: none;
}

.test-result.show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

.test-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* === Install Progress === */
.install-progress {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.install-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
}

.install-step .step-status {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

.install-step.running .step-status {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.install-step.done .step-status {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.install-step.failed .step-status {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.install-step .step-text {
    flex: 1;
    color: var(--text-secondary);
}

.install-step.running .step-text,
.install-step.done .step-text {
    color: var(--text-primary);
}

/* === Complete Screen === */
.complete-icon {
    text-align: center;
    margin-bottom: 1.5rem;
}

.complete-icon i {
    font-size: 4rem;
    color: var(--success);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.complete-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.complete-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.info-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.88rem;
}

.info-row .info-label {
    color: var(--text-muted);
}

.info-row .info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.info-row .info-value a {
    color: var(--primary-light);
}

.complete-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.complete-actions .btn {
    min-width: 180px;
    justify-content: center;
}

.security-note {
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.85rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: #f87171;
}

.security-note i {
    margin-right: 0.4rem;
}

/* === Password Strength === */
.password-strength {
    margin-top: 0.4rem;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}

.password-strength .bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0;
}

.password-strength .bar.weak { width: 25%; background: var(--danger); }
.password-strength .bar.fair { width: 50%; background: var(--warning); }
.password-strength .bar.good { width: 75%; background: var(--info); }
.password-strength .bar.strong { width: 100%; background: var(--success); }

.strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 600px) {
    body {
        padding: 1rem 0.5rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .card-header, .card-footer {
        padding: 1rem 1.25rem;
    }

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

    .progress-line {
        width: 25px;
    }

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

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.78rem;
    }

    .complete-actions {
        flex-direction: column;
    }
}
