/* ============================================================
   CONTACT — the homepage v2 brief form, shared by every page.
   A raised form card, beside it a dark "what happens next" panel over a grey strip
   of contact details. Field names match the wpx-contact-form plugin (js/lead.js).
   Load after styles.css and before any page stylesheet.
   ============================================================ */

/* ---- Section shell (also used by the homepage sections) ---- */
.hm-sec { padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid var(--line); background: var(--bg); }

.hm-k {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.hm-k::before { content: ""; flex: none; width: 28px; height: 3px; background: var(--accent); }

.hm-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px 56px;
  align-items: end;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.hm-head h2 {
  max-width: 18ch;
  font-size: clamp(32px, 4.4vw, 58px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}
.hm-head-aside { justify-self: end; max-width: 42ch; }
.hm-head-aside p { font-size: var(--fz-16); line-height: 1.55; color: var(--muted); }

/* ---- Contact ---- */
.hm-contact { background: var(--bg); }
.hm-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }

.hm-lead-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: clamp(26px, 3vw, 44px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 40px 80px -40px rgba(15, 15, 14, 0.32), 0 2px 10px rgba(15, 15, 14, 0.04);
}
.lf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lf-fields { display: grid; gap: 14px; }
.lf-h { display: block; font-size: var(--fz-18); font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.lf-fields > .lf-h:not(:first-child) { margin-top: 12px; }

.lf-input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fz-15);
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.lf-input { height: auto; min-height: 112px; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.lf-input::placeholder { color: var(--muted); }
.lf-input:hover { border-color: color-mix(in srgb, var(--text) 32%, transparent); }
.lf-input:focus { outline: 0; border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

.lf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* Floating labels: the label sits in the field, then moves up once there is focus or a value.
   A field's own hint (placeholder) only shows once the label has moved up. */
.lf-field { position: relative; }
.lf-field .lf-input { padding-top: 18px; }
.lf-field .lf-input::placeholder { color: transparent; transition: color 0.2s; }
.lf-field .lf-input:focus::placeholder { color: var(--muted); }
.lf-field label {
  position: absolute;
  top: 50%;
  left: 17px;
  max-width: calc(100% - 34px);
  overflow: hidden;
  font-size: var(--fz-15);
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: left top;
  transition: transform 0.2s var(--ease), color 0.2s;
}
.lf-field .lf-input:focus + label,
.lf-field .lf-input:not(:placeholder-shown) + label { transform: translateY(-21px) scale(0.8); }
.lf-field .lf-input:focus + label { color: var(--text); }

.lf-phone { display: flex; }
.lf-cc { flex: none; width: 96px; }
.lf-cc .cselect-btn {
  height: 56px;
  padding: 0 11px 0 14px;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-right: 0;
  background: var(--bg-alt);
  font-size: var(--fz-14);
  white-space: nowrap;
}
.lf-cc .cselect-list { right: auto; width: 148px; }
.lf-phone .lf-input { flex: 1; min-width: 0; }
.lf-phone label { left: 113px; max-width: calc(100% - 130px); }

.lf-budget { display: flex; flex-wrap: wrap; gap: 10px 20px; min-width: 0; margin: 4px 0 0; padding: 0; border: 0; }
.lf-budget legend,
.lf-label { display: block; margin-bottom: 10px; padding: 0; font-size: var(--fz-14); color: var(--muted); }
.lf-budget label { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; font-size: var(--fz-14-5); font-weight: 600; cursor: pointer; }
.lf-budget input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--text) 32%, transparent);
  border-radius: 50%;
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  transition: border-width 0.15s, border-color 0.15s;
}
.lf-budget input:checked { border: 5px solid var(--text); background: var(--mark); }
.lf-budget input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Custom selects (main.js): the site's dropdown, sized to the 56px fields */
.hm-lead-form .cselect-btn { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.hm-lead-form .cselect-btn svg { color: var(--text); }
.hm-lead-form .cselect-btn:focus-visible,
.hm-lead-form .cselect.is-open .cselect-btn { outline: 0; border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.hm-lead-form .cselect-list { box-shadow: 0 24px 48px -24px rgba(15, 15, 14, 0.35); }
.hm-lead-form .cselect-list [role="option"] { padding: 12px 16px; }
.lf-cc .cselect-list [role="option"] { padding: 10px 14px; font-size: var(--fz-14); }
.lf-select .cselect-btn { padding-right: 18px; }
.lf-select .cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-select .cselect-value.is-placeholder { color: var(--muted); }

.lf-switches { display: grid; gap: 12px; margin-top: 6px; }
.lf-switch { position: relative; display: flex; align-items: flex-start; gap: 12px; font-size: var(--fz-14-5); line-height: 1.45; cursor: pointer; }
.lf-switch input { position: absolute; top: 0; left: 0; width: 40px; height: 22px; margin: 0; opacity: 0; cursor: pointer; }
.lf-track { position: relative; flex: none; width: 40px; height: 22px; margin-top: -1px; background: color-mix(in srgb, var(--text) 18%, transparent); transition: background 0.2s; }
.lf-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--surface); transition: transform 0.25s var(--ease), background 0.2s; }
.lf-switch input:checked + .lf-track { background: var(--text); }
.lf-switch input:checked + .lf-track::after { background: var(--mark); transform: translateX(18px); }
.lf-switch input:focus-visible + .lf-track { outline: 2px solid var(--text); outline-offset: 2px; }

