/* ============================================================
   Пошаговая форма регистрации (progressive disclosure) — Dark Luxury
   ============================================================ */

.reg-wrap {
  max-width: 640px;
  margin-inline: auto;
}

.reg {
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(216, 169, 73, 0.14), rgba(244, 231, 200, 0.03));
  border: 1px solid var(--line-dark);
  padding: 0.55rem;
  box-shadow: var(--shadow-soft);
}
.reg__inner {
  border-radius: calc(var(--radius-xl) - 0.45rem);
  background: var(--surface);
  padding: clamp(1.5rem, 3.5vw, 2.6rem);
  box-shadow: inset 0 1px 1px rgba(244, 231, 200, 0.06);
}

.reg__progress {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.8rem;
}
.reg__progress .bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 231, 200, 0.1);
  overflow: hidden;
}
.reg__progress .bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: inherit;
  transition: width 0.6s var(--ease-out);
}
.reg__progress .pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
}

/* ── Шаг ── */
.step {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(8px);
  transition: grid-template-rows 0.55s var(--ease-out), opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
}
.step.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: none;
}
.step__clip { overflow: hidden; min-height: 0; }
.step__pad { padding-block: 0.9rem; }
.step:not(:last-child).is-open .step__pad {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}

.step__label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.95rem;
}
.step__num {
  flex: none;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
}
.step__hint { color: var(--muted); font-size: 0.9rem; margin: -0.4rem 0 0.9rem; }

/* ── Поля ── */
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
@media (max-width: 520px) { .fields-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field > label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }

.input {
  width: 100%;
  font: inherit;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-dark);
  background: var(--bg-2);
  color: var(--cream);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
}
.input::placeholder { color: var(--faint); }
.input:focus {
  outline: none;
  border-color: var(--gold-line);
  box-shadow: 0 0 0 4px var(--gold-soft);
  background: var(--surface-2);
}
.input:user-invalid { border-color: #d2674f; }
.input:user-valid { border-color: rgba(120, 170, 90, 0.6); }

.err { display: none; color: #e08a76; font-size: 0.82rem; }
.input:user-invalid ~ .err { display: block; }

/* ── Combobox компании (список В ПОТОКЕ — не обрезается) ── */
.combo { position: relative; }
.combo__list {
  margin-top: 0.5rem;
  max-height: 15rem;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-line) transparent;
}
.combo__list::-webkit-scrollbar { width: 8px; }
.combo__list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.combo.is-open .combo__list { display: block; }
.combo__opt {
  padding: 0.6rem 0.7rem;
  border-radius: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--cream);
  transition: background 0.15s var(--ease-out);
}
.combo__opt:hover, .combo__opt.is-active { background: var(--gold-soft); }
.combo__opt mark { background: transparent; color: var(--gold); font-weight: 700; }
.combo__empty { padding: 0.7rem; color: var(--muted); font-size: 0.9rem; }

/* ── Чипы (radio / checkbox) ── */
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  background: var(--bg-2);
  color: var(--cream);
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.45s var(--ease-spring), border-color 0.3s var(--ease-out),
    background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}
.chip span::before {
  content: "";
  width: 0.65rem; height: 0.65rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: all 0.3s var(--ease-out);
}
.chip input:checked + span {
  background: var(--gold);
  color: #1a1407;
  border-color: var(--gold);
  font-weight: 600;
}
.chip input:checked + span::before {
  background: #1a1407;
  border-color: #1a1407;
}
.chip span:hover { transform: translateY(-1px); border-color: var(--gold-line); }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--gold-soft); }

/* ── Поле «Другое» (раскрытие) ── */
.subfield {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.45s var(--ease-out), opacity 0.45s var(--ease-out);
  margin-top: 0.2rem;
}
.subfield.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0.7rem; }
.subfield > div { overflow: hidden; min-height: 0; }

/* ── Финал / submit ── */
.reg__submit { margin-top: 1.4rem; }
.reg__note {
  margin-top: 0.9rem;
  font-size: 0.83rem;
  color: var(--faint);
  text-align: center;
}

/* ── Страница успеха (registered) ── */
.done {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 50% -10%, #181610, var(--bg) 55%, #050403);
  color: var(--cream);
  padding: 1.5rem;
}
.done__card {
  max-width: 560px;
  width: 100%;
  text-align: center;
  padding: 0.55rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(216, 169, 73, 0.16), rgba(244, 231, 200, 0.03));
  border: 1px solid var(--line-dark);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.85);
}
.done__inner {
  border-radius: calc(var(--radius-xl) - 0.45rem);
  background: var(--surface);
  padding: clamp(2rem, 5vw, 3.2rem);
  box-shadow: inset 0 1px 1px rgba(244, 231, 200, 0.07);
}
.done__check {
  width: 4rem; height: 4rem; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto 1.3rem;
  background: var(--gold-soft); color: var(--gold);
  font-size: 1.8rem;
}
.done h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.done p { color: var(--muted); margin: 1rem auto 1.8rem; max-width: 42ch; }
.done .summary {
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 1.8rem;
  font-size: 0.92rem;
}
.done .summary div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; }
.done .summary div span:first-child { color: var(--faint); }
.done .steps-mini { font-size: 0.82rem; color: var(--faint); margin-top: 1.2rem; }
