.lead-flow-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.lead-flow-modal.is-open {
  display: block;
}

.lead-flow-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 24, 38, 0.42);
  backdrop-filter: blur(10px);
}

.lead-flow-modal__dialog {
  position: relative;
  display: grid;
  width: min(100% - 28px, 760px);
  max-height: min(820px, calc(100vh - 28px));
  margin: 14px auto;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 235, 0.95);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96)),
    linear-gradient(135deg, rgba(45, 119, 172, 0.1), rgba(59, 183, 166, 0.08));
  box-shadow: 0 32px 74px rgba(18, 43, 72, 0.22);
}

.lead-flow-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(231, 238, 248, 0.92);
  color: var(--primary);
  font-size: 1.35rem;
  line-height: 1;
}

.lead-flow {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 4vw, 38px);
  overflow-y: auto;
}

.lead-flow__top {
  display: grid;
  gap: 10px;
  padding-right: 52px;
}

.lead-flow__kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.lead-flow__title {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.7rem, 5vw, 2.55rem);
  line-height: 1.22;
}

.lead-flow__copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.lead-flow__progress {
  display: grid;
  gap: 8px;
}

.lead-flow__progress-text {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.lead-flow__progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(216, 224, 235, 0.78);
}

.lead-flow__progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ui-gradient-primary);
  transition: width var(--ui-motion-duration) var(--ui-motion-ease);
}

.lead-flow__card {
  display: grid;
  gap: 18px;
  min-height: 320px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(216, 224, 235, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(24, 59, 99, 0.08);
}

.lead-flow__question {
  display: grid;
  gap: 8px;
}

.lead-flow__question h3 {
  margin: 0;
  font-size: clamp(1.28rem, 4vw, 1.82rem);
  line-height: 1.35;
}

.lead-flow__question p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.lead-flow__fields {
  display: grid;
  gap: 14px;
}

.lead-flow__fields--grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-flow__field {
  display: grid;
  gap: 7px;
}

.lead-flow__field span {
  color: #213955;
  font-weight: 800;
}

.lead-flow__field input,
.lead-flow__field select,
.lead-flow__field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(198, 211, 226, 0.96);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.lead-flow__field textarea {
  min-height: 110px;
  padding-block: 13px;
  resize: vertical;
}

.lead-flow__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lead-flow__option {
  display: flex;
  align-items: center;
  min-height: 54px;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(198, 211, 226, 0.96);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: #203752;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform var(--ui-motion-duration-fast) var(--ui-motion-ease),
    border-color var(--ui-motion-duration) var(--ui-motion-ease),
    background var(--ui-motion-duration) var(--ui-motion-ease),
    box-shadow var(--ui-motion-duration) var(--ui-motion-ease);
}

.lead-flow__option:has(input:checked) {
  border-color: var(--ui-border-hover);
  background: rgba(231, 241, 252, 0.96);
  box-shadow: 0 10px 24px rgba(24, 59, 99, 0.09);
}

.lead-flow__option input {
  accent-color: var(--accent);
}

.lead-flow__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.lead-flow__status {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.lead-flow-success {
  display: grid;
  gap: 18px;
}

.lead-flow-success__qr {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(216, 224, 235, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
}

.lead-flow-success__qr img {
  width: 144px;
  height: 144px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(216, 224, 235, 0.95);
}

.lead-flow-success__qr strong {
  color: var(--primary);
}

@media (max-width: 680px) {
  .lead-flow-modal__dialog {
    width: min(100% - 16px, 480px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    border-radius: 24px;
  }

  .lead-flow {
    padding: 20px 16px;
  }

  .lead-flow__top {
    padding-right: 46px;
  }

  .lead-flow__card {
    min-height: 360px;
    padding: 18px;
  }

  .lead-flow__fields--grid,
  .lead-flow__options,
  .lead-flow-success__qr {
    grid-template-columns: 1fr;
  }

  .lead-flow__actions {
    display: grid;
  }

  .lead-flow__actions .button {
    width: 100%;
  }
}
