/* iGraft Installer — Premium Dark Theme */
:root {
    --primary: 199, 89%, 48%;
    --primary-hover: 199, 89%, 40%;
    --success: 142, 71%, 45%;
    --danger: 0, 84%, 60%;
    --warning: 38, 92%, 50%;
    --bg-app: 222, 47%, 11%;
    --bg-card: 217, 33%, 17%;
    --bg-input: 222, 47%, 14%;
    --border: 215, 25%, 27%;
    --text: 210, 20%, 98%;
    --text-muted: 215, 16%, 47%;
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: hsl(var(--bg-app));
    color: hsl(var(--text));
    min-height: 100vh;
}

/* ── Layout ── */
.installer-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
@media (max-width: 768px) {
    .installer-container { grid-template-columns: 1fr; }
    .installer-sidebar { display: none; }
}

/* ── Sidebar ── */
.installer-sidebar {
    background: hsl(222, 47%, 13%);
    border-right: 1px solid hsl(var(--border));
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}
.sidebar-brand { margin-bottom: auto; }
.brand-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: hsl(var(--primary));
    letter-spacing: -1px;
}
.brand-sub {
    font-size: 0.8rem;
    color: hsl(var(--text-muted));
    margin-top: 4px;
}
.sidebar-footer { margin-top: 2rem; }
.sidebar-admin-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: hsl(var(--text-muted));
    text-decoration: none;
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-admin-link:hover {
    background: hsl(var(--bg-card));
    color: hsl(var(--text));
}

/* ── Main ── */
.installer-main {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.step-panel {
    width: 100%;
    max-width: 600px;
    animation: fadeSlideIn 0.35s ease;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Cards ── */
.card {
    background: hsl(var(--bg-card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 2rem;
}
.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: hsl(var(--text-muted));
    margin-bottom: 4px;
    text-transform: none;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: hsl(var(--bg-input));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-sm);
    color: hsl(var(--text));
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsla(var(--primary), 0.15);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-hint {
    font-size: 0.75rem;
    color: hsl(var(--text-muted));
    margin-top: 4px;
}
textarea.form-control { resize: vertical; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: inherit;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background: hsl(var(--primary));
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: hsl(var(--primary-hover));
}
.btn-secondary {
    background: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--text));
}
.btn-secondary:hover:not(:disabled) {
    background: hsl(var(--bg-card));
}
.btn-danger {
    background: hsl(var(--danger));
    color: white;
}
.btn-danger-outline {
    background: transparent;
    border-color: hsl(var(--danger));
    color: hsl(var(--danger));
}
.btn-danger-outline:hover {
    background: hsla(var(--danger), 0.1);
}
.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    border-radius: 12px;
}
.btn-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-top: 1rem;
    display: none;
}
.alert.show { display: block; }
.alert-success {
    background: hsla(var(--success), 0.1);
    border: 1px solid hsl(var(--success));
    color: hsl(var(--success));
}
.alert-danger {
    background: hsla(var(--danger), 0.1);
    border: 1px solid hsl(var(--danger));
    color: hsl(var(--danger));
}
.alert-info {
    background: hsla(var(--primary), 0.1);
    border: 1px solid hsl(var(--primary));
    color: hsl(var(--primary));
}

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid hsl(var(--border));
    border-top-color: hsl(var(--primary));
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress Bar (installer steps) ── */
.installer-progress {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1rem 0;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 600px;
    overflow-x: auto;
    position: sticky;
    top: 0;
    background: hsl(var(--bg-app));
    z-index: 10;
}
.progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: hsl(var(--border));
    flex-shrink: 0;
}
.step-dot.active {
    background: hsl(var(--primary));
    box-shadow: 0 0 8px hsla(var(--primary), 0.5);
}
.step-dot.done { background: hsl(var(--success)); }
.step-label {
    font-size: 0.7rem;
    color: hsl(var(--text-muted));
    white-space: nowrap;
}
.progress-line {
    width: 30px;
    height: 2px;
    background: hsl(var(--border));
    margin: 0 4px;
    flex-shrink: 0;
}
.progress-line.done { background: hsl(var(--success)); }

/* ── Process Bar (AJAX install progress) ── */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: hsl(var(--bg-input));
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.progress-bar-fill {
    height: 100%;
    background: hsl(var(--primary));
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ── Process Logger ── */
.process-logger {
    background: hsl(222, 47%, 8%);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-sm);
    padding: 1rem;
    min-height: 200px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 350px;
}
.log-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.log-item .log-icon { flex-shrink: 0; font-size: 14px; }
.log-item.running { color: #fbbf24; }
.log-item.success { color: #4ade80; }
.log-item.error { color: #f87171; }

/* ── Welcome / Branding ── */
.branding-jumbotron {
    text-align: center;
    padding: 2rem 0;
}
.branding-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: hsl(var(--primary));
    letter-spacing: -2px;
}
.branding-headline {
    font-size: 1.15rem;
    color: hsl(var(--text-muted));
    margin-top: 0.5rem;
}
.version-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: hsla(var(--primary), 0.1);
    color: hsl(var(--primary));
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
}
.step-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.step-description {
    color: hsl(var(--text-muted));
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
code {
    background: hsl(var(--bg-input));
    padding: 2px 6px;
    border-radius: 4px;
    color: hsl(var(--primary));
    font-size: 0.85rem;
}

/* ── Requirements ── */
.check-list {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid hsl(var(--border));
}
.check-item:last-child { border-bottom: none; }
.check-name { flex: 1; font-size: 0.85rem; }
.check-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    background: hsl(var(--border));
}
.check-indicator.success { background: hsl(var(--success)); color: white; }
.check-indicator.error { background: hsl(var(--danger)); color: white; }
.check-info { font-size: 0.75rem; color: hsl(var(--text-muted)); }

/* ── Password Strength ── */
.password-strength-container { margin-top: 8px; }
.strength-bar {
    height: 4px;
    background: hsl(var(--border));
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.strength-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}
.strength-bar-fill.weak { background: hsl(var(--danger)); width: 25%; }
.strength-bar-fill.medium { background: hsl(var(--warning)); width: 60%; }
.strength-bar-fill.strong { background: hsl(var(--success)); width: 100%; }
.strength-text { font-size: 0.75rem; color: hsl(var(--text-muted)); }

/* ── Toast/Error Banner ── */
.error-banner {
    background: hsla(var(--danger), 0.1);
    border: 1px solid hsl(var(--danger));
    color: hsl(var(--danger));
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}
.error-banner.show { display: block; }
.success-banner {
    background: hsla(var(--success), 0.1);
    border: 1px solid hsl(var(--success));
    color: hsl(var(--success));
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ── Complete page ── */
.credentials-box {
    background: hsl(var(--bg-input));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 1rem 0;
}
.cred-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.9rem;
}
.cred-row:last-child { border-bottom: none; }
.cred-label { color: hsl(var(--text-muted)); }
.cred-value { font-weight: 600; font-family: 'SF Mono', monospace; }
