/* The quick-estimate form (js/estimate-form.js): on /estimate and in the homepage's estimate section */
html { scroll-padding-top: 96px; } /* keeps focused fields clear of the sticky header */

.est-card { max-width: 500px; margin: 0 auto; --ink-fg-muted: rgba(27, 26, 25, 0.64); } /* quiet text clears AA on paper */
.est-form { background: var(--ink-paper); border: 1px solid var(--ink-hairline); border-radius: var(--ink-radius-md); padding: 32px 32px 28px; display: flex; flex-direction: column; gap: 22px; box-shadow: 0 1px 0 rgba(27, 26, 25, 0.02), 0 24px 60px -40px rgba(27, 26, 25, 0.25); }
@media (max-width: 600px) { .est-form { padding: 24px 18px 22px; } }
.est-form[hidden] { display: none; }

/* Where you are: the step's name, its number, a thin bar */
.est-head { display: grid; gap: 12px; }
.est-head__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.est-head__title { margin: 0; font-family: inherit; font-weight: 400; font-size: 17px; color: var(--ink-carbon); }
.est-head__title:focus { outline: none; } /* focused only to be read out after Back */
.est-head__count { font-size: 13px; color: var(--ink-fg-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.est-progress { height: 4px; border-radius: 4px; background: var(--ink-hairline); overflow: hidden; }
.est-progress i { display: block; height: 100%; width: 33.34%; background: var(--ink-carbon); border-radius: 4px; transition: width 260ms ease; }
.est-form[data-step="2"] .est-progress i { width: 66.67%; }
.est-form[data-step="3"] .est-progress i { width: 100%; }
@media (prefers-reduced-motion: reduce) { .est-progress i { transition: none; } }

.est-step { display: flex; flex-direction: column; gap: 20px; }
.est-step[hidden] { display: none; }
.est-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .est-row { grid-template-columns: 1fr; } }
.est-field { display: flex; flex-direction: column; min-width: 0; }
.est-field .ink-label { margin-bottom: 8px; }
.est-field__hint { font-size: 12.5px; color: var(--ink-fg-muted); margin-top: 6px; line-height: 1.5; }
.est-field__hint[hidden] { display: none; }
.est-opt { font-size: 12px; color: var(--ink-fg-muted); font-weight: 400; letter-spacing: 0; text-transform: none; }
/* A label with a one-tap answer beside it ("Not chosen yet", "No one") */
.est-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.est-field .est-label-row .ink-label { margin-bottom: 0; }
.est-quick { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--ink-binder-blue); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; white-space: nowrap; }
.est-quick:hover { color: var(--ink-carbon); }

/* Inputs with a unit inside the box (%, x) */
.est-affix { position: relative; }
.est-affix .ink-input { padding-right: 40px; }
.est-affix .ink-input:focus { padding-right: 39.5px; }
.est-affix__unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-fg-muted); font-size: 15px; pointer-events: none; }

