/*!
 * Bay State Bank — Mortgage Payment Calculator
 * Standalone stylesheet. Version 1.0.0 (2026-08-04)
 *
 * LAYOUT OVERRIDES ONLY. This file deliberately does not restyle typography,
 * buttons, or form chrome — it relies on the site design system already loaded
 * on the page (Bootstrap 5.3 + app.min.css + custom.css) and only adds the
 * grid, chart, and full-screen-dialog rules those files don't know about.
 *
 * Do not add brand colors or font stacks here. If something looks off, the fix
 * almost always belongs in the site CSS, not in this file.
 */

/* ============================================================
   1. CARD — the tile that opens the calculator
   ============================================================ */

/* Section sub-header, above the card (header_sub_header:sub_header field).
   Competing rules in _bankCol.scss and custom.css both use
   .bank-col.products-blue-head p (2 classes + 1 element) — matching just
   the classes here isn't enough, the element selector must be included too
   or this loses on specificity despite loading later in the page. */
.bank-col p.bsb-calc-section-sub {
  font-family: 'Lexend', sans-serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 62px;
  letter-spacing: -0.02em;
  text-align: center;
}

/* Current design: reuses the site's own .help-bar component (same one used
   on the homepage) instead of custom markup, for visual consistency. Only
   the icon needs a size constraint scoped to this card — .help-bar itself
   doesn't cap icon size, it just relies on pre-sized source images, and our
   uploaded icon's native size (95x108) is too large uncapped. */
.bsb-mortgage-card .help-head .icon img {
  height: 60px;
  width: auto;
}

/* Match .help-bar h2's own responsive sizing (_community.scss) exactly.
   Needed because .bank-col.products-blue-head h2 (_bankCol.scss) has higher
   specificity (2 classes + 1 element) than plain ".help-bar h2" (1 class +
   1 element) and wins by default — same fix pattern used elsewhere in this
   file, just carrying .help-bar's own values instead of new ones. */
.bank-col h2.bsb-calc-bar__title {
  font-size: 24px;
}
@media (min-width: 768px) {
  .bank-col h2.bsb-calc-bar__title {
    font-size: 36px;
  }
}
@media (min-width: 992px) {
  .bank-col h2.bsb-calc-bar__title {
    font-size: 50px;
  }
}

.bsb-mortgage-card {
  width: 100%;
  overflow: visible;
}

/* .cta's site-wide default (min-width: 180px) makes this button wider than
   its own padding calls for once it's this short ("Open"). */
.bsb-calc-card__btn {
  min-width: unset;
}

/* ============================================================
   2. MODAL SHELL
   ============================================================ */

/* Light header uses the site's own .yellow-head */
.bsb-calc-modal .modal-header.yellow-head {
  border-bottom: 0;
}
.bsb-calc-modal .modal-body {
  padding: 1.5rem 2rem;
}
@media (max-width: 767px) {
  .bsb-calc-modal .modal-body {
    padding: 1rem 1.25rem;
  }
}

/* Forms inside the modal — talk-form tint without the full-bleed section */
.bsb-calc-modal .talk-form {
  background: transparent;
  margin: 0;
}
.bsb-calc-modal .talk-form .form-wrap {
  padding: 0;
}
.bsb-calc-modal .talk-form .form-control,
.bsb-calc-modal .talk-form .form-select {
  background: #fff;
  border: 1px solid #c5d4e8;
  border-radius: 6px;
}
.bsb-calc-modal .talk-form .input-group-text {
  background: #eff0f4;
  border-color: #c5d4e8;
  color: #454545;
}

/* Compliance disclaimers — custom.css sets p { line-height: 36px } at ≥768px,
   which is far too loose for small legal copy. */
.bsb-calc-modal .bsb-calc-disclaimer,
.bsb-calc-modal .disclosures__content p {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.35;
}
@media (min-width: 768px) {
  .bsb-calc-modal .bsb-calc-disclaimer,
  .bsb-calc-modal .disclosures__content p {
    line-height: 18px;
  }
}

/* ============================================================
   3. FULL-SCREEN DIALOG
   Scoped to data-calc="mortgage-scenarios", which the JS stamps on the modal
   root when it opens. Scoping this way means dropping another calculator into
   the same modal shell later won't inherit the full-screen treatment.
   ============================================================ */

