@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@500;600;700;800&display=swap');

:root {
    --ix-primary: #1E3A5F;
    --ix-secondary: #2563EB;
    --ix-accent: #10B981;
    --ix-warning: #F59E0B;
    --ix-error: #DC2626;
    --ix-bg: #F8FAFC;
    --ix-card: #FFFFFF;
    --ix-text: #334155;
    --ix-muted: #64748B;
    --ix-border: rgba(30, 58, 95, 0.10);
    --ix-shadow: 0 18px 50px rgba(30, 58, 95, 0.12);
    --ix-radius: 22px;
    --ix-glass: rgba(255, 255, 255, 0.72);
    --ix-navy-deep: #0F2744;
    --ix-glow: rgba(37, 99, 235, 0.28);
}

[data-theme="dark"] {
    --ix-bg: #0B1220;
    --ix-card: #121A2B;
    --ix-text: #E2E8F0;
    --ix-muted: #94A3B8;
    --ix-border: rgba(148, 163, 184, 0.16);
    --ix-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --ix-glass: rgba(18, 26, 43, 0.78);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'DM Sans', sans-serif;
    color: var(--ix-text);
    background: var(--ix-bg);
}

body.installer-body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
        radial-gradient(900px 500px at 90% 0%, rgba(16, 185, 129, 0.14), transparent 50%),
        linear-gradient(160deg, #EEF3F9 0%, var(--ix-bg) 45%, #E8EEF7 100%);
}

[data-theme="dark"] body.installer-body,
body.installer-body[data-theme="dark"] {
    background:
        radial-gradient(1000px 500px at 15% -10%, rgba(37, 99, 235, 0.22), transparent 55%),
        radial-gradient(800px 420px at 90% 0%, rgba(16, 185, 129, 0.12), transparent 50%),
        linear-gradient(160deg, #07101D 0%, var(--ix-bg) 50%, #0B1526 100%);
}

a { color: var(--ix-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

.ix-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.ix-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.ix-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ix-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--ix-primary), var(--ix-secondary));
    color: #fff;
    display: grid;
    place-items: center;
    font-family: Outfit, sans-serif;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px var(--ix-glow);
}

.ix-brand h1 {
    margin: 0;
    font-family: Outfit, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ix-primary);
    line-height: 1.2;
}

[data-theme="dark"] .ix-brand h1 { color: #E2E8F0; }

.ix-brand p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--ix-muted);
}

.ix-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ix-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--ix-border);
    background: var(--ix-glass);
    backdrop-filter: blur(12px);
    color: var(--ix-text);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.ix-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(30, 58, 95, 0.12);
}

.ix-stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    border-radius: var(--ix-radius);
    background: var(--ix-glass);
    border: 1px solid var(--ix-border);
    backdrop-filter: blur(16px);
    box-shadow: var(--ix-shadow);
}

.ix-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    min-width: 0;
}

.ix-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 17px;
    left: calc(50% + 22px);
    width: calc(100% - 28px);
    height: 2px;
    background: #CBD5E1;
    border-radius: 999px;
    z-index: 0;
}

[data-theme="dark"] .ix-step:not(:last-child)::after { background: #334155; }

.ix-step.is-complete:not(:last-child)::after,
.ix-step.is-current:not(:last-child)::after {
    background: linear-gradient(90deg, var(--ix-accent), var(--ix-secondary));
}

.ix-step-index {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    background: #E2E8F0;
    color: var(--ix-muted);
    transition: transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
}

.ix-step.is-current .ix-step-index {
    background: linear-gradient(145deg, var(--ix-secondary), var(--ix-primary));
    color: #fff;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.16);
    animation: ixPulse 1.8s ease-in-out infinite;
}

.ix-step.is-complete .ix-step-index {
    background: var(--ix-accent);
    color: #fff;
}

.ix-step-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ix-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ix-step.is-current .ix-step-label,
.ix-step.is-complete .ix-step-label {
    color: var(--ix-text);
}

@keyframes ixPulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14); }
    50% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.08); }
}

.ix-card {
    background: var(--ix-card);
    border: 1px solid var(--ix-border);
    border-radius: var(--ix-radius);
    box-shadow: var(--ix-shadow);
    overflow: hidden;
}

.ix-card-pad { padding: 28px 30px; }

