/* ==========================================================================
   Запрос условий: светлая панель с «витриной» внутри. Витрина — тёмная мини-полка,
   на которой выбираются позиции; панель слегка окрашивается в цвет выбранного.
   ========================================================================== */
@property --pick { syntax: '<color>'; inherits: true; initial-value: #c8202f; }
@property --pick-amt { syntax: '<number>'; inherits: true; initial-value: 0; }

.st-sec.st-contact {
  background: color-mix(in srgb, var(--pick) calc(var(--pick-amt) * 1%), var(--st-stage));
  transition: --pick .9s var(--st-ease), --pick-amt .9s var(--st-ease);
}
.rq-head { margin-bottom: 56px; }
.rq-head .st-h2 { max-width: 18ch; }

.rq-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: start; }

/* ---------- Витрина ---------- */
.rq-cabinet {
  position: relative; overflow: hidden; border-radius: 24px; padding: 30px 28px 26px;
  background: color-mix(in srgb, var(--pick) calc(var(--pick-amt) * 1.1%), var(--st-bay));
  color: var(--st-bay-ink);
  box-shadow: 0 34px 60px -34px rgba(20, 20, 20, .5);
  transition: --pick .9s var(--st-ease), --pick-amt .9s var(--st-ease);
}
/* тёплый конус света из верхней кромки витрины */
.rq-cabinet::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(55% 46% at 50% 0%, rgba(255, 246, 226, .16), transparent 72%);
}
.rq-cab-h { margin: 0; font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.rq-cab-p { margin: 6px 0 20px; color: var(--st-bay-ink-2); font-size: 15px; }

.rq-shelf { position: relative; }
.rq-shelf + .rq-shelf { margin-top: 26px; }
.rq-row { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); align-items: end; height: 118px; padding: 0 4px 8px; }
.rq-ledge {
  position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); align-items: center; height: 26px; padding: 0 4px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
  border-top: 1px solid rgba(255, 246, 226, .5);
  box-shadow: 0 -16px 34px -22px var(--st-light), 0 10px 24px rgba(0, 0, 0, .4);
}
/* столешница перед кромкой: предметы стоят на ней */
.rq-ledge::before {
  content: ''; position: absolute; left: 0; right: 0; top: -20px; height: 20px; pointer-events: none;
  background: linear-gradient(to top, rgba(255, 246, 226, .16), rgba(255, 246, 226, 0));
  clip-path: polygon(2.2% 0, 97.8% 0, 100% 100%, 0 100%);
}
.rq-tag { text-align: center; font-size: 10px; letter-spacing: .08em; color: var(--st-bay-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .25s; }
.rq-tag.is-on { color: var(--st-bay-ink); font-weight: 600; }

.rq-item {
  position: relative; z-index: 1; display: grid; place-items: end center; padding: 0; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit; -webkit-tap-highlight-color: transparent;
  transition: transform .45s var(--st-ease), filter .35s;
}
.rq-item img { width: 100%; max-height: 100px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); pointer-events: none; }
/* у рендеров COO много пустого поля вокруг пачки */
.rq-item.is-wide img { width: 146%; max-width: none; max-height: none; }
.rq-item.is-tall img { width: auto; height: 100px; max-width: 100%; }
.rq-item:hover { transform: translateY(-5px); }
.rq-item[aria-pressed="true"] { transform: translateY(-12px) scale(1.07); }
.rq-item:focus-visible { outline: 2px solid var(--st-light); outline-offset: 4px; border-radius: 10px; }
/* отметка выбора: круг с галочкой, виден и без наведения (на телефоне) */
.rq-item::after {
  content: ''; position: absolute; top: 0; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--st-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8' fill='none' stroke='%23141414' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35); opacity: 0; transform: scale(.4); transition: opacity .25s, transform .4s var(--st-ease);
}
.rq-item[aria-pressed="true"]::after { opacity: 1; transform: none; }
/* выбранная позиция «зажигает» пятно света на столешнице под собой */
.rq-item[aria-pressed="true"] img { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)) drop-shadow(0 0 14px rgba(255, 246, 226, .3)); }