.bsb-calc-modal[data-calc="mortgage-scenarios"] .modal-dialog {
  width: 100vw;
  max-width: none;
  height: 100%;
  margin: 0;
}
.bsb-calc-modal[data-calc="mortgage-scenarios"] .modal-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}

/* Keep content readable on very wide screens — center a comfortable column */
.bsb-calc-modal[data-calc="mortgage-scenarios"] .modal-header.yellow-head > div,
.bsb-calc-modal[data-calc="mortgage-scenarios"] .bsb-mtg-grid,
.bsb-calc-modal[data-calc="mortgage-scenarios"] .modal-footer .disclosures__content {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
@media (min-width: 992px) {
  .bsb-calc-modal[data-calc="mortgage-scenarios"] .modal-body {
    padding: 2.5rem 3rem;
  }
  .bsb-calc-modal[data-calc="mortgage-scenarios"] .bsb-mtg-grid {
    --bs-gutter-x: 4rem;
  }
  .bsb-calc-modal[data-calc="mortgage-scenarios"] .modal-header.yellow-head {
    padding: 1.5rem 3rem;
  }
}

/* ============================================================
   4. RESULTS PANEL
   ============================================================ */

.bsb-mtg-headline {
  font-size: 1.5rem;
  line-height: 1.35;
  color: #454545;
  margin-bottom: 1rem;
}
.bsb-mtg-headline strong {
  color: #002d62;
  white-space: nowrap;
}

.bsb-mtg-ctas {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

/* ============================================================
   5. INPUT COLUMN
   ============================================================ */

.bsb-mtg-section-head {
  color: #002d62;
  font-weight: 600;
  margin-bottom: 1rem;
}

.bsb-mtg-slider {
  accent-color: #3c72b6;
  margin-top: 0.35rem;
}

/* $/% paired input — keep the % box narrow so the $ field stays readable */
.bsb-mtg-field .bsb-mtg-pct {
  max-width: 90px;
  flex: 0 0 90px;
  border-left: 1px solid #dee2e6;
}

/* PMI help bubble */
.bsb-mtg-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e9f5;
  color: #002d62;
  font-size: 12px;
  font-weight: 600;
  cursor: help;
  vertical-align: middle;
}

/* ============================================================
   6. TABS
   ============================================================ */

.bsb-mtg-tabs {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1.25rem;
}
.bsb-mtg-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  color: #454545;
  cursor: pointer;
}
.bsb-mtg-tab.active {
  color: #002d62;
  border-bottom-color: #002d62;
}
.bsb-mtg-tab:focus-visible {
  outline: 2px solid #3c72b6;
  outline-offset: -2px;
}

/* ============================================================
   7. DONUT + LEGEND
   Pure SVG — no chart library anywhere in this package.
   ============================================================ */

.bsb-mtg-donut-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.bsb-mtg-donut {
  position: relative;
  width: 230px;
  max-width: 100%;
  flex: 0 0 auto;
}
.bsb-mtg-donut svg {
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(0deg);
}
.bsb-mtg-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.bsb-mtg-donut-center span {
  font-size: 0.95rem;
  color: #454545;
}
.bsb-mtg-donut-center strong {
  font-size: 1.35rem;
  color: #002d62;
}
.bsb-mtg-legend {
  flex: 1 1 200px;
  min-width: 180px;
  margin-bottom: 0;
}
.bsb-mtg-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.95rem;
}
.bsb-mtg-legend li strong {
  margin-left: auto;
}
/* PMI row when the down payment is 20% or more */
.bsb-mtg-legend-off {
  opacity: 0.45;
}
.bsb-mtg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

/* ============================================================
   8. AMORTIZATION SCHEDULE
   ============================================================ */

.bsb-mtg-schedule {
  max-height: 340px;
  overflow-y: auto;
  overflow-x: auto;
}
.bsb-mtg-schedule table {
  font-size: 0.9rem;
}
.bsb-mtg-schedule thead th {
  position: sticky;
  top: 0;
  background: #fff;
  color: #002d62;
}

/* ============================================================
   9. MOBILE — stack columns, keep touch targets comfortable
   ============================================================ */

@media (max-width: 991px) {
  .bsb-mtg-grid .col-lg-7 {
    margin-top: 1.5rem;
  }
  .bsb-mtg-headline {
    font-size: 1.25rem;
  }
  .bsb-mtg-donut {
    width: 190px;
    margin: 0 auto;
  }
  .bsb-mtg-donut-wrap {
    gap: 1rem;
  }
}