.ix-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    min-height: 620px;
}

.ix-hero-copy {
    padding: 42px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.ix-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ix-secondary);
}

.ix-hero-copy h2 {
    margin: 0;
    font-family: Outfit, sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    color: var(--ix-primary);
    letter-spacing: -0.02em;
}

[data-theme="dark"] .ix-hero-copy h2 { color: #F8FAFC; }

.ix-hero-copy .lead {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ix-muted);
    max-width: 38ch;
}

.ix-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ix-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.06);
    color: var(--ix-text);
    font-size: 0.82rem;
    font-weight: 600;
}

[data-theme="dark"] .ix-chip { background: rgba(148, 163, 184, 0.12); }

.ix-modules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ix-module {
    padding: 7px 11px;
    border-radius: 12px;
    border: 1px solid var(--ix-border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ix-text);
    background: rgba(255,255,255,0.45);
}

[data-theme="dark"] .ix-module { background: rgba(15, 23, 42, 0.4); }

.ix-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.ix-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.ix-btn:hover { transform: translateY(-1px); }
.ix-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.ix-btn-primary {
    background: linear-gradient(135deg, var(--ix-secondary), var(--ix-primary));
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.ix-btn-secondary {
    background: rgba(30, 58, 95, 0.06);
    color: var(--ix-primary);
    border: 1px solid var(--ix-border);
}

[data-theme="dark"] .ix-btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #E2E8F0;
}

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

.ix-btn-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--ix-error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.ix-hero-visual {
    position: relative;
    background:
        linear-gradient(160deg, rgba(15, 39, 68, 0.96), rgba(30, 58, 95, 0.92)),
        radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.45), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.35), transparent 40%);
    overflow: hidden;
    min-height: 360px;
}

.ix-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.55;
    animation: ixFloat 8s ease-in-out infinite;
}

.ix-orb-1 { width: 180px; height: 180px; background: #2563EB; top: 12%; left: 10%; }
.ix-orb-2 { width: 140px; height: 140px; background: #10B981; bottom: 16%; right: 12%; animation-delay: -2s; }
.ix-orb-3 { width: 90px; height: 90px; background: #60A5FA; top: 42%; right: 34%; animation-delay: -4s; }

@keyframes ixFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-16px) scale(1.04); }
}

.ix-scene {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.ix-scene-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 14px;
    width: min(340px, 100%);
}

.ix-scene-card {
    aspect-ratio: 1;
    border-radius: 18px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    animation: ixRise 0.8s ease both;
}

.ix-scene-card:nth-child(2) { animation-delay: .08s; }
.ix-scene-card:nth-child(3) { animation-delay: .16s; }
.ix-scene-card:nth-child(4) { animation-delay: .24s; }
.ix-scene-card:nth-child(5) { animation-delay: .32s; }
.ix-scene-card:nth-child(6) { animation-delay: .4s; }

.ix-scene-card i { font-size: 1.35rem; opacity: 0.95; }

@keyframes ixRise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.ix-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: var(--ix-muted);
    font-size: 0.82rem;
}

.ix-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }

.ix-section-title {
    margin: 0 0 6px;
    font-family: Outfit, sans-serif;
    font-size: 1.55rem;
    color: var(--ix-primary);
}

[data-theme="dark"] .ix-section-title { color: #F8FAFC; }

.ix-section-sub {
    margin: 0 0 22px;
    color: var(--ix-muted);
}

.ix-grid-2 {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.ix-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ix-panel {
    border: 1px solid var(--ix-border);
    border-radius: 18px;
    padding: 16px;
    background: rgba(248, 250, 252, 0.65);
}

[data-theme="dark"] .ix-panel { background: rgba(15, 23, 42, 0.45); }

.ix-panel h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-family: Outfit, sans-serif;
}

.ix-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.ix-check-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--ix-card);
    border: 1px solid var(--ix-border);
    font-size: 0.88rem;
}

.ix-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.78rem;
}

.ix-status.ok { color: var(--ix-accent); }
.ix-status.bad { color: var(--ix-error); }
.ix-status.warn { color: var(--ix-warning); }
.ix-status.muted { color: var(--ix-muted); }

.ix-progress-block { display: grid; gap: 12px; }

.ix-progress-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.ix-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.08);
    overflow: hidden;
}

