/*! eLEND Mortgage Calculators v1.2.0
 *
 * Brand tokens live in the first block. Match these to the pulp theme's
 * colors before launch. Fonts inherit from the theme automatically.
 */

.elc {
  --elc-navy: #002253;          /* results panel, selected term */
  --elc-blue: #006FFA;          /* focus, links, slider */
  --elc-ink: #595959;           /* body text */
  --elc-ink-2: #4b5d75;         /* hints, secondary text */
  --elc-line: #CDCDCD;          /* field borders, dividers */
  --elc-field: #ffffff;
  --elc-error: #b42318;
  --elc-seg-pi: #5ea8ff;        /* principal and interest, first mortgage */
  --elc-seg-tax: #b3d8ff;
  --elc-seg-ins: #4fd1c5;
  --elc-seg-pmi: #f6c25b;       /* PMI, second mortgage */
  --elc-seg-hoa: #c9b8ff;
  --elc-radius-field: 10px;
  --elc-radius-panel: 20px;
  --elc-sticky-top: 162px;      /* raise this if the theme header is sticky */

  font-family: inherit;
  color: var(--elc-ink);
  font-size: 16px;
  line-height: 1.5;
  max-width: 1120px;
  margin: 0 auto;
  text-align: left;
}

/* The shortcode sits outside the theme's padded container, so match its side padding. */
.elc {
  box-sizing: content-box;
  padding-left: var(--container-padding, 24px);
  padding-right: var(--container-padding, 24px);
}

.elc:not(.elc--ready) { min-height: 560px; }
.elc *, .elc *::before, .elc *::after { box-sizing: border-box; }
.elc [hidden] { display: none !important; }

/* ---------- Layout ---------- */

.elc__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

@media (min-width: 900px) {
  .elc__layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 56px;
  }
  .elc__results {
    position: sticky;
    top: var(--elc-sticky-top);
  }
}

.elc .elc__inputs { margin: 0; padding: 0; }

.elc-group { margin: 0; padding: 0; }
.elc-group + .elc-group {
  border-top: 1px solid var(--elc-line);
  margin-top: 8px;
  padding-top: 28px;
}

.elc .elc-group__title {
  font-family: inherit;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--elc-ink);
  margin: 0 0 18px;
  padding: 0;
}

.elc-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

@media (max-width: 560px) {
  .elc-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Fields ---------- */

.elc-field { margin: 0 0 20px; min-width: 0; }

.elc .elc-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--elc-ink);
  margin: 0 0 7px;
  padding: 0;
  text-transform: none;
  letter-spacing: 0;
}

.elc-input {
  display: flex;
  align-items: center;
  background: var(--elc-field);
  border: 1.5px solid var(--elc-line);
  border-radius: var(--elc-radius-field);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.elc-input:hover { border-color: #b6c4d6; }

.elc-input:focus-within {
  border-color: var(--elc-blue);
  box-shadow: 0 0 0 3px rgb(22 99 199 / 0.18);
}

.elc-input.is-invalid,
.elc-seg.is-invalid .elc-seg__opt span { border-color: var(--elc-error); }

.elc .elc-input input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 13px 14px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--elc-ink);
  font-variant-numeric: tabular-nums;
}

.elc-affix {
  flex: none;
  padding: 0 14px;
  color: var(--elc-ink-2);
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}

.elc-input--prefix > .elc-affix:first-child { padding-right: 0; }
.elc .elc-input--prefix input { padding-left: 6px; }
.elc-input--suffix > .elc-affix:last-child,
.elc-affix--end { padding-left: 0; font-weight: 500; }

.elc-msg {
  margin: 7px 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--elc-ink-2);
}
.elc-msg:empty { display: none; }
.elc-msg.is-error { color: var(--elc-error); font-weight: 600; }

/* Down payment: dollars and percent stay in sync */
.elc-down {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.elc .elc-range {
  display: block;
  width: 100%;
  height: 28px;
  margin: 10px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  accent-color: var(--elc-blue);
  cursor: pointer;
}

/* ---------- Term selector ---------- */

.elc-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.elc .elc-seg__opt {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font-weight: inherit;
}

.elc .elc-seg__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.elc-seg__opt span {
  display: inline-block;
  min-width: 64px;
  padding: 10px 16px;
  border: 1.5px solid var(--elc-line);
  border-radius: 999px;
  background: var(--elc-field);
  color: var(--elc-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.elc-seg__opt:hover span { border-color: var(--elc-blue); }

.elc-seg__opt input:checked + span {
  background: var(--elc-navy);
  border-color: var(--elc-navy);
  color: #fff;
}

.elc-seg__opt input:focus-visible + span {
  outline: 3px solid var(--elc-blue);
  outline-offset: 2px;
}

.elc-seg__custom { margin-top: 10px; max-width: 200px; }

/* ---------- Toggle switch ---------- */

.elc-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--elc-ink);
}
.elc .elc-switch input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: var(--elc-line);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.elc .elc-switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform 0.15s ease;
}
.elc .elc-switch input:checked { background: var(--elc-navy); }
.elc .elc-switch input:checked::after { transform: translateX(18px); }
.elc .elc-switch input:focus-visible { outline: 3px solid var(--elc-blue); outline-offset: 2px; }

