/* ══════════════════════════════════════════════════════════════
   CortexOS — Setup Wizard Styles
   Premium dark-theme wizard with glassmorphism and animations
   ══════════════════════════════════════════════════════════════ */

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

:root {
    /* Color palette */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(99, 102, 241, 0.4);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --accent-glow: rgba(99, 102, 241, 0.25);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    line-height: 1.6;

    /* Animated gradient background */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
}

/* ── Wizard Container ─────────────────────────────────────── */
.wizard-container {
    width: 100%;
    max-width: 680px;
    position: relative;
}

/* ── Header ───────────────────────────────────────────────── */
.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
    margin-bottom: 2rem;
}

.progress-track {
    height: 3px;
    background: var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    width: 20%;
    transition: width var(--transition-slow);
    box-shadow: 0 0 12px var(--accent-glow);
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    padding: 0 0.25rem;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

.step-dot:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.step-dot.active {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
}

.step-dot.completed {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* ── Steps (Form Panels) ─────────────────────────────────── */
.step {
    display: none;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    animation: fadeSlideIn 0.4s ease;
}

.step.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    margin-bottom: 1.75rem;
}

.step-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.25rem 0 0.25rem;
    color: var(--text-primary);
}

.step-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--error);
}

.optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

.field-hint a {
    color: var(--accent-primary-hover);
    text-decoration: none;
}

.field-hint a:hover {
    text-decoration: underline;
}

/* ── Select / Dropdown Fields ─────────────────────────────── */
.select-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.select-field:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.select-field option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* ── Custom Fields Animation ──────────────────────────────── */
.custom-fields {
    animation: fadeSlideIn 0.3s ease;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

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

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--border-active);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
}

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

.btn-ghost:hover {
    color: var(--text-primary);
}

.btn-ghost:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-google {
    font-size: 1rem;
    padding: 0.85rem 2rem;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.btn-icon {
    font-size: 1.1rem;
}

/* ── Test Result ──────────────────────────────────────────── */
.test-result {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: none;
}

.test-result.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.test-result.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.test-result.loading {
    display: block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── OAuth Status Cards ───────────────────────────────────── */
.status-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.status-card.success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-card.info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-card.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.status-card strong {
    display: block;
    margin-bottom: 0.2rem;
}

.status-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.status-card code {
    font-family: var(--font-mono);
    background: var(--bg-glass);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent-primary-hover);
}

/* ── Info Box ─────────────────────────────────────────────── */
.info-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.info-box h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-box ol {
    padding-left: 1.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.info-box li {
    margin-bottom: 0.5rem;
}

.info-box ul {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.info-box a {
    color: var(--accent-primary-hover);
    text-decoration: none;
}

.info-box a:hover {
    text-decoration: underline;
}

.info-box code {
    font-family: var(--font-mono);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--accent-primary-hover);
}

.info-box strong {
    color: var(--text-primary);
}

/* ── Summary Grid (Step 5) ────────────────────────────────── */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.summary-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.summary-item .value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    word-break: break-all;
}

/* ── Checklist (Step 5) ───────────────────────────────────── */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.check-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── Navigation ───────────────────────────────────────────── */
.wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
    max-width: 380px;
    backdrop-filter: blur(8px);
}

.toast.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.toast.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

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

    .step {
        padding: 1.5rem;
    }
}