/* Choice buttons (loan type, rate type) */
.est-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.est-choice { position: relative; }
.est-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.est-choice span {
  display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border: 1px solid var(--ink-hairline); border-radius: var(--ink-radius-pill);
  background: var(--ink-paper); font-size: 14.5px; color: var(--ink-carbon); cursor: pointer; transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.est-choice span:hover { border-color: var(--ink-carbon); }
.est-choice input:checked + span { background: var(--ink-carbon); border-color: var(--ink-carbon); color: var(--ink-paper); }
.est-choice input:focus-visible + span { outline: 2px solid var(--ink-binder-blue); outline-offset: 2px; }
.est-choices[aria-invalid="true"] .est-choice span { border-color: #9b1f1f; }
/* Beside a text box (rate type): the same height, sharing the width */
.est-choices--fill { flex-wrap: nowrap; }
.est-choices--fill .est-choice { flex: 1 1 0; }
.est-choices--fill .est-choice span { width: 100%; height: 48px; justify-content: center; padding: 0 12px; }

/* Industry search, the same as the default-rates tool: pills for each pick, then the search box */
.est-ind { position: relative; }
.est-ind__box {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 48px; padding: 5px 8px; cursor: text;
  background: var(--ink-paper); border: 1px solid var(--ink-hairline); border-radius: var(--ink-radius-sm); transition: border-color 160ms ease, box-shadow 160ms ease;
}
.est-ind__box:focus-within { border-color: var(--ink-binder-blue); box-shadow: 0 0 0 1px var(--ink-binder-blue); }
.est-ind__box:has(.est-ind__input[aria-invalid="true"]) { border-color: #9b1f1f; box-shadow: 0 0 0 0.5px #9b1f1f; }
.est-ind__input { flex: 1 1 140px; min-width: 120px; height: 36px; border: 0; outline: 0; background: transparent; padding: 0 8px; font: inherit; font-size: var(--ink-body); color: var(--ink-carbon); }
.est-ind__input::placeholder { color: var(--ink-fg-quiet); }
.est-tok { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; background: var(--ink-carbon); color: var(--ink-paper); border-radius: 999px; padding: 6px 6px 6px 13px; font-size: 13.5px; line-height: 1.2; }
.est-tok__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26ch; }
.est-tok__code { color: rgba(247, 245, 241, 0.55); font-size: 12px; }
.est-tok__x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(247, 245, 241, 0.16); color: var(--ink-paper); font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.est-tok__x:hover { background: rgba(247, 245, 241, 0.34); }
@media (max-width: 480px) { .est-tok__label { max-width: 16ch; } }
.est-ind__results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow-y: auto;
  background: #fff; border: 1px solid var(--ink-hairline); border-radius: var(--ink-radius-md); box-shadow: 0 18px 48px rgba(27, 26, 25, 0.14);
}
.est-ind__results[hidden] { display: none; }
.est-ind__results li { padding: 10px 12px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.est-ind__results li.is-active { background: var(--ink-vellum); }
.est-ind__results li.is-empty { color: var(--ink-fg-muted); cursor: default; font-size: 14px; }
.est-opt__title { font-size: 15px; color: var(--ink-carbon); }
.est-opt__meta { font-size: 12px; color: var(--ink-fg-muted); }

/* Suggestions under a field (address, lender) */
.est-ac { position: relative; }
.est-ac__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid var(--ink-hairline); border-radius: var(--ink-radius-md); box-shadow: 0 18px 48px rgba(27, 26, 25, 0.14);
}
.est-ac__list[hidden] { display: none; }
.est-ac__list li[role="option"] { padding: 10px 12px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.est-ac__list li.is-active { background: var(--ink-vellum); }
.est-ac__main { font-size: 15px; color: var(--ink-carbon); }
.est-ac__sub { font-size: 12px; color: var(--ink-fg-muted); }
.est-ac__foot { padding: 6px 12px 2px; font-size: 11px; color: var(--ink-fg-quiet); }
.est-ac__foot a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }


/* Actions */
.est-actions { display: flex; flex-direction: column; gap: 12px; }
.est-actions .ink-btn { width: 100%; justify-content: center; }
.est-back { align-self: center; border: 0; background: none; padding: 4px; font: inherit; font-size: 14px; color: var(--ink-fg-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.est-back:hover { color: var(--ink-carbon); }
.est-fine { margin: 0; text-align: center; font-size: 13px; color: var(--ink-fg-muted); }
.est-submit__fine { font-size: 12px; line-height: 1.55; color: var(--ink-fg-muted); margin: 0; text-align: center; }
.est-submit__error { font-size: 14px; color: #9b1f1f; margin: 0; }
.est-email-fix { margin-top: 6px; font-size: 13px; color: var(--ink-carbon); }
.est-email-fix button, .est-draft button { border: 0; background: none; padding: 0; font: inherit; color: var(--ink-binder-blue); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.est-draft { margin: 0; font-size: 13px; color: var(--ink-fg-muted); }
.est-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.est-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Sent */
.est-done { background: var(--ink-paper); border: 1px solid var(--ink-carbon); border-radius: var(--ink-radius-md); padding: 36px 32px; }
@media (max-width: 600px) { .est-done { padding: 28px 20px; } }
.est-done:focus { outline: none; }
.est-done__title { font-family: var(--ink-serif); font-size: 28px; line-height: 1.15; margin: 0 0 14px; font-weight: 400; }
.est-done__body { font-size: 16px; line-height: 1.6; color: var(--ink-fg-muted); margin: 0 0 12px; }
.est-done__body em { font-style: normal; color: var(--ink-carbon); overflow-wrap: anywhere; }
.est-done__next { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--ink-hairline); }
.est-done__next .ink-btn { max-width: 100%; white-space: normal; height: auto; min-height: 36px; padding-top: 8px; padding-bottom: 8px; line-height: 1.3; text-align: center; }
.est-done__fix { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; color: var(--ink-fg-muted); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.est-done__link { font-size: 14px; color: var(--ink-carbon); text-decoration: underline; text-underline-offset: 0.15em; }