[data-theme="dark"] .ix-bar { background: rgba(148, 163, 184, 0.14); }

.ix-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ix-accent), var(--ix-secondary));
    transition: width .6s cubic-bezier(.22,1,.36,1);
}

.ix-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ix-field { display: grid; gap: 6px; }
.ix-field.full { grid-column: 1 / -1; }

.ix-field label {
    font-size: 0.84rem;
    font-weight: 600;
}

.ix-field input,
.ix-field select,
.ix-field textarea {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid var(--ix-border);
    background: var(--ix-card);
    color: var(--ix-text);
    padding: 10px 12px;
    font: inherit;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.ix-field textarea { min-height: 90px; resize: vertical; }

.ix-field input:focus,
.ix-field select:focus,
.ix-field textarea:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ix-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ix-mode {
    position: relative;
    border: 1px solid var(--ix-border);
    border-radius: 18px;
    padding: 18px;
    cursor: pointer;
    background: var(--ix-card);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.ix-mode:hover { transform: translateY(-2px); }
.ix-mode input { position: absolute; opacity: 0; pointer-events: none; }

.ix-mode.is-active {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ix-mode h4 {
    margin: 0 0 6px;
    font-family: Outfit, sans-serif;
    font-size: 1rem;
}

.ix-mode p {
    margin: 0;
    color: var(--ix-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.ix-console {
    background: #0B1220;
    color: #CBD5E1;
    border-radius: 16px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    max-height: 260px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.ix-console .ok { color: #34D399; }
.ix-console .error { color: #F87171; }
.ix-console .warn { color: #FBBF24; }

.ix-alert {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.ix-alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.ix-alert-error {
    background: rgba(220, 38, 38, 0.1);
    color: #991B1B;
    border: 1px solid rgba(220, 38, 38, 0.22);
}

[data-theme="dark"] .ix-alert-success { color: #6EE7B7; }
[data-theme="dark"] .ix-alert-error { color: #FCA5A5; }

.ix-toggle-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ix-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--ix-border);
    background: var(--ix-card);
    font-size: 0.86rem;
    font-weight: 600;
}

.ix-success-hero {
    text-align: center;
    padding: 48px 28px 36px;
}

.ix-success-mark {
    width: 96px;
    height: 96px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--ix-accent), #059669);
    color: #fff;
    font-size: 2.4rem;
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.35);
    animation: ixPop .6s cubic-bezier(.22,1,.36,1) both;
}

@keyframes ixPop {
    from { transform: scale(.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.ix-success-hero h2 {
    margin: 0 0 8px;
    font-family: Outfit, sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--ix-primary);
}

[data-theme="dark"] .ix-success-hero h2 { color: #F8FAFC; }

.ix-installed-modules {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 8px;
}

.ix-installed-modules span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-size: 0.8rem;
    font-weight: 700;
}

[data-theme="dark"] .ix-installed-modules span { color: #6EE7B7; }

.ix-summary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 22px 0;
}

.ix-summary-item {
    border: 1px solid var(--ix-border);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
    background: rgba(248, 250, 252, 0.7);
}

[data-theme="dark"] .ix-summary-item { background: rgba(15, 23, 42, 0.4); }

.ix-summary-item strong {
    display: block;
    margin-top: 6px;
    color: var(--ix-accent);
    font-size: 0.85rem;
}

.ix-nav-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--ix-border);
}

.ix-check-anim {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(16, 185, 129, 0.12);
    color: var(--ix-accent);
    font-size: 1.6rem;
    animation: ixPop .45s ease both;
}

.ix-hidden { display: none !important; }

@media (max-width: 960px) {
    .ix-hero,
    .ix-grid-2 {
        grid-template-columns: 1fr;
    }

    .ix-stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ix-step-label { font-size: 0.68rem; }
    .ix-summary-row { grid-template-columns: repeat(2, 1fr); }
    .ix-toggle-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .ix-shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
    .ix-card-pad, .ix-hero-copy { padding: 22px 18px; }
    .ix-form-grid,
    .ix-mode-grid,
    .ix-grid-3 { grid-template-columns: 1fr; }
    .ix-step:not(:last-child)::after { display: none; }
    .ix-actions, .ix-nav-row { flex-direction: column; }
    .ix-btn { width: 100%; }
}
