:root {
    --rm-primary: #4F46E5;
    --rm-primary-dark: #3730A3;
    --rm-accent: #0EA5E9;
    --rm-ink: #0F172A;
    --rm-muted: #64748B;
    --rm-line: #E2E8F0;
    --rm-bg: #F1F5F9;
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--rm-bg);
    color: var(--rm-ink);
    font-size: .925rem;
}

.installer { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.installer-side {
    width: 300px;
    flex-shrink: 0;
    background: radial-gradient(circle at 0% 0%, #6366F1 0%, transparent 55%),
                radial-gradient(circle at 100% 100%, #0EA5E9 0%, transparent 50%),
                linear-gradient(160deg, #312E81, #1E1B4B);
    color: #fff;
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.brand-mark {
    width: 44px; height: 44px; border-radius: 12px;
    background: #fff; color: var(--rm-primary);
    display: grid; place-items: center; font-weight: 800; letter-spacing: -.5px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.brand-name { font-weight: 700; font-size: 1.1rem; }
.brand-sub { font-size: .75rem; opacity: .7; }

.steps { list-style: none; padding: 0; margin: 0; flex: 1; }
.steps li { position: relative; padding-bottom: 6px; }
.steps li:not(:last-child)::after {
    content: ''; position: absolute; left: 15px; top: 34px; bottom: -2px; width: 2px;
    background: rgba(255, 255, 255, .15);
}
.steps li.done:not(:last-child)::after { background: rgba(255, 255, 255, .55); }
.steps li > a, .steps li > span {
    display: flex; align-items: center; gap: 12px; padding: 6px 0;
    color: rgba(255, 255, 255, .6); text-decoration: none;
}
.steps li > a:hover { color: #fff; }
.step-dot {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    font-style: normal; font-size: .8rem; font-weight: 600;
    border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06);
    flex-shrink: 0; z-index: 1;
}
.steps li.done .step-dot { background: #22C55E; border-color: #22C55E; color: #fff; }
.steps li.done > a, .steps li.done > span { color: rgba(255, 255, 255, .85); }
.steps li.active .step-dot { background: #fff; color: var(--rm-primary); border-color: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .18); }
.steps li.active > span { color: #fff; font-weight: 600; }

.side-foot { font-size: .75rem; opacity: .65; margin-top: 18px; }

/* ---------- Main ---------- */
.installer-main { flex: 1; padding: 48px 40px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.installer-card {
    width: 100%; max-width: 820px; background: #fff; border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 40px rgba(15, 23, 42, .08);
    padding: 40px 44px;
}
.installer-footer { margin-top: 22px; color: var(--rm-muted); font-size: .78rem; }

.step-eyebrow { color: var(--rm-primary); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.step-title { font-weight: 800; font-size: 1.65rem; letter-spacing: -.02em; margin: 6px 0 6px; }
.step-lead { color: var(--rm-muted); margin-bottom: 28px; }

.form-label { font-weight: 600; font-size: .82rem; color: #334155; margin-bottom: 6px; }
.form-control, .form-select { border-radius: 10px; border-color: #CBD5E1; padding: .6rem .85rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--rm-primary); box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .15); }
.form-text { font-size: .76rem; }
.input-group-text { border-radius: 10px; border-color: #CBD5E1; background: #F8FAFC; }

.btn { border-radius: 10px; font-weight: 600; padding: .62rem 1.3rem; }
.btn-primary { background: var(--rm-primary); border-color: var(--rm-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--rm-primary-dark); border-color: var(--rm-primary-dark); }
.btn-outline-primary { color: var(--rm-primary); border-color: var(--rm-primary); }
.btn-outline-primary:hover { background: var(--rm-primary); border-color: var(--rm-primary); }

.step-actions {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-top: 1px solid var(--rm-line); margin-top: 32px; padding-top: 22px;
}

.section-title { font-weight: 700; font-size: .95rem; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--rm-line); }

/* Feature tiles (welcome) */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.feature {
    border: 1px solid var(--rm-line); border-radius: 12px; padding: 14px; display: flex; gap: 10px; align-items: center;
    font-weight: 500; font-size: .85rem;
}
.feature i { font-size: 1.2rem; color: var(--rm-primary); background: #EEF2FF; border-radius: 9px; width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; }

/* Requirement checklist */
.check-list { border: 1px solid var(--rm-line); border-radius: 12px; overflow: hidden; }
.check-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--rm-line); font-size: .87rem; }
.check-row:last-child { border-bottom: 0; }
.check-row .val { color: var(--rm-muted); font-size: .8rem; margin-right: 10px; }
.badge-ok { color: #15803D; background: #DCFCE7; }
.badge-fail { color: #B91C1C; background: #FEE2E2; }
.badge-warn { color: #A16207; background: #FEF9C3; }
.check-badge { border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 600; white-space: nowrap; }

/* Task runner */
.task { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--rm-line); border-radius: 12px; margin-bottom: 10px; }
.task-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #F1F5F9; color: var(--rm-muted); font-size: 1.1rem; flex-shrink: 0; }
.task.running .task-icon { background: #EEF2FF; color: var(--rm-primary); }
.task.ok .task-icon { background: #DCFCE7; color: #15803D; }
.task.fail .task-icon { background: #FEE2E2; color: #B91C1C; }
.task-title { font-weight: 600; }
.task-sub { font-size: .8rem; color: var(--rm-muted); }

/* Preset cards */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.preset input { position: absolute; opacity: 0; }
.preset label {
    display: block; border: 2px solid var(--rm-line); border-radius: 12px; padding: 14px; cursor: pointer; height: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.preset label i { font-size: 1.4rem; color: var(--rm-primary); }
.preset .p-name { font-weight: 600; font-size: .87rem; margin-top: 6px; }
.preset .p-desc { font-size: .74rem; color: var(--rm-muted); }
.preset input:checked + label { border-color: var(--rm-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); background: #FAFAFF; }
.preset input:focus-visible + label { outline: 2px solid var(--rm-primary); outline-offset: 2px; }
.preset input:disabled + label { cursor: not-allowed; opacity: .55; }

/* Module toggles */
.module-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--rm-line); border-radius: 12px; margin-bottom: 10px; }
.module-row .m-name { font-weight: 600; }
.module-row .m-desc { font-size: .8rem; color: var(--rm-muted); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
.form-check-input:checked { background-color: var(--rm-primary); border-color: var(--rm-primary); }

/* Integrations accordion */
.accordion-item { border: 1px solid var(--rm-line) !important; border-radius: 12px !important; overflow: hidden; margin-bottom: 10px; }
.accordion-button { font-weight: 600; gap: 10px; }
.accordion-button:not(.collapsed) { background: #F8FAFF; color: var(--rm-ink); box-shadow: none; }
.accordion-button:focus { box-shadow: none; }
.integration-status { margin-left: auto; margin-right: 12px; font-size: .72rem; }

.logo-preview { width: 64px; height: 64px; border-radius: 12px; border: 1px dashed #CBD5E1; display: grid; place-items: center; overflow: hidden; background: #F8FAFC; color: #94A3B8; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

.success-hero { text-align: center; padding: 6px 0 10px; }
.success-icon { width: 84px; height: 84px; border-radius: 50%; background: #DCFCE7; color: #16A34A; display: grid; place-items: center; font-size: 2.6rem; margin: 0 auto 18px; }
.code-box { background: #0F172A; color: #E2E8F0; border-radius: 10px; padding: 12px 14px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; word-break: break-all; position: relative; }
.link-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--rm-line); border-radius: 12px; text-decoration: none; color: var(--rm-ink); transition: border-color .15s, transform .15s; }
.link-tile:hover { border-color: var(--rm-primary); transform: translateY(-1px); color: var(--rm-ink); }
.link-tile i { font-size: 1.3rem; color: var(--rm-primary); }

.mobile-progress { width: 100%; max-width: 820px; margin-bottom: 14px; font-size: .85rem; color: var(--rm-muted); }
.mobile-progress .progress { height: 6px; }
.mobile-progress .progress-bar { background: var(--rm-primary); }

@media (max-width: 991.98px) {
    .installer-side { display: none; }
    .installer-main { padding: 20px 16px; }
    .installer-card { padding: 26px 20px; border-radius: 14px; }
    .step-title { font-size: 1.35rem; }
}