/* ---------- Форма ---------- */
.rq-formwrap { min-width: 0; }
.rq-form { gap: 18px; }
.rq-chosen { padding: 4px 0 6px; }
.rq-chosen-h { margin: 0 0 12px; font-size: 17px; font-weight: 500; color: var(--st-ink); text-align: left; }
.rq-count { color: var(--st-ink-2); font-variant-numeric: tabular-nums; font-weight: 400; }
.rq-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rq-chips:empty { display: none; }
.rq-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 6px 7px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--st-line); font-size: 14px; color: var(--st-ink);
  animation: rq-pop .45s var(--st-ease) backwards;
}
.rq-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.rq-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--st-ink-2); font-size: 18px; line-height: 1; cursor: pointer; transition: background .2s, color .2s; }
.rq-chip button:hover { background: rgba(20, 20, 20, .08); color: var(--st-ink); }
.rq-chip button:focus-visible { outline: 2px solid var(--st-ink); outline-offset: 1px; }
.rq-empty { margin: 0; color: var(--st-ink-2); font-size: 15px; line-height: 1.5; }
@keyframes rq-pop { from { opacity: 0; transform: translateY(6px) scale(.92); } }

.rq-err { display: block; min-height: 0; margin: 0; color: #b3261e; font-size: 13px; line-height: 1.4; }
.rq-err:empty { display: none; }
.st-form [aria-invalid="true"] { border-color: #b3261e !important; }

/* переключатель «Нужны образцы» */
.rq-switch { display: flex !important; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--st-line); border-radius: 14px; background: #fff; cursor: pointer; color: var(--st-ink) !important; transition: border-color .2s; }
.rq-switch:hover { border-color: #b9b9b4; }
.rq-switch input { position: absolute; opacity: 0; pointer-events: none; }
.rq-switch-ui { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: #d9d8d3; transition: background .3s var(--st-ease); }
.rq-switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .35s var(--st-ease); }
.rq-switch input:checked + .rq-switch-ui { background: var(--st-ink); }
.rq-switch input:checked + .rq-switch-ui::after { transform: translateX(18px); }
.rq-switch input:focus-visible + .rq-switch-ui { outline: 2px solid var(--st-ink); outline-offset: 3px; }
.rq-switch-text { display: grid; gap: 2px; }
.rq-switch-text b { font-weight: 500; font-size: 16px; }
.rq-switch-text small { color: var(--st-ink-2); font-size: 13px; line-height: 1.4; }

.rq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rq-submit { width: 100%; text-align: center; padding: 16px 28px; }
.rq-submit:disabled { opacity: .6; cursor: progress; }
.rq-fail { padding: 14px 16px; border-radius: 12px; background: #fdecea; color: #7a1d17; font-size: 14px; line-height: 1.6; }
.rq-fail a { color: inherit; text-underline-offset: 3px; }

/* ---------- Подтверждение ---------- */
.rq-done { padding: 34px 28px 30px; border-radius: 24px; background: var(--st-bay); color: var(--st-bay-ink); text-align: center; outline: none; }
.rq-done-mark { width: 56px; height: 56px; margin: 0 auto 14px; display: block; fill: none; stroke: var(--st-light); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rq-done-mark circle { stroke-opacity: .35; }
.rq-done-h { margin: 0 0 6px; font-weight: 500; font-size: 26px; letter-spacing: -.02em; }
.rq-done-p { margin: 0 auto 22px; max-width: 34ch; color: var(--st-bay-ink-2); font-size: 16px; line-height: 1.5; }
/* выбранные позиции сгруппированы по полкам: COO, Sentic, устройства */
.rq-done-shelf { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 22px 28px; margin: 0 auto 26px; max-width: 100%; }
.rq-group { display: grid; justify-items: center; min-width: 0; }
.rq-cluster { display: flex; align-items: flex-end; padding: 0 6px 6px; }
.rq-cluster img { position: relative; height: 70px; width: auto; max-width: none; margin-left: -22px; object-fit: contain; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .45)); }
.rq-cluster img:first-child { margin-left: 0; }
.rq-group-coo .rq-cluster img { height: 82px; margin-left: -30px; }
.rq-group-dev .rq-cluster img { height: 80px; margin-left: -8px; }
.rq-more { align-self: center; margin-left: 8px; padding: 4px 9px; border-radius: 999px; background: rgba(255, 246, 226, .14); color: var(--st-bay-ink); font-size: 13px; font-weight: 500; }
.rq-group-ledge {
  display: flex; justify-content: center; align-items: baseline; gap: 8px; width: 100%; padding: 7px 14px 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--st-bay-ink-2);
  background: linear-gradient(to bottom, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
  border-top: 1px solid rgba(255, 246, 226, .5);
  box-shadow: 0 -14px 28px -18px var(--st-light), 0 8px 18px rgba(0, 0, 0, .4);
}
.rq-n { color: var(--st-bay-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.rq-again { color: var(--st-ink); }
@media (prefers-reduced-motion: no-preference) {
  .rq-done.is-in .rq-done-mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: rq-draw .8s var(--st-ease) .1s forwards; }
  .rq-done.is-in .rq-done-mark path { stroke-dasharray: 44; stroke-dashoffset: 44; animation: rq-draw .6s var(--st-ease) .55s forwards; }
  .rq-done.is-in .rq-done-h, .rq-done.is-in .rq-done-p, .rq-done.is-in .rq-again { animation: st-rise .7s var(--st-ease) backwards; }
  .rq-done.is-in .rq-done-h { animation-delay: .5s; }
  .rq-done.is-in .rq-done-p { animation-delay: .62s; }
  .rq-done.is-in .rq-cluster img { animation: st-land .9s var(--st-ease) calc(.75s + var(--k, 0) * 90ms) backwards; }
  .rq-done.is-in .rq-again { animation-delay: .95s; }
}
@keyframes rq-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .rq-item, .rq-item::after, .rq-switch-ui, .rq-switch-ui::after, .st-sec.st-contact, .rq-cabinet { transition: none; }
  .rq-chip { animation: none; }
}

/* ---------- Быстрые каналы ---------- */
.rq-channels { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--st-line); }
.rq-chan-h { margin: 0 0 16px; color: var(--st-ink-2); font-size: 15px; }
.rq-chan-row { display: flex; flex-wrap: wrap; gap: 12px; }
.rq-chan {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px 12px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--st-line); color: var(--st-ink); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: border-color .2s, transform .35s var(--st-ease);
}
.rq-chan:hover { border-color: var(--st-ink); transform: translateY(-2px); }
.rq-chan:focus-visible { outline: 2px solid var(--st-ink); outline-offset: 3px; }
.rq-chan svg { width: 22px; height: 22px; flex: none; }
.rq-chan span { display: grid; line-height: 1.25; }
.rq-chan small { color: var(--st-ink-2); font-weight: 400; font-size: 13px; }

@media (max-width: 1100px) {
  .rq-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 760px) {
  .rq-head { margin-bottom: 36px; }
  .rq-cabinet { padding: 22px 16px 18px; border-radius: 20px; }
  /* на узком экране полки прокручиваются вбок вместе с кромкой */
  .rq-shelf { overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
  .rq-shelf::-webkit-scrollbar { display: none; }
  .rq-row, .rq-ledge { width: max-content; min-width: 100%; grid-template-columns: repeat(var(--n), 76px); }
  .rq-row { height: 112px; }
  .rq-channels { margin-top: 48px; }
  .rq-chan { flex: 1 1 100%; }
  .rq-done { padding: 28px 18px 24px; }
}

/* атрибут hidden должен побеждать display из общих стилей формы */
.rq-form[hidden], .rq-done[hidden], .rq-fail[hidden], .rq-done-shelf[hidden], .rq-empty[hidden] { display: none !important; }