/* ---------- Actions ---------- */

.elc-actions { margin-top: 4px; }

.elc .elc-reset {
  display: inline-block;
  margin: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--elc-blue);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.elc .elc-reset:hover { color: var(--elc-navy); }
.elc .elc-reset:focus-visible { outline: 3px solid var(--elc-blue); outline-offset: 3px; border-radius: 4px; }

/* ---------- Results panel ---------- */

.elc__results {
  background: var(--elc-navy);
  color: #fff;
  border-radius: var(--elc-radius-panel);
  padding: 28px 24px 26px;
  outline: none;
}

@media (min-width: 900px) {
  .elc__results { padding: 34px 34px 30px; }
}

.elc .elc__results-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgb(255 255 255 / 0.8);
}

.elc .elc__total {
  margin: 4px 0 22px;
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.elc__total small {
  margin-left: 4px;
  font-size: 0.38em;
  font-weight: 600;
  letter-spacing: 0;
  color: rgb(255 255 255 / 0.7);
}

.elc-rate {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: -6px 0 24px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.09);
}
.elc-rate span { color: rgb(255 255 255 / 0.85); font-weight: 500; }
.elc-rate strong { font-size: 1.625rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; }

.elc .elc-bar-label {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: rgb(255 255 255 / 0.72);
}

.elc-bar {
  display: flex;
  gap: 3px;
  height: 12px;
  margin: 0 0 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.12);
}

.elc-bar span {
  display: block;
  flex: 0 1 0;
  min-width: 4px;
  height: 100%;
  transition: flex-grow 0.35s ease;
}

.elc .elc-rows { margin: 0; padding: 0; }

.elc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.12);
  font-size: 0.9375rem;
}
.elc-row:last-child { border-bottom: 0; }

.elc .elc-row dt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 500;
  color: rgb(255 255 255 / 0.86);
}

.elc .elc-row dd {
  margin: 0;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.elc-swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }

.elc .elc-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
}

@media (max-width: 420px) {
  .elc .elc-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.elc-fact {
  padding: 12px 12px 11px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.08);
}
.elc .elc-fact dt { margin: 0 0 2px; font-size: 0.8125rem; color: rgb(255 255 255 / 0.72); }
.elc .elc-fact dd { margin: 0; font-size: 1rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

.elc .elc-note {
  margin: 16px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgb(255 255 255 / 0.8);
}

/* Blended rate explainer */
.elc-math {
  margin-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  padding-top: 12px;
}
.elc-math summary {
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  list-style-position: inside;
}
.elc-math summary:focus-visible { outline: 3px solid #9fd0ff; outline-offset: 3px; border-radius: 4px; }
.elc .elc-math p { margin: 10px 0 0; font-size: 0.875rem; line-height: 1.55; color: rgb(255 255 255 / 0.82); }
.elc .elc-math__formula {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Calls to action */
.elc-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.elc .elc-btn {
  flex: 1 1 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 13px 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.elc .elc-btn--primary { background: #fff; color: var(--elc-navy); }
.elc .elc-btn--primary:hover { background: #e4eefb; color: var(--elc-navy); }
.elc .elc-btn--ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.45); }
.elc .elc-btn--ghost:hover { border-color: #fff; color: #fff; }
.elc .elc-btn:focus-visible { outline: 3px solid #9fd0ff; outline-offset: 2px; }

/* ---------- Payment schedule ---------- */

.elc-sched {
  margin-top: 32px;
  border: 1.5px solid var(--elc-line);
  border-radius: 14px;
  background: #fff;
}

.elc-sched summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  color: var(--elc-ink);
}
.elc-sched summary::-webkit-details-marker { display: none; }
.elc-sched summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--elc-blue); }
.elc-sched[open] summary::after { content: "\2212"; }
.elc-sched summary:focus-visible { outline: 3px solid var(--elc-blue); outline-offset: 2px; border-radius: 12px; }

.elc-table-wrap {
  max-height: 440px;
  overflow: auto;
  margin: 0 22px;
  border-top: 1px solid var(--elc-line);
}

.elc .elc-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.elc .elc-table th,
.elc .elc-table td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e7edf4;
  background: none;
  color: var(--elc-ink);
  text-align: right;
  white-space: nowrap;
}
.elc .elc-table th:first-child,
.elc .elc-table td:first-child { text-align: left; padding-left: 0; }
.elc .elc-table th:last-child,
.elc .elc-table td:last-child { padding-right: 0; }

.elc .elc-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--elc-ink-2);
}

