@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&display=swap");

.stq {
  /* Бренд Suntime #EF533F */
  --stq-brand: #ef533f;
  --stq-accent: var(--stq-brand);
  --stq-accent-hover: color-mix(in srgb, var(--stq-brand) 72%, #4a2e12);
  --stq-accent-light: color-mix(in srgb, var(--stq-brand) 55%, #fff);
  --stq-text: #0f172a;
  --stq-muted: #64748b;
  --stq-border: #ebe4dc;
  --stq-border-strong: #d9cfc4;
  --stq-bg-soft: color-mix(in srgb, var(--stq-brand) 9%, #fff);
  --stq-bg-selected: color-mix(in srgb, var(--stq-brand) 20%, #fff);
  --stq-danger: #d92d20;
  --stq-gap-step: 28px;
  --stq-gap-field: 18px;

  font-family: "Onest", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--stq-text);
  padding: 4px 0 8px;
}

.stq-steps {
  margin: 0 0 var(--stq-gap-step);
  padding: 0 2px;
}

.stq-steps__counter {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--stq-muted);
  letter-spacing: 0.01em;
}

.stq-steps__counter [data-stq-current] {
  color: var(--stq-accent);
  font-weight: 700;
}

.stq-steps__track {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stq-steps__seg {
  flex: 1 1 0;
  height: 8px;
  border-radius: 999px;
  background: #e8edf3;
  transition: background-color 0.3s ease, transform 0.25s ease, opacity 0.25s ease;
}

.stq-steps__seg.is-done {
  background: var(--stq-accent);
  opacity: 0.55;
}

.stq-steps__seg.is-current {
  background: linear-gradient(90deg, var(--stq-accent-hover), var(--stq-accent));
  transform: scaleY(1.15);
  opacity: 1;
}

.stq-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stq-step {
  display: none;
}

.stq-step.is-active {
  display: block;
  animation: stq-fade 0.2s ease both;
  padding-bottom: 4px;
}

@keyframes stq-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stq-question {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 22px;
}

.stq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--stq-border);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
  font-size: 14px;
  font-weight: 500;
}

.stq-option input[type="radio"] {
  margin: 0;
  accent-color: var(--stq-accent);
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.stq-option:hover {
  border-color: var(--stq-border-strong);
  background: var(--stq-bg-soft);
}

.stq-option:has(input:checked) {
  border-color: var(--stq-accent);
  background: var(--stq-bg-selected);
}

/* Text fields: unified via theme-forms.css (.style-line) */
.stq .style-line {
  margin-top: 2px;
}

.stq-actions {
  display: flex;
  gap: 10px;
  margin-top: calc(var(--stq-gap-step) + 4px);
  padding-top: 8px;
  width: 100%;
  align-items: center;
}

.stq-actions .stq-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.stq-actions:not(:has(.stq-btn--ghost:not(.stq-btn--hidden):not([hidden]))) .stq-btn--primary {
  flex: 0 0 auto;
  width: auto;
  min-width: 140px;
  max-width: 50%;
}

.stq-actions .stq-btn--hidden,
.stq-actions .stq-btn[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.stq-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.08s ease;
}

.stq .stq-actions .stq-btn {
  width: auto;
  max-width: none;
}

.stq-btn:active {
  transform: translateY(1px);
}

.stq-btn--primary {
  background: var(--stq-accent);
  color: #fff;
  border-color: var(--stq-accent);
}

.stq-btn--primary:hover {
  background: var(--stq-accent-hover);
  border-color: var(--stq-accent-hover);
}

.stq-btn--primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.stq-btn--ghost {
  background: #fff;
  color: var(--stq-accent);
  border-color: var(--stq-border-strong);
}

.stq-btn--ghost:hover {
  border-color: var(--stq-accent);
}

.stq-form-status {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.stq-form-status.is-error {
  color: var(--stq-danger);
}

.stq-form-status.is-success {
  color: #117a3a;
}

.stq-form-status:empty {
  display: none;
  min-height: 0;
  margin: 0;
}

.stq-step--success .stq-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px 4px;
  gap: 12px;
}

.stq-success__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--stq-accent) 14%, #fff);
  color: var(--stq-accent);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stq-success__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--stq-text);
}

.stq-success__text {
  margin: 0;
  max-width: 28em;
  font-size: 15px;
  line-height: 1.5;
  color: var(--stq-muted);
}

.stq-success__close {
  margin-top: 8px;
  min-width: 140px;
  min-height: 46px;
  padding: 0 20px;
}

.stq.is-complete .stq-actions,
.stq.is-complete .stq-form-status {
  display: none !important;
}

@media (max-width: 540px) {
  .stq {
    --stq-gap-step: 22px;
    --stq-gap-field: 14px;
  }

  .stq-steps__seg {
    height: 6px;
  }

  .stq-question {
    font-size: 17px;
    margin-bottom: 18px;
  }

  .stq-actions .stq-btn {
    min-height: 44px;
    font-size: 13px;
    padding: 0 10px;
  }

  .stq-actions:not(:has(.stq-btn--ghost:not(.stq-btn--hidden):not([hidden]))) .stq-btn--primary {
    min-width: 120px;
  }
}
