/* ── public forms + payment calculator (forms-polish, 2026-11-21) ─────────
   Owns the layout and rhythm of the site's public forms, loaded by
   layout.php right after style.css (whose .intake / .sidecard / .mcalc
   base rules it refines):
     /contact            _contact-form.php inside page.php's .pform-split
     /sell /buy /home-value   intake.php (.pform-split, FAQ beside the form)
     sign-in, forgot, reset   themes/rose _door-login, account-forgot/-reset (.pform)
     listing side card + calculator   homes-detail.php, listing.php, _mortgage.php
   Scoped to .pform, .pform-split and .mcalc, so /account (.member, Felix's
   panels) and the contact modal keep their own rules. Never set field font
   sizes under 16px here: iOS zooms on focus below that. */

/* ── one even inset ───────────────────────────────────────────────────────
   The card's 38px padding plus a first label's 15px top margin put ~60px over
   the first field against 38px at the sides. The first row of labels drops
   that margin so the four insets match. */
.pform .fgrid:first-of-type > div:first-child > label,
.pform > .vd-field:first-of-type > label,
.pform--narrow > label:first-of-type{margin-top:0}
@media(min-width:621px){
  /* a pair on the first row: the second label sits level with the first */
  .pform .fgrid:first-of-type > div:nth-child(2):nth-last-child(odd) > label{margin-top:0}
}

/* ── no lone field in a two-column grid ───────────────────────────────────
   An odd count left Phone (contact) or Timeline (home value) alone beside an
   empty cell. With an odd count the name takes the whole first row, so the
   rest pair up: Email with Phone, Address with Timeline, Price with Areas. */
.pform .fgrid > div:first-child:nth-last-child(odd){grid-column:1 / -1}

/* ── narrow cards: forgot and reset ───────────────────────────────────────
   One or two fields in a 780px card read as a stretched box; 560px matches
   the sign-in card beside them in the account flow. */
.pform--narrow{max-width:560px}

/* ── desktop layout: the form shares its row ─────────────────────────────
   /contact: the page text (lede, phone, email, Instagram) on the left, the
   form card on the right. /sell /buy /home-value: the form on the left, the
   FAQ on the right. Stacked under 1000px, exactly as before. */
.pform-split--contact > .pform{margin-top:34px}
.pform-aside-h{margin:44px 0 12px}
@media(min-width:1000px){
  .pform-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,380px);column-gap:clamp(44px,5vw,80px);align-items:start}
  .pform-split--solo{grid-template-columns:minmax(0,780px)}
  .pform-split .intake{max-width:none}
  .pform-split--contact{grid-template-columns:minmax(280px,380px) minmax(0,1fr)}
  .pform-split--contact > .pform{margin-top:0}
  .pform-split--contact > .page-prose .lede{margin-bottom:22px}
  /* the FAQ's heading lines up with the top of the form card */
  .pform-aside .pform-aside-h{margin-top:0}
  /* a question that wraps in the narrower column keeps its two lines together */
  .pform-aside summary{line-height:1.45}
}

/* ── payment calculator ───────────────────────────────────────────────────
   Measured by its own width, not the window's: the same card is 360px in a
   desktop rail, full width on a tablet, and phone width on a phone. */
.mcalc{container:mcalc / inline-size}

/* a wide card (tablet, under the listing): the rate and the term share a row */
@container mcalc (min-width:441px){
  .mcalc .mc-in > .mc-term{grid-column:auto}
  .mcalc .mc-term legend{line-height:inherit}
}

/* a narrow card (desktop rail, phone): one field per row, so no label wraps
   and every box starts on the same left edge. The down payment's two short
   labels still fit side by side, and stay paired. */
@container mcalc (max-width:440px){
  .mcalc .mc-in{row-gap:16px}
  .mcalc .mc-in > .mc-f:nth-child(n),.mcalc .mc-in > .mc-wide{grid-column:1 / -1}
  .mcalc .mc-in > .mc-f[for="mc-dpct"],.mcalc .mc-in > .mc-f[for="mc-damt"]{grid-column:auto}
  .mcalc .mc-f small{margin-top:1px}
  /* the source line belongs to the rate above it, not to the field below */
  .mcalc .mc-src{margin-top:-6px}
  /* the total: its label over the figure, so neither wraps beside the other */
  .mcalc .mc-sum{flex-direction:column;align-items:flex-start;gap:2px}
  .mcalc .mc-sum b{font-size:28px;line-height:1.15}
}
