/* RFQ — продакшен-конвейер заявки */
.rfq-section,
.rfq-result-section {
  position: relative;
  overflow: hidden;
}

.rfq-aurora {
  pointer-events: none;
  position: absolute;
  inset: -28% -18% -10%;
  overflow: hidden;
  z-index: 0;
}

.rfq-section > .shell,
.rfq-result-section > .shell {
  position: relative;
  z-index: 1;
}

.rfq-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  will-change: transform;
  background: radial-gradient(circle at 40% 40%, rgba(20, 184, 102, 0.42), rgba(15, 138, 75, 0.12) 46%, transparent 70%);
}

.rfq-blob-a {
  width: min(560px, 72vw);
  height: min(560px, 72vw);
  top: -8%;
  left: -6%;
  animation: rfqBlobA 22s ease-in-out infinite;
}

.rfq-blob-b {
  width: min(420px, 58vw);
  height: min(420px, 58vw);
  top: 4%;
  right: -8%;
  opacity: 0.85;
  background: radial-gradient(circle at 55% 45%, rgba(10, 92, 50, 0.28), rgba(20, 184, 102, 0.1) 50%, transparent 72%);
  animation: rfqBlobB 28s ease-in-out infinite;
}

.rfq-aurora.is-tracked .rfq-blob {
  animation: none;
}

@keyframes rfqBlobA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40% { transform: translate3d(12%, 10%, 0) scale(1.08); }
  70% { transform: translate3d(4%, 18%, 0) scale(0.96); }
}

@keyframes rfqBlobB {
  0%, 100% { transform: translate3d(0, 8%, 0) scale(1); }
  35% { transform: translate3d(-14%, 0, 0) scale(1.1); }
  65% { transform: translate3d(-6%, 14%, 0) scale(0.94); }
}

.rfq-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1.1rem;
  margin-bottom: 1.1rem;
}

.rfq-kicker {
  margin: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rfq-kicker-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.rfq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 1.35rem;
  align-items: stretch;
}

.rfq-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.65rem 1.7rem 1.8rem;
  backdrop-filter: blur(16px);
}

.rfq-panel h2 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.15;
  color: var(--green-deep);
}

.rfq-panel .section-intro {
  margin: 0 0 1.15rem;
}

.rfq-drop {
  position: relative;
  overflow: hidden;
  border: 1.5px dashed rgba(15, 138, 75, 0.38);
  background: linear-gradient(165deg, #f4fcf8 0%, #e7f6ee 100%);
  border-radius: 16px;
  padding: 1.85rem 1.1rem 1.5rem;
  text-align: center;
  cursor: pointer;
  color: var(--green);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.rfq-drop-orb {
  position: absolute;
  width: 160px;
  height: 160px;
  left: 50%;
  top: -40px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(20, 184, 102, 0.28), transparent 68%);
  animation: rfqOrb 4.5s ease-in-out infinite;
}

@keyframes rfqOrb {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.18); }
}

.rfq-drop:hover,
.rfq-drop:focus-visible,
.rfq-drop.is-drag {
  border-color: var(--green);
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(10, 92, 50, 0.12);
}

.rfq-drop.is-filled {
  border-style: solid;
  background: #fff;
}

.rfq-drop-icon {
  position: relative;
  display: inline-flex;
  margin-bottom: 0.4rem;
}

.rfq-drop-title {
  position: relative;
  margin: 0;
  font-weight: 700;
  color: var(--green-deep);
  font-size: 1.02rem;
}

.rfq-drop-hint {
  position: relative;
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.rfq-filename {
  position: relative;
  margin: 0.65rem 0 0;
  font-size: 0.92rem;
  color: var(--green-deep);
  font-weight: 650;
  word-break: break-all;
}

.rfq-clear-file {
  position: relative;
  margin-top: 0.4rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.rfq-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.95rem 0;
}

.rfq-mode {
  min-width: 3.3rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-deep);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.rfq-mode.is-active,
.rfq-mode:hover {
  border-color: transparent;
  background: var(--green);
  color: #fff;
}

.rfq-text {
  width: 100%;
  resize: vertical;
  min-height: 7.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.rfq-text:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-glow);
}

