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

/* ================================================================
   FormAssembly Custom Forms — Lee Hybrid · Style B
   Navy header · Teal accents · Square corners · Inter/Marfa fonts
   ================================================================ */

.fa-root {
  --fa-navy:      #1a374e;
  --fa-navy-dark: #122840;
  --fa-teal:      #00beff;
  --fa-red:       #e8363a;
  --fa-text:      #2a2a2a;
  --fa-muted:     #666;
  --fa-border:    #e0e0e0;
  --fa-bg:        #ffffff;
  --fa-input-bg:  #fafafa;
  --fa-surface:   #faf5e6;
  --fa-success:   #15472c;

  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  color: var(--fa-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Wrapper ── */
.fa-form-wrap {
  max-width: 680px;
  margin: 0 auto;
  background: var(--fa-bg);
  border: 1px solid #ddd;
  box-shadow: 0 0 40px rgba(26,55,78,.08);
}

/* ── Header (navy + teal underline) ── */
.fa-form-header {
  background: var(--fa-navy);
  padding: 28px 32px;
  position: relative;
}
.fa-form-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: var(--fa-teal);
}
.fa-form-header h2 {
  font-family: "Marfa", "Georgia", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.fa-form-header p {
  font-size: .85rem;
  color: rgba(255,255,255,.7);
  margin: 0;
}

/* ── Progress bar (inside header) ── */
.fa-progress {
  background: var(--fa-navy);
  padding: 20px 32px 0;
}
.fa-progress__bar {
  height: 3px;
  background: rgba(255,255,255,.2);
  margin-bottom: 10px;
}
.fa-progress__fill {
  height: 100%;
  background: var(--fa-teal);
  transition: width 350ms ease;
}
.fa-progress__dots {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.fa-progress__dot {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,.25);
  transition: background .2s;
}
.fa-progress__dot.is-active,
.fa-progress__dot.is-done { background: var(--fa-teal); }
.fa-progress__label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 0;
  padding-bottom: 16px;
}

/* ── Steps ── */
.fa-step         { display: none; padding: 28px 32px; animation: fa-in 200ms ease both; }
.fa-step--active { display: block; }
@keyframes fa-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fa-step__title {
  font-family: "Marfa", "Georgia", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fa-navy);
  margin: 0 0 22px;
}

/* ── Fields ── */
.fa-field { margin-bottom: 20px; }

/* ── Labels ── */
.fa-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--fa-muted);
  margin-bottom: 6px;
}
.fa-label--static {
  position: static;
  display: block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--fa-muted);
  margin-bottom: 6px;
}
.fa-req { color: var(--fa-red); margin-left: 2px; }

/* ── Text inputs / textarea ── */
.fa-input-wrap { position: relative; }

.fa-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--fa-text);
  background: var(--fa-input-bg);
  border: 1.5px solid var(--fa-border);
  border-radius: 0;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.fa-input:focus {
  border-color: var(--fa-teal);
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,190,255,.12);
}
.fa-input.is-invalid {
  border-color: var(--fa-red);
  box-shadow: 0 0 0 3px rgba(232,54,58,.1);
}
.fa-textarea { resize: vertical; min-height: 110px; line-height: 1.55; padding-top: 9px; }

/* Floating labels don't apply in Style B — labels are always static */
.fa-label { position: static; transform: none; font-size: .78rem; }

/* ── Select ── */
.fa-input-wrap--select { }
.fa-select-wrap { position: relative; }
.fa-select {
  display: block;
  width: 100%;
  padding: 10px 38px 10px 12px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  color: var(--fa-text);
  background: var(--fa-input-bg);
  border: 1.5px solid var(--fa-border);
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  box-sizing: border-box;
}
.fa-select:focus {
  border-color: var(--fa-teal);
  background: #fff;
  box-shadow: 0 3px 8px rgba(0,190,255,.12);
}
.fa-select-arrow {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--fa-muted);
  font-size: 10px;
  font-weight: 900;
}

