.td-api-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-top: 1.25rem;
  overflow: hidden;
}

.td-api-form__top {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.td-api-form__progress-text {
  color: var(--text-light);
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .55rem;
}

.td-api-form__progress {
  background: var(--bg-alt);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.td-api-form__bar {
  background: var(--primary);
  border-radius: inherit;
  height: 100%;
  transition: width .25s ease;
  width: 11.111%;
}

.td-api-form__notice {
  align-items: flex-start;
  background: var(--secondary);
  color: var(--text);
  display: flex;
  gap: .75rem;
  padding: 1rem 1.25rem;
}

.td-api-form__body {
  padding: 1.4rem;
}

.td-form-step {
  display: none;
}

.td-form-step.is-active {
  display: block;
}

.td-form-step h3 {
  color: var(--dark);
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.td-form-options {
  display: grid;
  gap: .75rem;
}

.td-form-option {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  gap: .75rem;
  padding: .9rem 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.td-form-option:hover,
.td-form-option:has(input:checked) {
  background: var(--bg-warm);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 76, 30, .08);
}

.td-form-option input {
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.td-form-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.td-form-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

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

.td-form-field label {
  color: var(--text);
  font-size: .88rem;
  font-weight: 700;
}

.td-form-field input,
.td-form-field select,
.td-form-field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  min-height: 48px;
  padding: .85rem .95rem;
  width: 100%;
}

.td-form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.td-form-optin {
  align-items: flex-start;
  color: var(--text-light);
  display: flex;
  font-size: .9rem;
  gap: .6rem;
  margin-top: .8rem;
}

.td-form-optin input {
  accent-color: var(--primary);
  margin-top: .25rem;
}

.td-form-error {
  background: #fff1f1;
  border: 1px solid #ffcaca;
  border-radius: var(--radius);
  color: #a32020;
  display: none;
  font-size: .9rem;
  margin-top: 1rem;
  padding: .8rem .95rem;
}

.td-form-error.is-visible {
  display: block;
}

.td-api-form__nav {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.td-api-form__nav .btn {
  min-width: 132px;
}

.td-api-form__success {
  background: #effaf3;
  border: 1px solid #bfe8ca;
  border-radius: var(--radius-lg);
  color: #166534;
  display: none;
  padding: 1.2rem;
}

.td-api-form__success.is-visible {
  display: block;
}

.td-api-form__legal {
  color: var(--text-light);
  font-size: .8rem;
  line-height: 1.5;
  margin-top: 1rem;
}

.td-api-form__legal a {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 720px) {
  .td-form-grid {
    grid-template-columns: 1fr;
  }

  .td-api-form__nav {
    flex-direction: column-reverse;
  }

  .td-api-form__nav .btn {
    width: 100%;
  }
}
