:root {
  --funnel-ink: #0f172a;
  --funnel-muted: #64748b;
  --funnel-line: #e2e8f0;
  --funnel-soft: #f8fafc;
  --funnel-violet: #4f46e5;
  --funnel-violet-soft: #eef2ff;
  --funnel-green: #16a34a;
  --funnel-green-soft: #f0fdf4;
  --funnel-amber: #d97706;
  --funnel-amber-soft: #fffbeb;
  --funnel-red: #dc2626;
  --funnel-red-soft: #fef2f2;
}

.funnel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 16px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(79, 70, 229, 0.18), transparent 38%),
    rgba(15, 23, 42, 0.74);
  backdrop-filter: blur(10px);
}

.funnel-overlay.active {
  display: flex;
}

.funnel-modal {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.97), #ffffff 14%, #ffffff 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.26);
}

.funnel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--funnel-line);
}

.funnel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--funnel-ink);
}

.funnel-brand small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--funnel-muted);
}

.funnel-close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--funnel-line);
  border-radius: 999px;
  background: #fff;
  color: var(--funnel-muted);
  cursor: pointer;
  font-size: 18px;
}

.funnel-close:hover {
  color: var(--funnel-ink);
  border-color: #cbd5e1;
}

.funnel-progress {
  padding: 22px 28px 0;
}

.funnel-progress__copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.funnel-progress__step {
  font-size: 14px;
  font-weight: 700;
  color: var(--funnel-ink);
}

.funnel-progress__precision {
  font-size: 13px;
  font-weight: 700;
  color: var(--funnel-violet);
}

.funnel-progress__track {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.funnel-progress__fill {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed 55%, #16a34a 100%);
  transition: width 0.25s ease;
}

.funnel-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.funnel-rail__item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--funnel-line);
  border-radius: 16px;
  background: #fff;
  color: var(--funnel-muted);
}

.funnel-rail__item.is-active,
.funnel-rail__item.is-complete {
  border-color: rgba(79, 70, 229, 0.28);
  background: linear-gradient(180deg, #ffffff, #f8faff);
}

.funnel-rail__item.is-active {
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.1);
}

.funnel-rail__badge {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--funnel-soft);
  color: var(--funnel-muted);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.funnel-rail__item.is-active .funnel-rail__badge,
.funnel-rail__item.is-complete .funnel-rail__badge {
  background: var(--funnel-violet);
  color: #fff;
}

.funnel-rail__text {
  min-width: 0;
}

.funnel-rail__kicker {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.funnel-rail__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--funnel-ink);
}

.funnel-error-fallback {
  display: none;
  padding: 42px 32px;
  text-align: center;
}

.funnel-body {
  padding: 26px 28px;
}

.funnel-step {
  display: none;
}

.funnel-step.active {
  display: block;
}

.funnel-step__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--funnel-violet-soft);
  color: var(--funnel-violet);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-question {
  margin: 14px 0 8px;
  color: var(--funnel-ink);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.funnel-subtitle {
  max-width: 760px;
  color: var(--funnel-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

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

.funnel-field {
  min-width: 0;
}

.funnel-field--full {
  grid-column: 1 / -1;
}

.funnel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--funnel-ink);
}

.funnel-helper {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.funnel-input,
.funnel-select,
.funnel-file {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--funnel-line);
  border-radius: 16px;
  background: #fff;
  color: var(--funnel-ink);
  font: inherit;
  padding: 14px 16px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.funnel-input:focus,
.funnel-select:focus,
.funnel-file:focus {
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.funnel-input.is-disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.funnel-input-group {
  position: relative;
}

.funnel-input-group__suffix {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.funnel-input-group .funnel-input {
  padding-right: 52px;
}

.funnel-date-row,
.funnel-choice-grid,
.funnel-choice-grid--compact {
  display: grid;
  gap: 12px;
}

.funnel-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.funnel-choice-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.funnel-choice {
  position: relative;
  display: block;
  cursor: pointer;
}

.funnel-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.funnel-choice__card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--funnel-line);
  border-radius: 18px;
  background: #fff;
  color: var(--funnel-ink);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.funnel-choice:hover .funnel-choice__card {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.28);
}

.funnel-choice input:checked + .funnel-choice__card {
  border-color: rgba(79, 70, 229, 0.44);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.1);
  background: linear-gradient(180deg, #ffffff, #f7f5ff);
}

.funnel-choice__dot {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  position: relative;
}

.funnel-choice input:checked + .funnel-choice__card .funnel-choice__dot {
  border-color: var(--funnel-violet);
  background: var(--funnel-violet);
}

.funnel-choice input:checked + .funnel-choice__card .funnel-choice__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: #fff;
}

.funnel-choice__copy strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.funnel-choice__copy span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--funnel-muted);
}

.funnel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--funnel-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.funnel-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.funnel-toggle__pill {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  position: relative;
  transition: background 0.15s ease;
}

.funnel-toggle__pill::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}

.funnel-toggle input:checked + .funnel-toggle__pill {
  background: #cbd5e1;
}

.funnel-toggle input:checked + .funnel-toggle__pill::after {
  transform: translateX(18px);
}

.funnel-stack {
  display: grid;
  gap: 14px;
}