/* ── Radio & Checkbox ── */
.fa-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fa-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--fa-border);
  background: var(--fa-input-bg);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 400;
  transition: border-color .15s, background .15s;
}
.fa-choice:hover { border-color: var(--fa-teal); background: #f0fbff; }
.fa-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.fa-choice__mark {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border: 2px solid var(--fa-border);
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color .15s, background .15s;
}
.fa-choice input:checked ~ .fa-choice__mark {
  border-color: var(--fa-teal);
  background: var(--fa-teal);
}
/* Square dot for radio */
.fa-choice input[type="radio"]:checked ~ .fa-choice__mark::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  background: #fff;
}
/* Tick for checkbox */
.fa-choice--check input:checked ~ .fa-choice__mark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px,-1px);
}
.fa-choice:has(input:checked) { border-color: var(--fa-teal); background: #f0fbff; }
.fa-choice input:checked ~ .fa-choice__label { font-weight: 600; color: var(--fa-navy); }

/* ── File upload ── */
.fa-file-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 2px dashed var(--fa-border);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  font-size: .9rem;
  color: var(--fa-muted);
  background: var(--fa-input-bg);
}
.fa-file-label:hover { border-color: var(--fa-teal); background: #f0fbff; }
.fa-file-input { position: absolute; opacity: 0; width: 0; height: 0; }
.fa-file-icon { font-size: 1.4rem; color: var(--fa-navy); }

/* ── Hint / error ── */
.fa-hint { font-size: .78rem; color: var(--fa-muted); margin: 5px 0 0; font-style: italic; }
.fa-field-error { font-size: .78rem; font-weight: 600; color: var(--fa-red); margin: 4px 0 0; min-height: 16px; }

/* ── Headings / paragraphs ── */
.fa-field-heading {
  font-family: "Marfa", "Georgia", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fa-navy);
  margin: 12px 0 4px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
.fa-field-heading:first-child { border-top: none; padding-top: 0; }
.fa-field-paragraph { font-size: .95rem; color: var(--fa-muted); margin: 0 0 10px; line-height: 1.55; }

/* ── Step nav ── */
.fa-step__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 20px 32px 28px;
  border-top: 1px solid #f0f0f0;
  margin-left: -32px;
  margin-right: -32px;
  margin-bottom: -28px;
}
.fa-step__nav-hint { font-size: .82rem; color: var(--fa-muted); }

/* Buttons matching Lee .solid-btn / .regular-btn */
.fa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.5rem 1.25rem;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.4px;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  text-decoration: none;
}
.fa-btn:active { transform: scale(.99); }
.fa-btn--primary {
  background: var(--fa-navy);
  color: #fff;
  border: 1px solid var(--fa-navy);
}
.fa-btn--primary:hover { background: var(--fa-navy-dark); box-shadow: 0 4px 12px rgba(26,55,78,.2); }
.fa-btn--secondary {
  background: transparent;
  color: var(--fa-text);
  border: 1px solid var(--fa-text);
}
.fa-btn--secondary:hover { background: rgba(0,0,0,.04); }
.fa-btn--submit { min-width: 150px; }
.fa-btn__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  animation: fa-spin 550ms linear infinite;
}
.fa-btn--loading .fa-btn__text    { display: none; }
.fa-btn--loading .fa-btn__spinner { display: block; }
.fa-btn--loading                  { pointer-events: none; opacity: .85; }
@keyframes fa-spin { to { transform: rotate(360deg); } }

