/*
 * Result actions on the buyer and seller closing cost calculators.
 *
 * Zeve, Oct 30 2026: the buttons were "all kind of ugly" and copying gave
 * almost no feedback. These follow the site's own button language (.eabc-btn:
 * Hanken Grotesk, uppercase, 6.4px radius, ink / paper / sand tokens) instead
 * of the calculators' original heavy serif blocks.
 *
 * The calculators print their own CSS inside page content, later in the
 * document than this file, with `#ebc-calc .ebc-actions button` (one id). Two
 * ids here (`#ebc-calc #ebc-result …`) win regardless of order, without
 * !important. Their rule also sets font-family: inherit (the page serif), so
 * the button face is named directly rather than through a variable.
 */

#ebc-calc #ebc-result .ebc-actions,
#esc-calc #esc-result .esc-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .75rem;
  max-width: 460px;
  margin: 2rem auto 0;
}

#ebc-calc #ebc-result .ebc-actions button,
#esc-calc #esc-result .esc-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 50px;
  padding: 0 1.1rem;
  border-radius: 6.4px;
  border: 1px solid var(--eabc-ink, #2e2e2f);
  background: var(--eabc-ink, #2e2e2f);
  color: var(--eabc-paper, #fafafa);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
#ebc-calc #ebc-result .ebc-actions button:active,
#esc-calc #esc-result .esc-actions button:active { transform: scale(.97); }
#ebc-calc #ebc-result .ebc-actions button:hover,
#esc-calc #esc-result .esc-actions button:hover { background: #000; border-color: #000; }
#ebc-calc #ebc-result .ebc-actions button:focus-visible,
#esc-calc #esc-result .esc-actions button:focus-visible { outline: 2px solid var(--eabc-ink, #2e2e2f); outline-offset: 3px; }

#ebc-calc #ebc-result .ebc-actions button svg,
#esc-calc #esc-result .esc-actions button svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* Copy link: outlined until it succeeds. */
#ebc-calc #ebc-result .ebc-actions button.ea-calc-share,
#esc-calc #esc-result .esc-actions button.ea-calc-share {
  background: transparent;
  color: var(--eabc-ink, #2e2e2f);
}
#ebc-calc #ebc-result .ebc-actions button.ea-calc-share:hover,
#esc-calc #esc-result .esc-actions button.ea-calc-share:hover { background: var(--eabc-sand, #dbd7ce); border-color: var(--eabc-ink, #2e2e2f); }
#ebc-calc #ebc-result .ebc-actions button.ea-calc-share.is-copied,
#esc-calc #esc-result .esc-actions button.ea-calc-share.is-copied {
  background: var(--eabc-ink, #2e2e2f);
  color: var(--eabc-paper, #fafafa);
}
.ea-calc-share .ea-ico-check { display: none; }
.ea-calc-share.is-copied .ea-ico-link { display: none; }
.ea-calc-share.is-copied .ea-ico-check { display: block; animation: ea-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.ea-calc-share.is-busy { opacity: .7; }
@keyframes ea-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Start over: a quiet text action under the pair, spanning both columns. */
#ebc-calc #ebc-result .ebc-actions button.ea-calc-reset,
#esc-calc #esc-result .esc-actions button.ea-calc-reset {
  grid-column: 1 / -1;
  justify-self: center;
  min-height: 40px;
  padding: 0 .5rem;
  border: 0;
  background: none;
  color: var(--eabc-muted, rgba(0, 0, 0, .58));
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: .08em;
}
#ebc-calc #ebc-result .ebc-actions button.ea-calc-reset:hover,
#esc-calc #esc-result .esc-actions button.ea-calc-reset:hover { background: none; color: var(--eabc-ink, #2e2e2f); }

/* Confirmation under the buttons: shows exactly what was copied. */
.ea-share-toast {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: .85rem;
  color: var(--eabc-ink, #2e2e2f);
  transition: opacity .25s ease, transform .25s ease, max-height .25s ease;
}
.ea-share-toast.is-on { max-height: 60px; opacity: 1; transform: none; }
.ea-share-toast code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  padding: .2rem .45rem;
  border-radius: 4px;
  background: var(--eabc-sand, #dbd7ce);
  word-break: break-all;
}

@media (max-width: 420px) {
  #ebc-calc #ebc-result .ebc-actions button,
  #esc-calc #esc-result .esc-actions button { font-size: .72rem; letter-spacing: .06em; padding: 0 .6rem; gap: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ea-share-toast, .ea-calc-share .ea-ico-check { transition: none; animation: none; }
}


/* ------------------------------------------------------------------
 * Every other button on the two calculators, in the site's own button
 * language (Zeve, Oct 30 2026: "why do we have these square buttons, isn't
 * that not what we use on the entire website"). The calculators' inline CSS
 * uses `#ebc-calc .x` (one id, one class); `body #ebc-calc .x` outranks it
 * whatever the order.
 * ------------------------------------------------------------------ */

/* Top-of-page CTA ("Estimate My Closing Costs" / "Estimate My Net Proceeds")
   and the "Contact Our Team" link: the site's solid .eabc-btn. */
body #ebc-calc .ebc-hero-cta,
body #esc-calc .esc-hero-cta,
body #ebc-calc .ebc-cta a,
body #esc-calc .esc-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 2rem;
  border-radius: 6.4px;
  border: 1px solid var(--eabc-ink, #2e2e2f);
  background: var(--eabc-ink, #2e2e2f);
  color: var(--eabc-paper, #fafafa);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
}
body #ebc-calc .ebc-hero-cta:hover,
body #esc-calc .esc-hero-cta:hover { background: #000; border-color: #000; color: var(--eabc-paper, #fafafa); }
/* On the dark contact panel the button is light, and inverts on hover. */
body #ebc-calc .ebc-cta a,
body #esc-calc .esc-cta a { background: var(--eabc-paper, #fafafa); color: var(--eabc-ink, #2e2e2f); border-color: var(--eabc-paper, #fafafa); }
body #ebc-calc .ebc-cta a:hover,
body #esc-calc .esc-cta a:hover { background: var(--eabc-sand, #dbd7ce); border-color: var(--eabc-sand, #dbd7ce); color: var(--eabc-ink, #2e2e2f); }
body #ebc-calc .ebc-hero-cta:active, body #esc-calc .esc-hero-cta:active,
body #ebc-calc .ebc-cta a:active, body #esc-calc .esc-cta a:active { transform: scale(.97); }
body #ebc-calc .ebc-hero-cta:focus-visible, body #esc-calc .esc-hero-cta:focus-visible,
body #ebc-calc .ebc-cta a:focus-visible, body #esc-calc .esc-cta a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
body #ebc-calc .ebc-cta, body #esc-calc .esc-cta { border-radius: 6.4px; }

/* Answer choices (Condo / Co-op / House, Cash / Financed, ...): the same
   outlined-to-filled pattern as the /buildings neighborhood filter. */
body #ebc-calc .ebc-options-row button,
body #esc-calc .esc-options-row button {
  min-height: 48px;
  padding: 0 1.1rem;
  border-radius: 6.4px;
  border: 1px solid var(--eabc-sand, #dbd7ce);
  background: transparent;
  color: var(--eabc-ink, #2e2e2f);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.2;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
body #ebc-calc .ebc-options-row button:hover,
body #esc-calc .esc-options-row button:hover { background: var(--eabc-sand, #dbd7ce); border-color: var(--eabc-sand, #dbd7ce); }
body #ebc-calc .ebc-options-row button:active,
body #esc-calc .esc-options-row button:active { transform: scale(.98); }
body #ebc-calc .ebc-options-row button:focus-visible,
body #esc-calc .esc-options-row button:focus-visible { outline: 2px solid var(--eabc-ink, #2e2e2f); outline-offset: 2px; }
body #ebc-calc .ebc-options-row button.ebc-active,
body #esc-calc .esc-options-row button.esc-active { background: var(--eabc-ink, #2e2e2f); color: var(--eabc-paper, #fafafa); border-color: var(--eabc-ink, #2e2e2f); }
body #ebc-calc .ebc-options-row button.ebc-active:hover,
body #esc-calc .esc-options-row button.esc-active:hover { background: #000; border-color: #000; }


/* ------------------------------------------------------------------
 * "Send my estimate" (calc-share.js ensureLead): three fields on the dark
 * contact panel under the result. Light-on-dark inputs, the panel's own paper
 * button, and the old Contact link demoted to a text link beneath.
 * ------------------------------------------------------------------ */
body #ebc-calc .ea-calc-lead, body #esc-calc .ea-calc-lead { max-width: 440px; margin: 1.1rem auto 0; text-align: left; }
body #ebc-calc .ebc-cta .ea-calc-lead__lede, body #esc-calc .esc-cta .ea-calc-lead__lede { text-align: center; margin: 0 0 1.1rem; }
.ea-calc-lead__form { display: grid; gap: .8rem; }
.ea-calc-lead__form label { display: grid; gap: .35rem; }
.ea-calc-lead__form label span {
  font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--eabc-paper, #fafafa); opacity: .75;
}
body #ebc-calc .ea-calc-lead__form input, body #esc-calc .ea-calc-lead__form input {
  width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 .9rem;
  border: 1px solid rgba(250, 250, 250, .35); border-radius: 6.4px; background: transparent;
  color: var(--eabc-paper, #fafafa); font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: 1rem;
}
body #ebc-calc .ea-calc-lead__form input:focus, body #esc-calc .ea-calc-lead__form input:focus { outline: none; border-color: var(--eabc-paper, #fafafa); }
body #ebc-calc .ea-calc-lead__form button, body #esc-calc .ea-calc-lead__form button {
  min-height: 50px; margin-top: .3rem; border-radius: 6.4px; border: 1px solid var(--eabc-paper, #fafafa);
  background: var(--eabc-paper, #fafafa); color: var(--eabc-ink, #2e2e2f); cursor: pointer;
  font-family: "Hanken Grotesk", system-ui, sans-serif; font-size: .82rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  transition: background .2s ease, border-color .2s ease, transform .12s ease;
}
body #ebc-calc .ea-calc-lead__form button:hover, body #esc-calc .ea-calc-lead__form button:hover { background: var(--eabc-sand, #dbd7ce); border-color: var(--eabc-sand, #dbd7ce); }
body #ebc-calc .ea-calc-lead__form button:active, body #esc-calc .ea-calc-lead__form button:active { transform: scale(.98); }
body #ebc-calc .ea-calc-lead__form button:focus-visible, body #esc-calc .ea-calc-lead__form button:focus-visible { outline: 2px solid var(--eabc-paper, #fafafa); outline-offset: 3px; }
body #ebc-calc .ebc-cta .ea-calc-lead__done, body #esc-calc .esc-cta .ea-calc-lead__done { text-align: center; opacity: 1; margin: .5rem 0 0; }
body #ebc-calc .ebc-cta a.ea-calc-lead__alt, body #esc-calc .esc-cta a.ea-calc-lead__alt {
  display: inline-block; min-height: 0; margin-top: 1.1rem; padding: 0; border: 0; background: none;
  color: var(--eabc-paper, #fafafa); opacity: .8; font-size: .78rem; letter-spacing: .08em;
  text-decoration: underline; text-underline-offset: 3px;
}
body #ebc-calc .ebc-cta a.ea-calc-lead__alt:hover, body #esc-calc .esc-cta a.ea-calc-lead__alt:hover { background: none; opacity: 1; color: var(--eabc-paper, #fafafa); }
