:root {
    --mg-bg: #f5f7fb;
    --mg-surface: #ffffff;
    --mg-ink: #172033;
    --mg-muted: #6b7280;
    --mg-border: #e6eaf0;
    --mg-primary: #5b4cf0;
    --mg-primary-dark: #4134c7;
    --mg-success: #0f9f6e;
    --mg-danger: #d64545;
    --mg-warning: #b7791f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    color: var(--mg-ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(91,76,240,.08), transparent 28rem),
        linear-gradient(180deg, #fafbff 0%, var(--mg-bg) 100%);
    font-family: Tahoma, Arial, sans-serif;
}

a { color: var(--mg-primary); }
code, .ltr-input, [dir="ltr"] { direction: ltr !important; text-align: left !important; unicode-bidi: plaintext; }

.installer-shell {
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
}

.installer-sidebar,
.installer-panel {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(230,234,240,.9);
    box-shadow: 0 18px 50px rgba(31,41,55,.08);
}

.installer-sidebar {
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    min-height: 650px;
    overflow: auto;
}

.brand-card { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 46px; height: 46px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #6758f5, #3e32bc);
    color: #fff; font-weight: 800; letter-spacing: -.5px;
    box-shadow: 0 10px 24px rgba(91,76,240,.24);
}
.brand-card strong { display: block; font-size: 15px; }
.brand-card span { display: block; color: var(--mg-muted); font-size: 12px; margin-top: 2px; }

.product-summary { padding: 34px 2px 24px; border-bottom: 1px solid var(--mg-border); }
.eyebrow, .panel-kicker {
    color: var(--mg-primary); font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.product-summary h1 { font-size: 26px; margin: 7px 0 12px; font-weight: 800; }
.product-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.product-meta span {
    font-size: 11px; color: #50586b; background: #f3f4f8;
    border: 1px solid var(--mg-border); padding: 6px 9px; border-radius: 999px;
}

.step-nav { margin: 24px 0; display: grid; gap: 8px; }
.step-item {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 12px; border-radius: 14px;
    color: #586174; text-decoration: none !important;
    transition: .2s ease;
}
.step-item:hover { background: #f7f7ff; color: var(--mg-primary); }
.step-item.active { color: var(--mg-primary); background: #f1efff; }
.step-item b {
    width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px;
    display: grid; place-items: center; background: #eef0f5; color: #737b8d; font-size: 12px;
}
.step-item.active b { background: var(--mg-primary); color: #fff; }
.step-item strong { display: block; font-size: 13px; }
.step-item small { display: block; font-size: 10px; margin-top: 3px; color: #8b93a3; }

.secure-note {
    margin-top: auto; padding: 14px; border-radius: 14px;
    border: 1px solid #dff3eb; background: #f4fbf8; color: #42705f;
    font-size: 11px; line-height: 1.9;
}
.secure-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mg-success); margin-left: 6px; }

.installer-main { min-width: 0; }
.installer-panel {
    min-height: calc(100vh - 48px);
    border-radius: 24px;
    padding: clamp(30px, 5vw, 64px);
}
.installer-panel h2 { font-size: clamp(28px, 4vw, 42px); line-height: 1.45; font-weight: 800; margin: 10px 0 14px; letter-spacing: -.5px; }
.lead-copy { color: var(--mg-muted); line-height: 2.1; font-size: 14px; max-width: 760px; }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 34px 0; }
.feature-card {
    padding: 20px; border: 1px solid var(--mg-border); border-radius: 18px;
    background: linear-gradient(180deg,#fff,#fbfbfe);
}
.feature-card > span { display: inline-block; color: var(--mg-primary); font-weight: 800; font-size: 11px; margin-bottom: 12px; }
.feature-card strong { display: block; font-size: 14px; margin-bottom: 8px; }
.feature-card p { margin: 0; color: var(--mg-muted); font-size: 12px; line-height: 1.9; }

.action-button {
    border-radius: 14px; min-height: 52px; padding: 13px 24px;
    font-size: 14px; font-weight: 700; border: 0;
}
.btn-primary { background: linear-gradient(135deg, var(--mg-primary), var(--mg-primary-dark)); box-shadow: 0 12px 28px rgba(91,76,240,.2); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg,#5143db,#372da8); }

.requirements-list { display: grid; gap: 9px; margin: 30px 0 22px; }
.requirement-row {
    display: grid; grid-template-columns: minmax(0,1fr) auto 36px; gap: 14px; align-items: center;
    border: 1px solid var(--mg-border); border-radius: 14px; padding: 13px 14px; background: #fff;
}
.requirement-row strong { display: block; font-size: 13px; }
.requirement-row small { display: block; margin-top: 3px; color: var(--mg-muted); font-size: 10px; }
.requirement-row > span { color: #5f6878; font-size: 12px; }
.requirement-row > b { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.requirement-row.is-ok > b { background: #e9f8f2; color: var(--mg-success); }
.requirement-row.is-error > b { background: #fdeeee; color: var(--mg-danger); }

.notice { border-radius: 14px; padding: 13px 15px; margin: 18px 0; font-size: 12px; line-height: 1.9; }
.success-notice { color: #25745a; background: #effaf6; border: 1px solid #d9f1e8; }
.error-notice { color: #a53e3e; background: #fff3f3; border: 1px solid #f7dddd; }
.warning-notice { color: #8b651e; background: #fff9ea; border: 1px solid #f3e4ba; }

.form-section {
    border: 1px solid var(--mg-border); background: #fff; border-radius: 18px;
    padding: 22px; margin: 22px 0;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--mg-border); }
.section-heading span { font-weight: 800; font-size: 14px; }
.section-heading small { color: var(--mg-muted); font-size: 10px; direction: ltr; }
.form-group label { color: #30394b; font-weight: 700; font-size: 12px; }
.form-control {
    height: 48px; border-radius: 12px; border: 1px solid #dfe3ea; box-shadow: none !important;
    font-size: 13px; background: #fcfcfe; padding: 10px 13px;
}
.form-control:focus { border-color: #a79ef7; background: #fff; }
.form-text { font-size: 10px; line-height: 1.8; }
.install-submit { width: 100%; margin-top: 2px; }
.privacy-line { text-align: center; color: #8a92a2; font-size: 10px; line-height: 1.8; margin: 12px 0 0; }

.install-status { border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; font-size: 12px; line-height: 1.9; }
.install-status.is-working { background: #f1efff; border: 1px solid #dedafd; color: #5147a6; }
.install-status.is-error { background: #fff3f3; border: 1px solid #f5dada; color: #a43d3d; }

.finish-panel { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.success-icon { width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg,#16a273,#0c855e); font-size: 34px; font-weight: 800; margin-bottom: 20px; box-shadow: 0 18px 35px rgba(15,159,110,.2); }
.credentials-card { width: min(620px,100%); text-align: right; border: 1px solid var(--mg-border); border-radius: 18px; overflow: hidden; margin: 22px 0 6px; background: #fff; }
.credentials-card > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; border-bottom: 1px solid var(--mg-border); font-size: 12px; }
.credentials-card > div:last-child { border-bottom: 0; }
.credentials-card span { color: var(--mg-muted); }
.credentials-card a, .credentials-card strong { word-break: break-all; }
.finish-panel .warning-notice { width: min(620px,100%); }
.finish-panel .action-button { width: min(620px,100%); }

@media (max-width: 900px) {
    .installer-shell { grid-template-columns: 1fr; width: min(760px, calc(100% - 20px)); margin: 10px auto; min-height: auto; }
    .installer-sidebar { position: static; height: auto; min-height: auto; border-radius: 18px; }
    .product-summary { padding: 22px 0 16px; }
    .step-nav { grid-template-columns: repeat(4, minmax(0,1fr)); margin: 15px 0 0; }
    .step-item { justify-content: center; padding: 8px; }
    .step-item span { display: none; }
    .secure-note { display: none; }
    .installer-panel { min-height: auto; border-radius: 18px; padding: 28px 20px; }
}

@media (max-width: 620px) {
    .feature-grid { grid-template-columns: 1fr; }
    .installer-panel h2 { font-size: 28px; }
    .requirement-row { grid-template-columns: minmax(0,1fr) 30px; }
    .requirement-row > span { grid-column: 1; grid-row: 2; }
    .requirement-row > b { grid-column: 2; grid-row: 1 / span 2; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .credentials-card > div { align-items: flex-start; flex-direction: column; gap: 6px; }
}
