:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
}

.setup-shell {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
}

.setup-header {
    text-align: center;
    margin-bottom: 3rem;
}

.setup-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-main);
}

.setup-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.setup-main {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.setup-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
    padding: 0 1rem;
}

.setup-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.setup-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.setup-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.setup-step-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.setup-step.current .setup-step-icon {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.setup-step.current .setup-step-title {
    color: var(--primary-color);
}

.setup-step.complete .setup-step-icon {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.setup-panel h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.setup-lead {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Tables */
.setup-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.setup-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.setup-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
}

.setup-status {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.setup-status.pass { background: #d1fae5; color: #065f46; }
.setup-status.fail { background: #fee2e2; color: #991b1b; }

/* Forms */
.setup-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.setup-section-header { margin-bottom: 1.5rem; }
.setup-section-title { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.25rem; }
.setup-section-description { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

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

.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label { font-size: 0.875rem; font-weight: 600; }

.field input[type="text"],
.field input[type="password"],
.field select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Toggle Switch */
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.track { width: 44px; height: 24px; background: #e2e8f0; border-radius: 12px; position: relative; transition: .3s; }
.thumb { position: absolute; height: 20px; width: 20px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: .3s; }
.toggle input:checked + .track { background: var(--primary-color); }
.toggle input:checked + .track .thumb { transform: translateX(20px); }

/* Buttons */
.setup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: #f1f5f9; }

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

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* Others */
.setup-code {
    background: #0f172a;
    color: #f1f5f9;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    overflow-x: auto;
}

.final-step { text-align: center; }
.success-check { margin-bottom: 1.5rem; color: var(--success); }
.text-success { color: var(--success); }
.setup-notes { text-align: left; background: #f8fafc; padding: 1.5rem 2.5rem; border-radius: 0.75rem; margin-bottom: 2rem; }
.setup-notes li { margin-bottom: 0.5rem; color: var(--text-muted); }

.setup-details { text-align: left; margin-bottom: 2rem; }
.setup-details summary { cursor: pointer; color: var(--primary-color); font-weight: 600; margin-bottom: 1rem; }

@media (max-width: 640px) {
    .field-grid { grid-template-columns: 1fr; }
    .setup-steps { display: none; }
}