.elc-muted { color: var(--elc-ink-2); font-weight: 400; }
.elc .elc-sched__note { margin: 0; padding: 14px 22px 18px; font-size: 0.8125rem; color: var(--elc-ink-2); }

/* ---------- Disclaimer ---------- */

.elc .elc-disclaimer {
  max-width: 82ch;
  margin: 28px 0 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--elc-ink-2);
}

/* ---------- Mobile payment bar ---------- */

.elc-sticky {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 18px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 16px;
  background: var(--elc-navy);
  color: #fff;
  box-shadow: 0 12px 32px rgb(11 42 85 / 0.35);
  transform: translateY(160%);
  transition: transform 0.25s ease;
}
.elc-sticky.is-visible { transform: translateY(0); }
.elc-sticky__label { font-size: 0.8125rem; line-height: 1.2; color: rgb(255 255 255 / 0.75); }
.elc-sticky__value { font-size: 1.25rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }

.elc .elc-sticky__btn {
  margin: 0 0 0 auto;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--elc-navy);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

@media (min-width: 900px) {
  .elc-sticky { display: none; }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  .elc *, .elc-sticky { transition: none !important; }
}

@media print {
  .elc-sticky, .elc-cta, .elc-actions, .elc .elc-range { display: none !important; }
  .elc__results { background: #fff; color: #000; border: 1px solid #999; }
}

/* ---------- Page header with mascot ----------
 * Used inside the theme's hero block content on calculator pages:
 * <div class="elc-hero"><div class="elc-hero__text"><h1>…</h1><p>…</p></div>
 *   <figure class="elc-hero__art"><img class="elc-hero__mascot" …></figure></div>
 * Title lines up with the form column, mascot with the results column.
 */

.elc-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 1120px;
  margin: 0 auto;
}

.elc-hero__text { min-width: 0; text-align: left; }
.elc-hero__text h1 { margin: 0 0 10px; text-align: left; }
.elc-hero__text p { margin: 0; max-width: 64ch; text-align: left; }

.elc-hero__art {
  flex: none;
  margin: 0;
  padding: 0;
}

.wp-block-pulp-general-block .elc-hero__mascot,
.elc-hero__mascot {
  display: block;
  width: clamp(128px, 12vw, 168px);
  height: auto;
  margin: 0;
  border-radius: 0;
  filter: drop-shadow(0 12px 20px rgb(0 34 83 / 0.18));
}

@media (max-width: 700px) {
  .elc-hero { flex-direction: column; justify-content: center; gap: 14px; }
  .elc-hero__art { order: -1; }
  .elc-hero__text,
  .elc-hero__text h1,
  .elc-hero__text p { text-align: center; }
  .elc-hero__text p { margin: 0 auto; }
  .wp-block-pulp-general-block .elc-hero__mascot,
  .elc-hero__mascot { width: 108px; }
}

/* ---------- Theme overrides ----------
 * The pulp theme styles every input, select, and label with !important
 * (components/forms.scss), so these resets need !important too.
 */

.elc .elc-input input {
  height: auto !important;
  margin: 0 !important;
  padding: 13px 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 1.0625rem !important;
}
.elc .elc-input--prefix input { padding-left: 6px !important; }

.elc .elc-range {
  height: 28px !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.elc .elc-seg__opt input {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.elc .elc-label {
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
}
.elc .elc-seg__opt {
  font-size: inherit !important;
  font-weight: inherit !important;
}

.elc .elc-switch {
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
}
.elc .elc-switch input {
  width: 44px !important;
  height: 26px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--elc-line) !important;
}
.elc .elc-switch input:checked { background: var(--elc-navy) !important; }

@media (prefers-reduced-motion: reduce) {
  .elc .elc-switch input::after { transition: none !important; }
}

/* Keep all term options on one row on phones */
@media (max-width: 560px) {
  .elc-seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .elc .elc-seg__opt { display: block; }
  .elc-seg__opt span { display: block; min-width: 0; padding: 11px 2px; font-size: 0.875rem; }
}