.lf-submit { width: 100%; }
.lf-note { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.lf-note a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.lf-status { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--bg-alt); font-size: var(--fz-14); line-height: 1.45; }
.lf-status.is-error { border-left-color: #b42318; }
.lf-status a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* After the first try to send, missing fields are outlined */
.hm-lead-form.was-checked .lf-input:invalid,
.hm-lead-form.was-checked .cselect:has(select:invalid) .cselect-btn,
.hm-lead-form .cselect.is-error .cselect-btn { border-color: #b42318; }
.hm-lead-form.was-checked .lf-budget:has(input:invalid) legend,
.hm-lead-form.was-checked .lf-switch:has(input:invalid) { color: #b42318; }
.hm-lead-form.was-checked .lf-switch input:invalid + .lf-track { box-shadow: inset 0 0 0 1px #b42318; }

.hm-lead-form.is-sent > :not(.lf-done) { display: none; }
.lf-done { display: grid; justify-items: start; gap: 12px; padding: 24px 0; outline: 0; }
.lf-done[hidden],
.lf-status[hidden] { display: none; }
.lf-done-ico { position: relative; width: 48px; height: 48px; background: var(--accent); }
.lf-done-ico::after { content: ""; position: absolute; top: 13px; left: 18px; width: 10px; height: 18px; border: solid var(--accent-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.lf-done h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.lf-done p { max-width: 40ch; font-size: var(--fz-15); line-height: 1.55; color: var(--muted); }
.lf-done a { color: var(--text); font-weight: 600; }

/* Beside the card: shorter than it, so the card stands out above and below */
.hm-lead-side { display: grid; margin-block: clamp(32px, 4vw, 56px); }
.hm-lead-next {
  --accent: var(--deep-accent);
  --accent-hover: var(--deep-accent-hover);
  --accent-ink: var(--deep-accent-ink);
  --cta: var(--deep-accent);
  --cta-hover: var(--deep-accent-hover);
  --cta-ink: var(--deep-accent-ink);
  padding: clamp(32px, 4vw, 56px) clamp(28px, 4vw, 60px);
  background: var(--deep);
  color: var(--deep-text);
}
.hm-lead-next h3 { margin-bottom: 28px; font-size: clamp(22px, 2vw, 28px); font-weight: 600; letter-spacing: -0.03em; }
.hm-lead-next h3 + p { max-width: 46ch; margin: -14px 0 28px; font-size: var(--fz-14-5); line-height: 1.55; color: var(--deep-muted); }
.hm-lead-next ol { display: grid; gap: 28px; counter-reset: nx; }
.hm-lead-next li { position: relative; display: grid; gap: 6px; padding-left: 56px; counter-increment: nx; }
.hm-lead-next li::before {
  content: counter(nx);
  position: absolute;
  top: -3px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-ink);
}
.hm-lead-next li:not(:last-child)::after { content: ""; position: absolute; top: 37px; bottom: -24px; left: 15px; width: 2px; background: var(--deep-line); }
.hm-lead-next b { font-size: var(--fz-16); font-weight: 600; }
.hm-lead-next span { max-width: 46ch; font-size: var(--fz-14); line-height: 1.55; color: var(--deep-muted); }

.hm-lead-facts { display: grid; gap: 22px; padding: 26px clamp(28px, 4vw, 60px) 24px; background: color-mix(in srgb, var(--text) 5%, var(--bg-alt)); }
.hm-lead-facts dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 16px 24px; }
.hm-lead-facts dt { margin-bottom: 6px; font-size: var(--fz-15); font-weight: 650; color: var(--text); }
.hm-lead-facts dd { font-size: 13px; line-height: 1.6; color: var(--muted); }
.hm-lead-facts dd a { color: inherit; transition: color 0.2s; }
.hm-lead-facts dd a:hover { color: var(--text); }
.hm-lead-li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); font-size: var(--fz-15); font-weight: 650; color: var(--text); }
.hm-lead-li i { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--text); transition: background 0.2s, color 0.2s; }
.hm-lead-li svg { width: 16px; height: 16px; fill: currentColor; }
.hm-lead-li:hover i { background: var(--text); color: var(--surface); }

/* ---- Responsive ---- */
@media (min-width: 981px) and (max-width: 1240px) {
  .lf-grid > :nth-child(n + 3) { grid-column: 1 / -1; }
  .hm-lead-facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .hm-lead { grid-template-columns: 1fr; }
  .hm-lead-side { margin-block: 0; }
}

@media (max-width: 900px) {
  .hm-head { grid-template-columns: 1fr; align-items: start; }
  .hm-head-aside { justify-self: start; }
}

@media (max-width: 640px) {
  /* Sections start with a larger kicker; small caps never go under 12px */
  .hm-k { margin-bottom: 14px; font-size: 12px; }
  .hm-lead-form { padding: 22px 18px 24px; box-shadow: 0 24px 48px -32px rgba(15, 15, 14, 0.32); }
  .lf-grid { gap: 10px; }
  .lf-grid > :nth-child(n + 3) { grid-column: 1 / -1; }
  .lf-budget { display: grid; grid-template-columns: repeat(3, max-content); gap: 8px 22px; }
  .hm-lead-next { padding: 28px 20px; }
  .hm-lead-next li { padding-left: 48px; }
  .hm-lead-facts { padding: 22px 20px 20px; }
  .hm-lead-facts dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .hm-lead-facts dd a { display: inline-block; margin-block: -10px; padding-block: 10px; }
}