/* ── Messages ── */
.fa-messages { overflow: hidden; max-height: 0; transition: max-height .3s ease; }
.fa-messages:not(:empty) { max-height: 200px; }
.fa-msg {
  margin: 0 32px 16px;
  padding: 12px 16px;
  font-size: .9rem;
  font-weight: 600;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.fa-msg--success { background: #f0fdf4; color: var(--fa-success); border-color: var(--fa-success); }
.fa-msg--error   { background: #fff0f0; color: var(--fa-red);     border-color: var(--fa-red); }

/* ── Success screen ── */
.fa-success-screen { display: none; padding: 52px 32px; text-align: center; animation: fa-in 300ms ease; }
.fa-success-screen.is-visible { display: block; }
.fa-success-icon {
  width: 64px; height: 64px;
  background: var(--fa-navy);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}
.fa-success-screen h2 {
  font-family: "Marfa", "Georgia", serif;
  font-size: 1.6rem;
  color: var(--fa-navy);
  font-weight: 700;
  margin: 0 0 10px;
}
.fa-success-screen p { font-size: 1rem; color: var(--fa-muted); }

/* ── Error ── */
p.fa-error {
  padding: 12px 16px;
  background: #fff0f0;
  color: var(--fa-red);
  border-left: 4px solid var(--fa-red);
  font-size: .9rem;
  font-weight: 600;
  margin: 0;
}

/* ── Conditional transitions ── */
.fa-field[data-cond-hidden] { overflow: hidden; }
.fa-field.fa-cond-show { animation: fa-in 180ms ease both; }

/* ── Theme overrides ── */
.fa-theme--minimal .fa-form-wrap { box-shadow: none; border-color: var(--fa-border); }
.fa-theme--card .fa-field { background: var(--fa-surface); padding: 14px 16px; border: 1px solid #ede6d6; }

/* ── Responsive ── */
@media (max-width: 560px) {
  .fa-step                  { padding: 20px; }
  .fa-form-header           { padding: 20px; }
  .fa-step__nav             { padding: 16px 20px 20px; margin-left: -20px; margin-right: -20px; flex-wrap: wrap; gap: 10px; }
  .fa-btn                   { width: 100%; }
  .fa-msg                   { margin: 0 20px 12px; }
  .fa-success-screen        { padding: 36px 20px; }
}

/* ================================================================
   Preserve-first overrides for original FormAssembly markup
   LEE-aligned styling for preserved FormAssembly controls
   ================================================================ */
.fa-form-wrap--preserved .fa-form--preserved {
  padding: 28px 32px 32px;
}

.fa-form-wrap--preserved .fa-preserved-html {
  color: inherit;
}

.fa-form-wrap--preserved .wFormContainer,
.fa-form-wrap--preserved .wForm,
.fa-form-wrap--preserved .wForm form,
.fa-form-wrap--preserved .wForm .htmlSection,
.fa-form-wrap--preserved .wForm .oneField,
.fa-form-wrap--preserved .oneField {
  max-width: none !important;
}

.fa-form-wrap--preserved .oneField,
.fa-form-wrap--preserved .htmlSection,
.fa-form-wrap--preserved fieldset {
  margin: 0 0 20px;
}

.fa-form-wrap--preserved .preField,
.fa-form-wrap--preserved .oneField > label,
.fa-form-wrap--preserved .inlineLabel,
.fa-form-wrap--preserved .wForm .oneField > .label,
.fa-form-wrap--preserved legend {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 0 8px;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--fa-navy);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}

.fa-form-wrap--preserved .oneField > label span,
.fa-form-wrap--preserved .preField span,
.fa-form-wrap--preserved legend span {
  color: inherit;
  font: inherit;
}

.fa-form-wrap--preserved .inputWrapper,
.fa-form-wrap--preserved .choices {
  display: block;
}

.fa-form-wrap--preserved input,
.fa-form-wrap--preserved textarea,
.fa-form-wrap--preserved select,
.fa-form-wrap--preserved button {
  font: inherit;
}

.fa-form-wrap--preserved input[type="text"],
.fa-form-wrap--preserved input[type="email"],
.fa-form-wrap--preserved input[type="tel"],
.fa-form-wrap--preserved input[type="number"],
.fa-form-wrap--preserved input[type="date"],
.fa-form-wrap--preserved input[type="password"],
.fa-form-wrap--preserved input[type="search"],
.fa-form-wrap--preserved input[type="url"],
.fa-form-wrap--preserved textarea,
.fa-form-wrap--preserved select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid #c8d7e3;
  border-radius: 8px;
  background: #fff;
  color: var(--fa-text);
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  box-sizing: border-box;
}

.fa-form-wrap--preserved textarea {
  min-height: 132px;
  resize: vertical;
}

.fa-form-wrap--preserved select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, #1a374e 50%), linear-gradient(135deg, #1a374e 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.fa-form-wrap--preserved input::placeholder,
.fa-form-wrap--preserved textarea::placeholder {
  color: #7d8f9c;
}

.fa-form-wrap--preserved input[type="text"]:focus,
.fa-form-wrap--preserved input[type="email"]:focus,
.fa-form-wrap--preserved input[type="tel"]:focus,
.fa-form-wrap--preserved input[type="number"]:focus,
.fa-form-wrap--preserved input[type="date"]:focus,
.fa-form-wrap--preserved input[type="password"]:focus,
.fa-form-wrap--preserved input[type="search"]:focus,
.fa-form-wrap--preserved input[type="url"]:focus,
.fa-form-wrap--preserved textarea:focus,
.fa-form-wrap--preserved select:focus {
  outline: none;
  border-color: #89cceb;
  box-shadow: 0 0 0 4px rgba(137, 204, 235, .22);
  background: #fff;
}

.fa-form-wrap--preserved .choices .oneChoice,
.fa-form-wrap--preserved .choices li,
.fa-form-wrap--preserved .choices .choice,
.fa-form-wrap--preserved .choices label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.fa-form-wrap--preserved input[type="checkbox"],
.fa-form-wrap--preserved input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: #1a374e;
}

.fa-form-wrap--preserved .choices label,
.fa-form-wrap--preserved .choices .oneChoiceLabel,
.fa-form-wrap--preserved .choices .label {
  color: var(--fa-text);
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.fa-form-wrap--preserved .required,
.fa-form-wrap--preserved .reqMark {
  color: var(--fa-red);
}

.fa-form-wrap--preserved .offstate,
.fa-form-wrap--preserved .fa-hidden-default {
  display: none !important;
}

.fa-form-wrap--preserved .errMsg,
.fa-form-wrap--preserved .field-hint,
.fa-form-wrap--preserved .instructions,
.fa-form-wrap--preserved .hint,
.fa-form-wrap--preserved .helptext {
  font-size: .875rem;
  color: var(--fa-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.fa-form-wrap--preserved .htmlSection,
.fa-form-wrap--preserved .section {
  color: var(--fa-text);
}

.fa-form-wrap--preserved .htmlSection h1,
.fa-form-wrap--preserved .htmlSection h2,
.fa-form-wrap--preserved .htmlSection h3,
.fa-form-wrap--preserved .section h1,
.fa-form-wrap--preserved .section h2,
.fa-form-wrap--preserved .section h3 {
  color: var(--fa-navy);
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
}

.fa-form-wrap--preserved input[type="submit"],
.fa-form-wrap--preserved button[type="submit"],
.fa-submit-row .fa-btn--submit {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 8px;
  border: 1px solid #1a374e;
  background: #1a374e;
  color: #fff;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .08s ease, box-shadow .18s ease;
  box-shadow: 0 8px 18px rgba(26, 55, 78, .14);
}

.fa-form-wrap--preserved input[type="submit"]:hover,
.fa-form-wrap--preserved button[type="submit"]:hover,
.fa-submit-row .fa-btn--submit:hover {
  background: #e8363a;
  border-color: #e8363a;
  box-shadow: 0 10px 22px rgba(232, 54, 58, .18);
}

.fa-form-wrap--preserved input[type="submit"]:focus,
.fa-form-wrap--preserved button[type="submit"]:focus,
.fa-submit-row .fa-btn--submit:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(137, 204, 235, .22);
}

.fa-form-wrap--preserved input[type="submit"].fa-btn--loading,
.fa-form-wrap--preserved button[type="submit"].fa-btn--loading,
.fa-submit-row .fa-btn--submit.fa-btn--loading {
  opacity: .88;
}

.fa-submit-row {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #edf1f4;
  display: flex;
  justify-content: flex-end;
}

.fa-message {
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 4px solid currentColor;
  background: #f8f8f8;
}

.fa-message--error {
  color: var(--fa-red);
  background: rgba(232,54,58,.08);
}

.fa-success {
  padding: 32px;
}

.fa-success h3 {
  margin: 0 0 8px;
  color: var(--fa-success);
}

.fa-has-error input,
.fa-has-error select,
.fa-has-error textarea {
  border-color: var(--fa-red) !important;
  box-shadow: 0 0 0 4px rgba(232,54,58,.12) !important;
}

@media (max-width: 560px) {
  .fa-form-wrap--preserved .fa-form--preserved {
    padding: 22px 20px 24px;
  }

  .fa-submit-row {
    justify-content: stretch;
  }

  .fa-form-wrap--preserved input[type="submit"],
  .fa-form-wrap--preserved button[type="submit"],
  .fa-submit-row .fa-btn--submit {
    width: 100%;
  }
}