.rfq-status {
  min-height: 1.25rem;
  margin: 0.7rem 0 0.85rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.rfq-status.is-error {
  color: #b42318;
}

.rfq-submit {
  width: 100%;
  justify-content: center;
  min-height: 3.05rem;
  font-size: 1.02rem;
}

.rfq-rail {
  list-style: none;
  margin: 0.2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rfq-rail li {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 0.85rem;
  padding: 0 0 1.15rem 0;
}

.rfq-rail li:last-child {
  padding-bottom: 0;
}

.rfq-rail li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--green), rgba(15, 138, 75, 0.08));
}

.rfq-rail-dot {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--green);
  background: #fff;
  box-shadow: 0 0 0 6px rgba(15, 138, 75, 0.1);
}

.rfq-rail strong {
  color: var(--green-deep);
  font-size: 0.98rem;
}

.rfq-rail li span:last-child {
  grid-column: 2;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.rfq-after {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

/* Engine overlay */
.rfq-engine {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(6, 28, 18, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
}

.rfq-engine[hidden] {
  display: none;
}

.rfq-engine-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rfq-engine-core {
  position: relative;
  width: min(520px, calc(100% - 2rem));
  text-align: center;
  color: #e8f6ee;
}

.rfq-engine-kicker {
  margin: 0 0 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(232, 246, 238, 0.7);
}

.rfq-engine-orbit {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 1.1rem;
}

.rfq-engine-pulse {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 102, 0.45), transparent 70%);
  animation: rfqPulse 1.8s ease-in-out infinite;
}

@keyframes rfqPulse {
  0%, 100% { transform: scale(0.86); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}

.rfq-engine-ring {
  width: 168px;
  height: 168px;
  transform: rotate(-90deg);
}

.rfq-engine-ring circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 6;
}

.rfq-engine-ring-val {
  stroke: #14b866 !important;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 0.6s var(--ease);
  filter: drop-shadow(0 0 8px rgba(20, 184, 102, 0.65));
}

.rfq-engine-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.7rem;
  color: #fff;
}

.rfq-engine-title {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: #fff;
}

.rfq-engine-log {
  min-height: 1.5rem;
  margin: 0 0 1.35rem;
  color: rgba(232, 246, 238, 0.82);
}

.rfq-engine-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
}

.rfq-engine-stages li {
  flex: 1;
  padding: 0.45rem 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.55);
}

.rfq-engine-stages li.is-on {
  background: #14b866;
  color: #062013;
  box-shadow: 0 0 24px rgba(20, 184, 102, 0.45);
}

.rfq-engine-stages li.is-done {
  background: rgba(20, 184, 102, 0.28);
  color: #e8f6ee;
}

.rfq-engine.is-done .rfq-engine-pulse {
  animation: none;
  background: radial-gradient(circle, rgba(20, 184, 102, 0.7), transparent 70%);
}

/* Result */
.rfq-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.4rem;
}

.rfq-hero h1 {
  margin: 0.2rem 0 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--green-deep);
}

.rfq-hero-stats {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.rfq-donut {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}

.rfq-donut svg {
  width: 108px;
  height: 108px;
  transform: rotate(-90deg);
}

.rfq-donut circle {
  fill: none;
  stroke: var(--bg-mint);
  stroke-width: 10;
}

.rfq-donut-val {
  stroke: var(--green) !important;
  stroke-linecap: round;
  animation: rfqDonut 1.1s var(--ease) both;
}

@keyframes rfqDonut {
  from { stroke-dasharray: 0 264; }
}

.rfq-donut strong,
.rfq-donut span {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
}

.rfq-donut strong {
  top: 30px;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--green-deep);
}