.funnel-note-card,
.funnel-salary-card,
.funnel-preview,
.funnel-offer-card {
  border-radius: 22px;
  border: 1px solid var(--funnel-line);
  background: #fff;
  padding: 18px 20px;
}

.funnel-note-card {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.funnel-note-card--success {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff, #f0fdf4);
}

.funnel-note-card--warning {
  border-color: #fde68a;
  background: linear-gradient(180deg, #ffffff, #fffbeb);
}

.funnel-note-card--danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #ffffff, #fef2f2);
}

.funnel-note-card__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #475569;
}

.funnel-note-card__body {
  color: var(--funnel-ink);
  font-size: 14px;
  line-height: 1.6;
}

.funnel-note-card__body strong {
  color: var(--funnel-ink);
}

.funnel-note-card__meta {
  margin-top: 8px;
  color: var(--funnel-muted);
  font-size: 12px;
}

.funnel-autocomplete {
  position: relative;
}

.funnel-autocomplete__list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--funnel-line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
  max-height: 260px;
  overflow: auto;
}

.funnel-autocomplete__item {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

.funnel-autocomplete__item:hover {
  background: #f8fafc;
}

.funnel-autocomplete__item strong {
  display: block;
  font-size: 14px;
  color: var(--funnel-ink);
}

.funnel-autocomplete__item span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--funnel-muted);
  line-height: 1.45;
}

.funnel-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.funnel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.funnel-chip--warn {
  background: #fff7ed;
  color: var(--funnel-amber);
}

.funnel-salary-card__head,
.funnel-offer-card__head,
.funnel-preview__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.funnel-salary-card__title,
.funnel-offer-card__title,
.funnel-preview__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--funnel-ink);
}

.funnel-salary-card__sub,
.funnel-offer-card__sub,
.funnel-preview__sub {
  margin-top: 4px;
  color: var(--funnel-muted);
  font-size: 13px;
  line-height: 1.5;
}

.funnel-salary-methods,
.funnel-offer-stats,
.funnel-preview__visible {
  display: grid;
  gap: 12px;
}

.funnel-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
}

.funnel-metric__label {
  color: var(--funnel-muted);
  font-size: 13px;
  font-weight: 700;
}

.funnel-metric__value {
  color: var(--funnel-ink);
  font-size: 15px;
  font-weight: 800;
}

.funnel-metric__value--highlight {
  color: var(--funnel-violet);
}

.funnel-metric__value--good {
  color: var(--funnel-green);
}

.funnel-metric__value--bad {
  color: var(--funnel-red);
}

.funnel-upload-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--funnel-muted);
}

.funnel-preview {
  margin-top: 22px;
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.funnel-preview__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--funnel-violet);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-preview__line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #e5e7eb;
}

.funnel-preview__line:last-child {
  border-bottom: none;
}

.funnel-preview__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--funnel-ink);
}

.funnel-preview__detail {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--funnel-muted);
}

.funnel-preview__value {
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: var(--funnel-ink);
}

.funnel-preview__value.is-alert {
  color: var(--funnel-amber);
}

.funnel-preview__locked {
  position: relative;
  margin-top: 16px;
  padding: 18px 20px 20px;
  border-radius: 18px;
  border: 1px dashed #cbd5e1;
  background: #fafafe;
  overflow: hidden;
}

.funnel-preview__locked::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(7px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(248, 250, 252, 0.86));
}

.funnel-preview__lock-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-preview__locked-inner {
  display: grid;
  gap: 12px;
  filter: blur(3px);
}

.funnel-preview__cta {
  display: block;
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #111827, #4f46e5 72%, #16a34a);
  color: #fff;
  text-align: center;
  text-decoration: none;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.funnel-preview__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(79, 70, 229, 0.24);
}

.funnel-preview__cta--secondary {
  margin-top: 8px;
  background: transparent;
  border: 1.5px solid #4f46e5;
  color: #4f46e5;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
}

.funnel-preview__cta--secondary:hover {
  background: #eef2ff;
  box-shadow: none;
  transform: none;
}

.funnel-preview__footer {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.funnel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px 28px;
}

.funnel-btn-back,
.funnel-btn-next {
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  cursor: pointer;
}

.funnel-btn-back {
  border: 1px solid var(--funnel-line);
  background: #fff;
  color: var(--funnel-muted);
}

.funnel-btn-back:hover {
  color: var(--funnel-ink);
}

.funnel-btn-next {
  border: none;
  background: var(--funnel-violet);
  color: #fff;
  min-width: 180px;
}

.funnel-btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.funnel-btn-next:not(:disabled):hover {
  background: #4338ca;
}

.funnel-empty {
  color: var(--funnel-muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .funnel-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .funnel-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .funnel-modal {
    border-radius: 20px;
  }

  .funnel-header,
  .funnel-progress,
  .funnel-body,
  .funnel-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .funnel-progress__copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .funnel-grid,
  .funnel-choice-grid--compact,
  .funnel-date-row {
    grid-template-columns: 1fr;
  }

  .funnel-question {
    font-size: 24px;
  }

  .funnel-rail {
    grid-template-columns: 1fr;
  }

  .funnel-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .funnel-btn-next,
  .funnel-btn-back {
    width: 100%;
  }

  .funnel-preview__line,
  .funnel-metric {
    flex-direction: column;
    align-items: flex-start;
  }

  .funnel-preview__value {
    text-align: left;
  }
}
