/* The Flooring Mart — lead form styles, shipped WITH the plugin.
 *
 * Every rule is scoped beneath .tfm-lead-capture (the wrapper TFM_Lead_Form::render()
 * emits), so the WordPress theme needs none of the form's functional CSS and none of
 * the theme's own inputs, buttons, headings or labels are touched. The design tokens
 * are declared locally on the wrapper — the plugin does not depend on theme variables.
 *
 * This file is authored here, not generated: the homepage keeps its own inline copy of
 * the same appearance for the static design preview.
 */

.tfm-lead-capture {
  --tfm-ink: #1A1A18;
  --tfm-ink2: #3A3A36;
  --tfm-muted: #7A7A74;
  --tfm-warm: #F7F4EF;
  --tfm-white: #FFFFFF;
  --tfm-border: #E2DDD6;
  --tfm-gold: #9B7940;
  --tfm-gold2: #7D5F2E;
  --tfm-radius: 3px;
  --tfm-danger: #B3261E;
  --tfm-danger-text: #8E1E17;
  --tfm-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --tfm-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  color: var(--tfm-ink);
}

/* ── shell ─────────────────────────────────────────────────────────────── */
.tfm-lead-capture .contact-form { background: var(--tfm-warm); padding: 52px 48px; }
.tfm-lead-capture .form-title { font-family: var(--tfm-serif); font-size: 30px; font-weight: 500; margin: 0 0 8px; line-height: 1.15; color: var(--tfm-ink); }
.tfm-lead-capture .form-subtitle { font-family: var(--tfm-sans); font-size: 13px; color: var(--tfm-muted); margin: 0 0 32px; line-height: 1.6; }
.tfm-lead-capture .ef-req { color: var(--tfm-gold2); font-weight: 700; }
.tfm-lead-capture .ef-req-note { display: block; margin-top: 6px; }

/* ── fields: visible labels, 1 column on small screens ─────────────────── */
.tfm-lead-capture .form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.tfm-lead-capture .form-row2 .form-group { margin-bottom: 0; }
.tfm-lead-capture .form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.tfm-lead-capture .form-group label { font-family: var(--tfm-sans); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 600; color: var(--tfm-muted); }
.tfm-lead-capture .form-group label .opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--tfm-muted); }
.tfm-lead-capture .form-group input,
.tfm-lead-capture .form-group select,
.tfm-lead-capture .form-group textarea {
  border: 1px solid var(--tfm-border); padding: 13px 16px; font-family: var(--tfm-sans); font-size: 14px;
  color: var(--tfm-ink); background: var(--tfm-white); border-radius: var(--tfm-radius); transition: border-color .2s;
  outline: none; width: 100%; resize: none; appearance: none; min-height: 44px; box-sizing: border-box;
}
.tfm-lead-capture .form-group textarea { min-height: 96px; resize: vertical; }
.tfm-lead-capture .form-group input:focus,
.tfm-lead-capture .form-group select:focus,
.tfm-lead-capture .form-group textarea:focus { border-color: var(--tfm-gold); }
.tfm-lead-capture .form-group input:focus-visible,
.tfm-lead-capture .form-group select:focus-visible,
.tfm-lead-capture .form-group textarea:focus-visible { outline: 2px solid var(--tfm-gold); outline-offset: 1px; }
.tfm-lead-capture .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7A74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ── inline errors: a mark as well as colour ───────────────────────────── */
.tfm-lead-capture .form-group input.is-invalid,
.tfm-lead-capture .form-group select.is-invalid,
.tfm-lead-capture .form-group textarea.is-invalid { border-color: var(--tfm-danger); box-shadow: 0 0 0 2px rgba(179, 38, 30, .12); }
.tfm-lead-capture .fe { margin: 0; font-family: var(--tfm-sans); font-size: 12.5px; line-height: 1.5; color: var(--tfm-danger-text); }
.tfm-lead-capture .fe[hidden] { display: none; }
.tfm-lead-capture .fe::before { content: "! "; font-weight: 700; }

