/* ============================================================
   ТОКЕНЫ (design tokens) — вся палитра и типографика в одном месте.
   Меняете тут — меняется везде. Это главное правило поддерживаемого CSS.
   ============================================================ */
:root {
  --bg-base:      #0b171b;
  --bg-glow-1:    #123a3f;
  --bg-glow-2:    #1a2a33;

  --glass-fill:   rgba(210, 235, 235, 0.055);
  --glass-fill-hover: rgba(210, 235, 235, 0.09);
  --glass-border: rgba(180, 225, 225, 0.16);

  --accent:       #4dd8c8;   /* бирюзовый — "экран сканера" */
  --accent-soft:  rgba(77, 216, 200, 0.35);
  --amber:        #f2a154;   /* янтарный — "индикатор" */

  --text-main:    #eaf3f3;
  --text-muted:   #8ea6a8;

  --font-display: 'Rajdhani', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
}

/* Фоновое свечение — статичное, без лишней анимации (не перегружаем) */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, var(--bg-glow-1), transparent 60%),
    radial-gradient(ellipse 50% 50% at 90% 100%, var(--bg-glow-2), transparent 60%);
  pointer-events: none;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.topbar__logo { font-size: 20px; }
.topbar__logo .accent { color: var(--accent); }
.topbar__dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent-soft);
  margin-right: 10px;
}
.topbar__status {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ============================================================
   STAGE / заголовок
   ============================================================ */
.stage {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 24px 100px;
  text-align: center;
}
.stage__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  margin: 20px 0 8px;
  letter-spacing: 0.01em;
}
.stage__subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 56px;
}

/* ============================================================
   STEPPER — три "разъёма" + соединяющий кабель
   ============================================================ */
.stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}

/* Кабель — линия между шагами, "загорается" по мере прогресса */
.cable {
  position: absolute;
  top: 46px;
  height: 2px;
  background: var(--glass-border);
  z-index: 0;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
#cable1 { left: calc(16.66% + 10px); width: calc(33.33% - 20px); }
#cable2 { left: calc(50% + 10px);    width: calc(33.33% - 20px); }
.cable--active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-soft);
}

.step {
  position: relative;
  z-index: 1;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 20px;
  text-align: left;
  transition: opacity 0.4s ease, filter 0.4s ease, border-color 0.3s ease;
}
.step--disabled {
  opacity: 0.45;
  filter: grayscale(0.4);
}
.step--done {
  border-color: var(--accent-soft);
}

.step__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-display);
}
.step__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.step__label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Кастомный dropdown — не нативный <select>, чтобы полностью стилизовать */
.dropdown {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
}
.dropdown:disabled { cursor: not-allowed; }
.dropdown:not(:disabled):hover { background: var(--glass-fill-hover); }
.dropdown__chevron { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; }
.dropdown[aria-expanded="true"] .dropdown__chevron { transform: rotate(180deg); }

.dropdown__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(15, 28, 32, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  backdrop-filter: blur(20px);
}
.dropdown__list li {
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
}
.dropdown__list li:hover,
.dropdown__list li:focus {
  background: rgba(77, 216, 200, 0.14);
  color: var(--accent);
  outline: none;
}

/* ============================================================
   RESULT — карточка сборки
   ============================================================ */
.result {
  margin-top: 56px;
  padding: 32px;
  background: var(--glass-fill);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 40px -10px var(--accent-soft);
  animation: rise 0.5s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result__scan {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.result__title {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 18px;
}
.result__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.result__specs span {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.result__reset {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
}
.result__reset:hover { border-color: var(--accent); color: var(--accent); }

/* Доступность: видимый фокус клавиатуры */
button:focus-visible, li:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Уважение к reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .result { animation: none; }
}

/* Мобильная адаптация */
@media (max-width: 720px) {
  .stepper { grid-template-columns: 1fr; }
  .cable { display: none; }
  .topbar { padding: 18px 20px; }
}
