/* ═══════════════════════════════════════════════════
   Fortray Lead Form — form.css
   Uses theme CSS variables where available,
   falls back to Fortray brand tokens.
═══════════════════════════════════════════════════ */

/* ── Reset ── */
.flf-wrap *,
.flf-wrap *::before,
.flf-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Container ── */
.flf-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-family: var(--font-sans, var(--wp--preset--font-family--system-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif));
  color: var(--color-text-primary, var(--wp--preset--color--foreground, #0d1117));
}

/* ── Progress Bar ── */
.flf-progress-bar {
  height: 4px;
  background: var(--color-border-tertiary, #e8ecf4);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}
.flf-progress-fill {
  height: 100%;
  width: 16%;
  background: #0a1a56;
  border-radius: 2px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Steps ── */
.flf-step { display: none; }
.flf-step.flf-active { display: block; animation: flfFadeIn 0.3s ease; }

@keyframes flfFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ── */
.flf-step-counter {
  font-size: 16px;
  color: #000;
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.flf-eyebrow {
  font-size: 14px;
  font-weight: 700;
  color: #df451d;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.flf-headline {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary, #0d1117);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.flf-sub {
  font-size: 14px;
  color: var(--color-text-secondary, #6b7280);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.flf-center { text-align: center; }

/* ── Option Cards ── */
.flf-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.flf-options--three {
  grid-template-columns: repeat(3, 1fr);
}
.flf-opt {
  border: 1px solid var(--color-border-tertiary, #e8ecf4);
  border-radius: var(--border-radius-lg, 10px);
  padding: 14px 12px;
  cursor: pointer;
  text-align: left;
  background: var(--color-background-primary, #ffffff);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
.flf-opt:hover {
  border-color: #0a1a56;
  box-shadow: 0 0 0 3px rgba(10, 26, 86, 0.06);
}
.flf-opt:focus-visible {
  outline: 2px solid #0a1a56;
  outline-offset: 2px;
}
.flf-opt.flf-selected {
  border: 2px solid #0a1a56;
  background: #f0f3ff;
}
.flf-opt-icon {
  font-size: 20px;
  margin-bottom: 6px;
  color: #df451d;
  line-height: 1;
}
.flf-opt-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary, #0d1117);
  display: block;
  line-height: 1.3;
}
.flf-opt-hint {
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  margin-top: 3px;
  display: block;
  line-height: 1.4;
}

/* ── Tags ── */
.flf-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.flf-tag {
  border: 1px solid var(--color-border-tertiary, #e8ecf4);
  border-radius: 100px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--color-background-primary, #fff);
  color: var(--color-text-primary, #0d1117);
  transition: all 0.15s ease;
}
.flf-tag:hover { border-color: #0a1a56; }
.flf-tag:focus-visible { outline: 2px solid #0a1a56; outline-offset: 2px; }
.flf-tag.flf-selected {
  background: #0a1a56;
  color: #fff;
  border-color: #0a1a56;
}

/* ── Buttons ── */
.flf-btn-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.flf-btn-primary {
  background: #0a1a56;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-md, 8px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
}
.flf-btn-primary:hover:not(:disabled) { opacity: 0.88; }
.flf-btn-primary:active:not(:disabled) { transform: scale(0.98); }
.flf-btn-primary:focus-visible { outline: 2px solid #0a1a56; outline-offset: 3px; }
.flf-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.flf-btn-back {
  background: transparent;
  color: #000;
  border: 1px solid var(--color-border-secondary, #d1d5db);
  padding: 12px 18px;
  border-radius: var(--border-radius-md, 8px);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 46px;
  white-space: nowrap;
}
.flf-btn-back:hover { background: var(--color-background-secondary, #f8f9fc); }
.flf-btn-back:focus-visible { outline: 2px solid #0a1a56; outline-offset: 2px; }

/* Spinner animation */
@keyframes flfSpin {
  to { transform: rotate(360deg); }
}
.flf-btn-spinner i {
  display: inline-block;
  animation: flfSpin 0.7s linear infinite;
}

/* ── Form Fields ── */
.flf-field {
  margin-bottom: 1rem;
}
.flf-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
  display: block;
  margin-bottom: 6px;
}
.flf-required { color: #df451d; }
.flf-optional {
  color: var(--color-text-secondary, #6b7280);
  font-weight: 400;
  font-size: 12px;
}
.flf-field input[type="text"],
.flf-field input[type="email"],
.flf-field input[type="tel"],
.flf-field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--color-border-secondary, #d1d5db);
  border-radius: var(--border-radius-md, 8px);
  font-size: 14px;
  color: var(--color-text-primary, #0d1117);
  background: var(--color-background-primary, #fff);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.flf-field input:focus,
.flf-field select:focus {
  outline: none;
  border-color: #0a1a56;
  box-shadow: 0 0 0 3px rgba(10, 26, 86, 0.1);
}
.flf-field input.flf-input-error { border-color: #df451d; }

/* ── Checkbox Row ── */
.flf-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-secondary, #6b7280);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.flf-checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #0a1a56;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.flf-checkbox-row label { cursor: pointer; }

/* ── Error Message ── */
.flf-error-msg {
  background: #fff5f5;
  border: 1px solid #f5c4c4;
  color: #c0392b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 1rem;
}

/* ── Trust Row ── */
.flf-trust-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 1rem;
  justify-content: flex-start;
}
.flf-trust-row.flf-center { justify-content: center; }
.flf-trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: var(--color-text-secondary, #6b7280);
}
.flf-trust-item i { color: #df451d; font-size: 20px; }

/* ── Success Screen ── */
.flf-success-wrap { text-align: left; }

.flf-success-icon {
  width: 56px;
  height: 56px;
  background: #eef1ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.flf-success-icon i { font-size: 26px; color: #0a1a56; }

/* ── Summary Card ── */
.flf-summary-card {
  background: var(--color-background-secondary, #f8f9fc);
  border-radius: var(--border-radius-lg, 10px);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.flf-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid var(--color-border-tertiary, #e8ecf4);
  gap: 12px;
}
.flf-summary-row:last-child { border-bottom: none; }
.flf-summary-label { color: var(--color-text-secondary, #6b7280); flex-shrink: 0; }
.flf-summary-val {
  font-weight: 600;
  color: var(--color-text-primary, #0d1117);
  text-align: right;
}

/* ── Finance Card ── */
.flf-finance-card {
  background: #fff5f2;
  border-radius: var(--border-radius-lg, 10px);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #f5c4b3;
}
.flf-finance-title {
  font-size: 13px;
  font-weight: 600;
  color: #df451d;
  margin-bottom: 4px;
}
.flf-finance-body {
  font-size: 13px;
  color: var(--color-text-secondary, #6b7280);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 560px) {
  .flf-wrap { padding: 1.5rem 0.85rem; }

  .flf-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  .flf-options--three { grid-template-columns: 1fr 1fr 1fr; }

  .flf-opt { padding: 12px 10px; }
  .flf-opt-label { font-size: 12px; }
  .flf-opt-hint { font-size: 11px; }

  .flf-trust-row { gap: 10px; }
}

@media (max-width: 400px) {
  .flf-options--three { grid-template-columns: 1fr 1fr; }

  .flf-btn-back { padding: 12px 12px; font-size: 13px; }
  .flf-btn-primary { font-size: 13px; }

  .flf-trust-row { flex-direction: column; gap: 6px; }
}

/* ── Screen reader only ── */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Quiz Heading (above progress bar) ── */
.flf-quiz-heading {
  text-align: center;
  margin-bottom: 1.75rem;
}
.flf-quiz-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #df451d;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.flf-quiz-title {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--color-text-primary, #0d1117);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.flf-quiz-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary, #6b7280);
  margin: 0;
  line-height: 1.6;
}