.rfq-donut span {
  top: 56px;
  font-size: 0.7rem;
  color: var(--muted);
}

.rfq-stat-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
  flex: 1;
}

.rfq-stat-grid dt {
  font-size: 0.75rem;
  color: var(--muted);
}

.rfq-stat-grid dd {
  margin: 0;
  font-weight: 800;
  color: var(--green-deep);
  font-size: 1.05rem;
}

.rfq-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.rfq-model-panel {
  margin: 0 0 1.1rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.rfq-model-panel-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green, #0f8a4b);
}

.rfq-model-panel-lead {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted, #5b6b66);
}

.rfq-model-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.rfq-model-label {
  display: block;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
}

.rfq-model-select {
  flex: 1 1 16rem;
  min-width: 12rem;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}

.rfq-model-runs {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted, #5b6b66);
}

.rfq-model-runs li {
  margin: 0.2rem 0;
}

.rfq-result-section.is-rematching {
  pointer-events: none;
  opacity: 0.72;
}

.rfq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.rfq-filters button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--green-deep);
  cursor: pointer;
}

.rfq-filters button.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.rfq-match-list {
  list-style: none;
  margin: 0 0 5.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rfq-match-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1.2fr);
  gap: 0.7rem;
  align-items: start;
  padding: 1.05rem 1.15rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  animation: rfqCardIn 0.55s var(--ease) both;
  animation-delay: var(--d, 0ms);
}

@keyframes rfqCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.rfq-match-card.is-miss {
  background: #fbfbfb;
}

.rfq-match-card.is-hidden-filter {
  display: none;
}

.rfq-match-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.rfq-match-need strong {
  display: block;
  color: var(--ink);
}

.rfq-match-flow {
  display: grid;
  place-items: center;
  padding-top: 1.4rem;
}

.rfq-match-flow span {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  position: relative;
}

.rfq-match-flow span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
  animation: rfqFlow 1.6s var(--ease) infinite;
}

@keyframes rfqFlow {
  0% { left: 0; opacity: 0; }
  20% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.rfq-match-card.is-miss .rfq-match-flow span {
  background: linear-gradient(90deg, transparent, #c4c9c6, transparent);
}

.rfq-match-card.is-miss .rfq-match-flow span::after {
  background: #9aa39e;
  animation: none;
  left: 50%;
}

.rfq-match-product {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.rfq-match-product img,
.rfq-match-ph {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-mint);
}

.rfq-match-got .btn-sm {
  margin-top: 0.65rem;
}

.rfq-conf {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
}

.rfq-alts {
  margin-top: 0.55rem;
  font-size: 0.9rem;
}

.rfq-alts ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.rfq-result-empty {
  max-width: 38rem;
  padding: 2.4rem 0 3rem;
}

.rfq-dock {
  position: sticky;
  bottom: 1rem;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  background: rgba(10, 92, 50, 0.94);
  color: #e8f6ee;
  box-shadow: 0 18px 40px rgba(10, 92, 50, 0.28);
}

.rfq-dock strong {
  font-size: 1.15rem;
}

.rfq-dock-sum {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
}

.rfq-dock .btn {
  background: #fff;
  color: var(--green-deep);
}

.rfq-debug {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.rfq-debug-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.rfq-debug-text {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

.rfq-debug-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

@media (max-width: 960px) {
  .rfq-layout,
  .rfq-hero {
    grid-template-columns: 1fr;
  }

  .rfq-match-card {
    grid-template-columns: 1fr;
  }

  .rfq-match-flow {
    display: none;
  }

  .rfq-engine-stages {
    flex-wrap: wrap;
  }

  .rfq-hero-stats {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rfq-blob,
  .rfq-drop-orb,
  .rfq-engine-pulse,
  .rfq-match-flow span::after,
  .rfq-donut-val,
  .rfq-match-card {
    animation: none !important;
  }

  .rfq-match-card {
    opacity: 1;
    transform: none;
  }
}
