/* Конфигуратор сборки — витрина. Ванильный CSS, без фреймворков и CDN. */

:root {
  --bg:      #0B0C0E;
  --bg-2:    #121419;
  --bg-3:    #171A20;
  --line:    rgba(255,255,255,.07);
  --line-2:  rgba(255,255,255,.13);
  --tx:      #EEF1F5;
  --tx-dim:  #A2AAB6;
  --tx-mut:  #6B7280;
  --acc:     #C6F24E;
  --acc-dk:  #96BE22;
  --warn:    #FFC53D;
  --bad:     #FF5A5F;
  --r:       16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ── Шапка ── */
.top {
  position: sticky; top: 0; z-index: 30; background: rgba(11,12,14,.82);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.logo b { width: 26px; height: 26px; border-radius: 8px; background: var(--acc); color: #10130A;
          display: grid; place-items: center; font-size: 15px; }
.steps { display: flex; gap: 6px; margin-left: auto; }
.steps i {
  width: 26px; height: 4px; border-radius: 2px; background: var(--line-2); display: block;
  transition: background .3s;
}
.steps i.on { background: var(--acc); }

/* ── Экран ── */
.screen { display: none; padding: 44px 0 90px; }
.screen.on { display: block; animation: rise .32s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 10px; }
h2 { font-size: 19px; letter-spacing: -.02em; margin: 0 0 14px; }
.lead { color: var(--tx-dim); margin: 0 0 30px; max-width: 620px; }
.eyebrow { color: var(--acc); font-size: 12px; font-weight: 600; letter-spacing: .1em;
           text-transform: uppercase; margin-bottom: 12px; }

/* ── Карточки дисциплин ── */
.discs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.disc {
  position: relative; text-align: left; cursor: pointer; padding: 22px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s, transform .2s, background .2s;
}
.disc:hover:not([disabled]) { border-color: var(--acc); transform: translateY(-2px); }
.disc[disabled] { opacity: .42; cursor: not-allowed; }
.disc .ic { font-size: 26px; margin-bottom: 12px; display: block; }
.disc .nm { font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.disc .sub { color: var(--tx-mut); font-size: 13px; margin-top: 4px; }

/* ── Форма параметров ── */
.form { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
@media (max-width: 900px) { .form { grid-template-columns: 1fr; } }

.field { margin-bottom: 26px; }
.field > label { display: flex; align-items: baseline; justify-content: space-between;
                 font-size: 14px; color: var(--tx-dim); margin-bottom: 10px; }
.field .val { font-size: 20px; font-weight: 700; color: var(--tx); letter-spacing: -.02em; }
.field .val em { font-style: normal; font-size: 13px; color: var(--tx-mut); font-weight: 500; }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px;
  background: var(--line-2); outline: none; margin: 10px 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--acc); cursor: grab; border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--acc);
}
input[type=range]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--acc); cursor: grab;
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--acc);
}
.scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--tx-mut); }

.seg { display: flex; gap: 6px; background: var(--bg-2); padding: 4px;
       border: 1px solid var(--line); border-radius: 12px; }
.seg button {
  flex: 1; padding: 9px 8px; border: 0; border-radius: 9px; background: transparent;
  color: var(--tx-dim); cursor: pointer; font-size: 14px; transition: all .18s;
}
.seg button.on { background: var(--acc); color: #10130A; font-weight: 650; }

.side { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 22px;
        position: sticky; top: 78px; }
.side .row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px;
             border-bottom: 1px solid var(--line); }
.side .row:last-of-type { border-bottom: 0; }
.side .row span { color: var(--tx-mut); }
.side .row b { font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border: 0; border-radius: 12px; background: var(--acc); color: #10130A;
  font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(198,242,78,.22); }
.btn.ghost { background: transparent; color: var(--tx-dim); border: 1px solid var(--line-2); }
.btn.ghost:hover { color: var(--tx); border-color: var(--tx-mut); box-shadow: none; }
.btn.sm { padding: 9px 15px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ── Варианты сборки ── */
.variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.vr { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 24px;
      display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.vr:hover { border-color: var(--line-2); transform: translateY(-2px); }
.vr.pick { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.vr .tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-mut); }
.vr .price { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin: 8px 0 2px; }
.vr .meta { color: var(--tx-mut); font-size: 13px; margin-bottom: 16px; }
.vr ul { list-style: none; margin: 0 0 18px; padding: 0; font-size: 13px; }
.vr ul li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0;
            color: var(--tx-dim); border-bottom: 1px solid var(--line); }
.vr ul li b { color: var(--tx); font-weight: 550; text-align: right; }
.vr .btn { margin-top: auto; }

/* ── Итоговая сборка ── */
.build { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
@media (max-width: 980px) { .build { grid-template-columns: 1fr; } }

.grp { margin-bottom: 26px; }
.grp h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-mut);
          margin: 0 0 8px; font-weight: 600; }
.slot {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 7px; transition: border-color .18s;
}
.slot:hover { border-color: var(--line-2); }
.slot .nm { color: var(--tx-mut); font-size: 13px; width: 150px; flex-shrink: 0; }
.slot .pt { flex: 1; min-width: 0; }
.slot .pt b { font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .pt small { color: var(--tx-mut); }
.slot .pr { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot .pr small { display: block; color: var(--tx-mut); font-size: 12px; }
.slot.empty { border-style: dashed; border-color: rgba(255,90,95,.35); }
.slot.empty .pt b { color: var(--bad); font-weight: 500; }
/* Необязательный незакрытый узел — не ошибка, поэтому приглушён, а не красный. */
.slot.opt { background: transparent; border-style: dashed; }
.slot.opt .nm, .slot.opt .pt b { color: var(--tx-mut); font-weight: 500; }

.sum { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 24px;
       position: sticky; top: 78px; }
.sum .big { font-size: 32px; font-weight: 750; letter-spacing: -.03em; }
.sum .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.sum .row span { color: var(--tx-mut); }

.note { border-radius: 12px; padding: 13px 15px; font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.note.warn { background: rgba(255,197,61,.09); border: 1px solid rgba(255,197,61,.25); color: #FFD97A; }
.note.bad  { background: rgba(255,90,95,.09);  border: 1px solid rgba(255,90,95,.25);  color: #FF9095; }
.note.ok   { background: rgba(198,242,78,.08); border: 1px solid rgba(198,242,78,.22); color: var(--acc); }
.note b { color: inherit; }

/* ── Панель замены детали ── */
.drawer {
  position: fixed; inset: 0; z-index: 60; display: none; background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}
.drawer.on { display: block; }
.drawer .panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto; padding: 26px;
  animation: slide .26s ease both;
}
@keyframes slide { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer h2 { margin-bottom: 4px; }
.drawer .sub { color: var(--tx-mut); font-size: 13px; margin-bottom: 20px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 13px 15px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 7px; transition: border-color .16s, background .16s;
}
.opt:hover { border-color: var(--acc); }
.opt.cur { border-color: var(--acc); background: rgba(198,242,78,.06); }
.opt .t { flex: 1; min-width: 0; }
.opt .t b { font-weight: 550; display: block; }
.opt .t small { color: var(--tx-mut); }
.opt .p { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.2);
        border-top-color: var(--acc); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.foot { border-top: 1px solid var(--line); color: var(--tx-mut); font-size: 13px; padding: 22px 0 40px; }
