/*
 * ------------------------------------------------------------------
 * ZIEXAM AI INSTALLER - THEME CONFIGURATION
 * ------------------------------------------------------------------
 */

:root {
    /* Brand Palette - Synced with Admin */
    --zi-primary-900: #022c22;
    --zi-primary-800: #064e3b;
    --zi-primary-700: #065f46;
    --zi-primary-600: #059669;
    --zi-primary-500: #10b981;
    --zi-primary-100: #d1fae5;
    --zi-primary-50:  #ecfdf5;

    /* Status Colors */
    --zi-success: #10b981;
    --zi-danger: #e11d48;
    --zi-warning: #f59e0b;
    --zi-info: #3b82f6;
    
    /* Typography */
    --zi-text-main: #0f172a;
    --zi-text-body: #334155;
    --zi-text-muted: #64748b;
    
    /* UI Structure */
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --border-color: #e2e8f0;
    --card-radius: 16px;
    
    /* Elevation */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

/* 
 * =========================================
 * RESET & CORE
 * =========================================
 */
* { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    background-image: radial-gradient(at 0% 0%, var(--zi-primary-50) 0px, transparent 50%);
    background-attachment: fixed;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    color: var(--zi-text-body);
    font-size: 0.925rem;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--zi-text-main);
    font-weight: 700;
    margin-top: 0;
    letter-spacing: -0.025em;
}

/* 
 * =========================================
 * LAYOUT WRAPPER
 * =========================================
 */
.installer-wrapper {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.installer-card {
    background: var(--bg-card);
    width: 100%;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.03);
    overflow: hidden;
    position: relative;
}

.installer-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--zi-primary-800) 0%, var(--zi-primary-500) 100%);
}

/* 
 * =========================================
 * HEADER
 * =========================================
 */
.installer-header {
    padding: 32px 40px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.brand-section { display: flex; align-items: center; gap: 16px; }

.brand-icon {
    width: 48px; 
    height: 48px;
    background: transparent;
    padding: 0;
    border-radius: 12px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    overflow: hidden;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.brand-text {
    font-size: 1.25rem; font-weight: 800; margin: 0;
    line-height: 1.2; color: var(--zi-text-main);
}

.brand-subtitle { font-size: 0.85rem; color: var(--zi-text-muted); font-weight: 500; }

.version-badge {
    background: var(--zi-primary-50);
    color: var(--zi-primary-800);
    font-size: 0.75rem; padding: 6px 12px;
    border-radius: 20px; font-weight: 600;
    border: 1px solid var(--zi-primary-100);
}

/* 
 * =========================================
 * CONTENT AREA
 * =========================================
 */
.installer-content {
    padding: 40px;
    min-height: 350px;
}

/* Centered Layouts (Welcome/Finish) */
.welcome-container { max-width: 580px; margin: 0 auto; text-align: center; }

.hero-icon-wrapper {
    width: 80px; height: 80px;
    background: var(--zi-primary-50);
    color: var(--zi-primary-700);
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 32px;
    margin-bottom: 20px;
}

/* Requirements & Permissions Lists */
.prerequisite-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
}

.prereq-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.prereq-item:last-child { border-bottom: none; }

.icon-box {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    margin-right: 16px;
    flex-shrink: 0;
}

.icon-box.success { background: #ecfdf5; color: var(--zi-success); }
.icon-box.warning { background: #fffbeb; color: var(--zi-warning); }
.icon-box.info    { background: #eff6ff; color: var(--zi-info); }

/* 
 * =========================================
 * TABLES
 * =========================================
 */
.requirements-table, .permissions-table {
    width: 100%; margin-top: 10px; border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden;
}

.requirements-table th, .permissions-table th {
    padding: 12px 20px; background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem; text-transform: uppercase;
    font-weight: 700; color: var(--zi-text-muted); text-align: left;
}

.requirements-table td, .permissions-table td {
    padding: 14px 20px; border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem; color: var(--zi-text-main);
    background: #fff;
}
.requirements-table tr:last-child td { border-bottom: none; }

.status-pass { color: var(--zi-success); font-weight: 600; display: flex; align-items: center; gap: 6px;}
.status-fail { color: var(--zi-danger); font-weight: 600; display: flex; align-items: center; gap: 6px;}

/* 
 * =========================================
 * FORMS
 * =========================================
 */
.form-label { font-weight: 600; font-size: 0.9rem; color: var(--zi-text-main); margin-bottom: 8px; }

.form-control, .form-select {
    border: 1px solid var(--border-color);
    padding: 12px 16px; border-radius: 10px;
    font-size: 0.95rem; background-color: #fff;
    color: var(--zi-text-main);
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--zi-primary-500);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    outline: none;
}

/* 
 * =========================================
 * BUTTONS
 * =========================================
 */
.btn-primary {
    background-color: var(--zi-primary-700) !important;
    border: none; color: #fff;
    padding: 12px 30px; border-radius: 10px;
    font-weight: 600; box-shadow: 0 4px 6px -1px rgba(6, 95, 70, 0.3);
    transition: all 0.2s;
}
.btn-primary:hover {
    background-color: var(--zi-primary-800) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(6, 95, 70, 0.4);
}

.btn-outline-secondary {
    border: 1px solid var(--border-color);
    color: var(--zi-text-body);
    padding: 12px 24px; border-radius: 10px;
    background: transparent;
    font-weight: 500;
}
.btn-outline-secondary:hover {
    background: #f8fafc; border-color: var(--zi-text-main); color: var(--zi-text-main);
}

/* 
 * =========================================
 * PROGRESS BAR
 * =========================================
 */
.installer-progress-area {
    background: #F8FAFC; border-top: 1px solid var(--border-color);
    padding: 24px 40px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.progress-track { display: flex; gap: 6px; width: 100%; max-width: 360px; }

.progress-step {
    flex: 1; height: 6px; background: #e2e8f0;
    border-radius: 10px; transition: all 0.4s ease;
}
.progress-step.active { background: var(--zi-primary-500); }

.progress-label { font-size: 0.8rem; font-weight: 600; color: var(--zi-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* 
 * =========================================
 * FOOTER & UTILS
 * =========================================
 */
.installer-footer {
    margin-top: 24px; text-align: center; width: 100%;
}
.installer-footer p { margin: 4px 0; font-size: 0.875rem; color: var(--zi-text-muted); }
.installer-footer a { color: var(--zi-primary-700); text-decoration: none; font-weight: 600; }

.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 16px; border-radius: 10px; font-size: 0.95rem; }

@media (max-width: 600px) {
    body { padding: 15px; }
    .installer-header, .installer-content, .installer-progress-area { padding: 20px; }
    .btn { width: 100%; margin-bottom: 10px; }
    .d-flex.justify-content-center.gap-3 { flex-direction: column-reverse; }
}