/* ── status region: loading, failure, recoverable messages ─────────────── */
.tfm-lead-capture .form-status { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--tfm-radius); font-family: var(--tfm-sans); font-size: 14px; line-height: 1.6; border: 1px solid var(--tfm-border); background: var(--tfm-white); color: var(--tfm-ink2); }
.tfm-lead-capture .form-status[hidden] { display: none; }
.tfm-lead-capture .form-status:focus { outline: 2px solid var(--tfm-gold); outline-offset: 3px; }
.tfm-lead-capture .form-status-error { border-color: #D9A19C; background: #FBF1F0; color: #5C1A15; }
.tfm-lead-capture .form-status a { color: var(--tfm-gold2); font-weight: 700; white-space: nowrap; }

/* ── the button: 44px+ target, disabled until a token arrives ──────────── */
.tfm-lead-capture .form-submit {
  width: 100%; padding: 17px; min-height: 48px; background: var(--tfm-ink); color: var(--tfm-white);
  font-family: var(--tfm-sans); font-size: 11px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase;
  border: none; cursor: pointer; border-radius: var(--tfm-radius); transition: background .2s; margin-top: 4px;
}
.tfm-lead-capture .form-submit:hover { background: var(--tfm-gold); }
.tfm-lead-capture .form-submit:focus-visible { outline: 2px solid var(--tfm-gold); outline-offset: 3px; }
.tfm-lead-capture .form-submit[disabled] { background: var(--tfm-ink2); cursor: progress; opacity: .9; }
.tfm-lead-capture .form-submit[aria-disabled="true"] { background: var(--tfm-ink2); opacity: .75; cursor: not-allowed; }
.tfm-lead-capture .form-submit[aria-busy="true"] { cursor: progress; }

/* ── token-loading note beneath the button ─────────────────────────────── */
.tfm-lead-capture .form-token-note { margin: 10px 0 0; font-family: var(--tfm-sans); font-size: 12.5px; line-height: 1.6; color: var(--tfm-muted); text-align: center; }
.tfm-lead-capture .form-token-note[hidden] { display: none; }
.tfm-lead-capture .form-token-note-preview { color: var(--tfm-gold2); font-weight: 600; }

/* ── notes, honeypot, noscript ─────────────────────────────────────────── */
.tfm-lead-capture .form-note { font-family: var(--tfm-sans); font-size: 12px; color: var(--tfm-muted); text-align: center; margin-top: 12px; line-height: 1.6; }
.tfm-lead-capture .form-note a { color: var(--tfm-gold2); font-weight: 600; }
.tfm-lead-capture .ef-honey { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.tfm-lead-capture .form-noscript { margin: 0; padding: 28px 24px; border: 1px solid #C4A96A; border-radius: var(--tfm-radius); background: var(--tfm-white); font-family: var(--tfm-sans); font-size: 15px; line-height: 1.7; color: var(--tfm-ink2); }
.tfm-lead-capture .form-noscript p { margin: 0 0 12px; }
.tfm-lead-capture .form-noscript p:last-child { margin: 0; }
.tfm-lead-capture .form-noscript-title { font-family: var(--tfm-serif); font-size: 24px; line-height: 1.2; color: var(--tfm-ink); }
.tfm-lead-capture .form-noscript-contacts a { display: block; margin-top: 8px; min-height: 44px; line-height: 44px; font-size: 16px; font-weight: 700; color: var(--tfm-gold2); }
.tfm-lead-capture .form-noscript a { color: var(--tfm-gold2); font-weight: 700; }

/* ── success ───────────────────────────────────────────────────────────── */
.tfm-lead-capture .form-success { display: none; text-align: center; padding: 48px 32px; background: var(--tfm-warm); }
.tfm-lead-capture .form-success[hidden] { display: none; }
.tfm-lead-capture .form-success:focus { outline: 2px solid var(--tfm-gold); outline-offset: 6px; }
.tfm-lead-capture .form-success-tick { font-size: 36px; margin-bottom: 16px; color: var(--tfm-gold2); }
.tfm-lead-capture .form-success h4 { font-family: var(--tfm-serif); font-size: 34px; font-weight: 400; margin: 0 0 10px; color: var(--tfm-ink); }
.tfm-lead-capture .form-success p { font-family: var(--tfm-sans); font-size: 14px; color: var(--tfm-muted); line-height: 1.7; margin-top: 10px; }
.tfm-lead-capture .form-success p[hidden] { display: none; }
.tfm-lead-capture .form-success a { color: var(--tfm-gold2); font-weight: 700; }
.tfm-lead-capture .ef-ref { font-family: var(--tfm-sans); font-size: 16px; letter-spacing: .5px; color: var(--tfm-ink); white-space: nowrap; }

/* ── tablet ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .tfm-lead-capture .contact-form { padding: 44px 36px; }
  .tfm-lead-capture .form-title { font-size: 27px; }
}

/* ── mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .tfm-lead-capture .form-row2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tfm-lead-capture .contact-form { padding: 34px 20px; }
  .tfm-lead-capture .form-title { font-size: 24px; }
  .tfm-lead-capture .form-success { padding: 36px 20px; }
  .tfm-lead-capture .form-success h4 { font-size: 27px; }
  /* 16px keeps iOS from zooming the page when a field takes focus */
  .tfm-lead-capture .form-group input,
  .tfm-lead-capture .form-group select,
  .tfm-lead-capture .form-group textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .tfm-lead-capture .form-submit,
  .tfm-lead-capture .form-group input,
  .tfm-lead-capture .form-group select,
  .tfm-lead-capture .form-group textarea { transition: none; }
}
