/* =========================================================
   Deal Smith Realty, problem-hub lead forms (js/problem-forms.js)
   Load after styles.css. Every selector is namespaced .pf-*; the
   forms also reuse .lead-field, .lead-form-row, .lead-form-consent,
   .btn and .form-status from styles.css.
   ========================================================= */

.pf-form[hidden], .pf-form [hidden], .pf-done[hidden] { display: none !important; }

.pf-form, .pf-done {
  position: relative;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  background: var(--bg-3);
  padding: 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  scroll-margin-top: 96px;
}

.pf-progress {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.pf-step { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pf-step h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  color: var(--fg-1);
}
.pf-step h3:focus, .pf-done h3:focus { outline: none; }
.pf-step h3:focus-visible, .pf-done h3:focus-visible { outline: 2px solid var(--gold-500); outline-offset: 4px; }

.pf-branch { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.pf-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.pf-group legend {
  padding: 0;
  margin: 0 0 10px;
  float: left;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--fg-1);
}
.pf-group legend + * { clear: both; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pf-chips label { position: relative; cursor: pointer; max-width: 100%; }
.pf-chips input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pf-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  box-sizing: border-box;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-pill);
  font-size: 15px;
  line-height: 1.3;
  background: var(--bg-1);
  color: var(--fg-1);
  transition: background var(--dur-fast, 140ms) var(--ease-smooth, ease), border-color var(--dur-fast, 140ms) var(--ease-smooth, ease);
}
.pf-chips input:checked + span { background: var(--dsr-black); color: var(--fg-on-dark-1); border-color: var(--dsr-black); }
.pf-chips input:focus-visible + span { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.pf-form .lead-field { min-width: 0; }
.pf-form .lead-field input,
.pf-form .lead-field select,
.pf-form .lead-field textarea { font-size: 16px; min-height: 44px; width: 100%; box-sizing: border-box; background: var(--bg-1); }
.pf-form .lead-form-row { min-width: 0; }

.pf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-size: 15px;
  color: var(--fg-1);
}
.pf-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--gold-500); cursor: pointer; }

.pf-note { margin: 0; font-size: 13px; color: var(--fg-3); }

.pf-nav { display: flex; gap: 12px; align-items: center; }
.pf-nav .btn { min-height: 44px; }
.pf-nav .btn-primary { margin-left: auto; }
.pf-form .form-status:empty { display: none; }
.pf-form .form-status { margin-top: -6px; }

.pf-done h3 { font-family: var(--font-display); font-size: 28px; line-height: 1.15; margin: 0; }
.pf-done p { color: var(--fg-2); margin: 0; }

@media (max-width: 480px) {
  .pf-form, .pf-done { padding: 20px 16px; }
  .pf-nav { flex-direction: column-reverse; align-items: stretch; }
  .pf-nav .btn { width: 100%; }
  .pf-nav .btn-primary { margin-left: 0; }
}
