/* Calculator microsite — shared chrome on top of portal.css
 * Defines: calc-page shell (sidebar + main), promo card, results panel,
 *          amortization table, pie chart, marketing header for landing,
 *          and landing-specific long-form layout.
 */

/* =========================================================
 * APP SHELL — sidebar + main
 * ========================================================= */
.calc-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--ls-neutral-100);
  color: var(--ls-fg);
}

.calc-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 28px 18px 24px;
  border-right: 1px solid var(--ls-border);
  background: var(--ls-neutral-0);
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}
.calc-rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.calc-rail__brand img { height: 26px; display: block; }

.calc-rail__group { display: flex; flex-direction: column; gap: 2px; }
.calc-rail__group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
  padding: 0 12px;
  margin-bottom: 6px;
}
.calc-rail__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ls-fg);
  text-decoration: none;
  transition: background var(--ls-transition-color), color var(--ls-transition-color);
}
.calc-rail__link svg { width: 16px; height: 16px; color: var(--ls-fg-mute); flex-shrink: 0; }
.calc-rail__link:hover {
  background: var(--ls-neutral-100);
  text-decoration: none;
}
.calc-rail__link--active {
  background: var(--ls-brand-100);
  color: var(--ls-brand-300);
  font-weight: 600;
}
.calc-rail__link--active svg { color: var(--ls-brand-300); }

.calc-rail__footer {
  margin-top: auto;
  padding: 0 12px;
  font-size: 11px;
  color: var(--ls-fg-mute);
  line-height: 1.5;
}
.calc-rail__footer a { color: var(--ls-fg-soft); }

/* =========================================================
 * APP BAR (top of calc page)
 * ========================================================= */
.calc-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 32px;
  background: var(--ls-neutral-0);
  border-bottom: 1px solid var(--ls-border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.calc-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ls-fg-soft);
}
.calc-crumbs a {
  color: var(--ls-fg-soft);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.calc-crumbs a:hover { color: var(--ls-brand-300); text-decoration: none; }
.calc-crumbs svg { width: 12px; height: 12px; color: var(--ls-fg-mute); }
.calc-crumbs__current { color: var(--ls-fg); font-weight: 500; }
.calc-appbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================
 * PAGE BODY
 * ========================================================= */
.calc-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.calc-page {
  padding: 32px 32px 64px;
  max-width: 1320px;
  width: 100%;
}
.calc-pagehead {
  margin-bottom: 28px;
}
.calc-pagehead__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-brand-300);
  margin-bottom: 8px;
}
.calc-pagehead h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 10px;
}
.calc-pagehead p {
  font-size: 15px;
  color: var(--ls-fg-soft);
  line-height: 1.55;
  max-width: 720px;
  margin: 0;
}

/* =========================================================
 * TWO-COLUMN LAYOUT (inputs + results)
 * ========================================================= */
.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.calc-grid--wide { grid-template-columns: minmax(0, 1fr) 380px; }
.calc-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* =========================================================
 * CARD VARIANTS
 * ========================================================= */
.calc-card {
  background: var(--ls-neutral-0);
  border: 1px solid var(--ls-border);
  border-radius: 12px;
  overflow: hidden;
}
.calc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ls-border);
}
.calc-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ls-fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.calc-card__title svg { width: 16px; height: 16px; color: var(--ls-fg-soft); }
.calc-card__body { padding: 20px; }
.calc-card__body--flush { padding: 0; }

/* Subtle group card inside main card */
.calc-fieldgroup {
  padding: 18px 20px;
  border-bottom: 1px solid var(--ls-border);
}
.calc-fieldgroup:last-child { border-bottom: none; }
.calc-fieldgroup__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
  margin-bottom: 14px;
}

/* =========================================================
 * FIELD ROWS
 * ========================================================= */
.calc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.calc-fields--single { grid-template-columns: 1fr; }
.calc-fields--three  { grid-template-columns: repeat(3, 1fr); }
.calc-field-span-2 { grid-column: span 2; }

/* Field — label above input with optional prefix/suffix */
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ls-fg);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.calc-field__label .calc-info { width: 13px; height: 13px; color: var(--ls-fg-mute); }
.calc-field__hint {
  font-size: 11px;
  color: var(--ls-fg-mute);
}
.calc-input,
.calc-select {
  width: 100%;
  box-sizing: border-box;
  font: 400 14px var(--ls-font-sans);
  padding: 9px 12px;
  border: 1px solid var(--ls-border);
  border-radius: 8px;
  background: var(--ls-neutral-0);
  color: var(--ls-fg);
  outline: none;
  transition: border-color var(--ls-transition-color), box-shadow var(--ls-transition-color);
}
.calc-input:focus, .calc-select:focus {
  border-color: var(--ls-brand-300);
  box-shadow: 0 0 0 4px var(--ls-brand-100);
}
.calc-input:disabled, .calc-input--readout {
  background: var(--ls-neutral-100);
  color: var(--ls-fg);
}

.calc-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230A152F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.calc-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.calc-input-group__prefix,
.calc-input-group__suffix {
  position: absolute;
  font-size: 13px;
  color: var(--ls-fg-mute);
  pointer-events: none;
  font-weight: 500;
}
.calc-input-group__prefix { left: 12px; }
.calc-input-group__suffix { right: 12px; }
.calc-input-group--prefix .calc-input { padding-left: 28px; }
.calc-input-group--suffix .calc-input { padding-right: 28px; }

.calc-combo {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}

/* Radio row (Monthly / Yearly) */
.calc-radios {
  display: inline-flex;
  gap: 14px;
  margin-top: 4px;
}
.calc-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ls-fg);
  cursor: pointer;
}
.calc-radio__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ls-border);
  background: var(--ls-neutral-0);
  position: relative;
  flex-shrink: 0;
}
.calc-radio--active .calc-radio__dot { border-color: var(--ls-brand-300); }
.calc-radio--active .calc-radio__dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--ls-brand-300);
}

/* Checkbox row */
.calc-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ls-fg);
  cursor: pointer;
  font-weight: 500;
}
.calc-check__box {
  width: 16px;
  height: 16px;
  border: 1px solid var(--ls-border);
  border-radius: 4px;
  background: var(--ls-neutral-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.calc-check__box svg { width: 11px; height: 11px; color: var(--ls-neutral-0); opacity: 0; }
.calc-check--checked .calc-check__box {
  background: var(--ls-brand-300);
  border-color: var(--ls-brand-300);
}
.calc-check--checked .calc-check__box svg { opacity: 1; }

/* Action row */
.calc-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--ls-border);
  background: var(--ls-neutral-100);
  border-radius: 0 0 11px 11px;
}

/* =========================================================
 * BUTTONS
 * ========================================================= */
.calc-btn {
  font: 600 14px var(--ls-font-sans);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--ls-transition-color), border-color var(--ls-transition-color);
  white-space: nowrap;
}
.calc-btn svg { width: 14px; height: 14px; }
.calc-btn--primary {
  background: var(--ls-brand-300);
  color: var(--ls-neutral-0);
}
.calc-btn--primary:hover { background: #0150D6; }
.calc-btn--secondary {
  background: var(--ls-neutral-0);
  color: var(--ls-fg);
  border-color: var(--ls-border);
}
.calc-btn--secondary:hover { background: var(--ls-neutral-100); border-color: var(--ls-brand-200); }
.calc-btn--ghost {
  background: transparent;
  color: var(--ls-fg-soft);
}
.calc-btn--ghost:hover { color: var(--ls-fg); background: var(--ls-neutral-100); }
.calc-btn--block { width: 100%; }

/* =========================================================
 * RESULTS — Summary card with big stat hero
 * ========================================================= */
.calc-summary {
  background: var(--ls-neutral-0);
  border: 1px solid var(--ls-border);
  border-radius: 12px;
  overflow: hidden;
}
.calc-summary__hero {
  padding: 22px 24px 20px;
  background: var(--ls-neutral-100);
  border-bottom: 1px solid var(--ls-border);
}
.calc-summary__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
  margin-bottom: 6px;
}
.calc-summary__value {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ls-fg);
  line-height: 1.1;
}
.calc-summary__sub {
  font-size: 12px;
  color: var(--ls-fg-soft);
  margin-top: 4px;
}
.calc-summary__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 8px;
}
.calc-summary__kv {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  gap: 2px;
}
.calc-summary__kv-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
}
.calc-summary__kv-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--ls-fg);
  font-variant-numeric: tabular-nums;
}

/* DSCR-style summary (single column dense list) */
.calc-summary__list {
  padding: 6px 0;
}
.calc-summary__list-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 20px;
  font-size: 14px;
  gap: 12px;
}
.calc-summary__list-row + .calc-summary__list-row {
  border-top: 1px dashed var(--ls-border);
}
.calc-summary__list-label {
  color: var(--ls-fg-soft);
}
.calc-summary__list-value {
  font-weight: 600;
  color: var(--ls-fg);
  font-variant-numeric: tabular-nums;
}

/* DSCR chip on hero */
.calc-dscr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ls-status-success-bg);
  color: var(--ls-status-success-ink);
  border: 1px solid rgba(36,100,43,0.18);
}

/* =========================================================
 * PIE CHART (CSS conic)
 * ========================================================= */
.calc-pie {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 8px 4px;
}
.calc-pie__svg {
  width: 200px;
  height: 200px;
  display: block;
}
.calc-pie__legend {
  display: flex;
  gap: 24px;
  font-size: 13px;
}
.calc-pie__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ls-fg);
}
.calc-pie__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.calc-pie__legend-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.calc-pie__legend-meta b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.calc-pie__legend-meta span {
  font-size: 11px;
  color: var(--ls-fg-mute);
}

/* =========================================================
 * AMORTIZATION TABLE
 * ========================================================= */
.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.calc-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
  padding: 12px 16px;
  background: var(--ls-neutral-100);
  border-bottom: 1px solid var(--ls-border);
  white-space: nowrap;
}
.calc-table thead th:not(:first-child):not(:nth-child(2)) { text-align: right; }
.calc-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ls-border);
  color: var(--ls-fg);
}
.calc-table tbody td:not(:first-child):not(:nth-child(2)) { text-align: right; }
.calc-table tbody tr:nth-child(even) td { background: var(--ls-neutral-100); }
.calc-table tbody tr:last-child td { border-bottom: none; }
.calc-table__pmt-num { font-weight: 600; color: var(--ls-fg-soft); }
.calc-table__milestone td { background: var(--ls-brand-100) !important; font-weight: 600; }

.calc-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ls-border);
  font-size: 13px;
  color: var(--ls-fg-soft);
}

/* =========================================================
 * INFO BANNER (term loan note)
 * ========================================================= */
.calc-info-banner {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ls-brand-100);
  border: 1px solid var(--ls-brand-200);
  border-radius: 10px;
  margin: 16px 20px 20px;
}
.calc-info-banner svg {
  width: 18px;
  height: 18px;
  color: var(--ls-brand-300);
  flex-shrink: 0;
  margin-top: 2px;
}
.calc-info-banner__body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ls-fg);
}
.calc-info-banner__body b { font-weight: 600; }

/* =========================================================
 * AD / PROMO SLOT (redesigned)
 * ========================================================= */
.calc-promo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ls-brand-200);
  background:
    radial-gradient(circle at 0% 100%, rgba(7,178,250,0.35), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.45), transparent 60%),
    linear-gradient(180deg, #0160FF 0%, #013ED6 100%);
  color: var(--ls-neutral-0);
  display: flex;
  flex-direction: column;
  padding: 18px 18px 0;
  min-height: 320px;
}
.calc-promo__tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.calc-promo__tag::before {
  content: "";
  width: 14px;
  height: 1px;
  background: rgba(255,255,255,0.5);
}
.calc-promo__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.calc-promo__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-promo__bullets li {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.calc-promo__bullets li::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--ls-brand-spark-cyan);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}
.calc-promo__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ls-fg);
  background: var(--ls-neutral-0);
  border-radius: 8px;
  text-decoration: none;
  align-self: flex-start;
}
.calc-promo__cta:hover { background: var(--ls-neutral-100); text-decoration: none; }
.calc-promo__cta svg { width: 13px; height: 13px; }
.calc-promo__art {
  margin-top: auto;
  align-self: flex-end;
  width: 70%;
  max-width: 220px;
  margin-right: -12px;
  margin-bottom: -2px;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.18));
}
.calc-promo__partner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--ls-neutral-0);
  margin: 12px -18px 0;
  border-top: 1px solid rgba(255,255,255,0.3);
}
.calc-promo__partner-label {
  font-size: 11px;
  color: var(--ls-fg-mute);
  font-weight: 500;
}
.calc-promo__partner img { height: 16px; display: block; }

.calc-promo--slot {
  /* When you have a real creative, pop in an <img> + class .calc-promo--image */
}

/* =========================================================
 * FOOTER (used on all pages)
 * ========================================================= */
.calc-foot {
  padding: 32px 32px 56px;
  font-size: 12px;
  color: var(--ls-fg-mute);
  line-height: 1.55;
  max-width: 1320px;
}
.calc-foot__disclaimer {
  background: var(--ls-neutral-0);
  border: 1px solid var(--ls-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.calc-foot__copy {
  text-align: center;
}

/* =========================================================
 * LANDING-SPECIFIC (marketing chrome)
 * ========================================================= */
.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 56px;
  border-bottom: 1px solid var(--ls-border);
  background: var(--ls-neutral-0);
  position: sticky;
  top: 0;
  z-index: 10;
}
.land-nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.land-nav__links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ls-fg);
  text-decoration: none;
  cursor: pointer;
}
.land-nav__cta { display: flex; align-items: center; gap: 16px; }

.land-hero {
  position: relative;
  padding: 80px 40px 96px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(7,178,250,0.18), transparent 70%),
    linear-gradient(180deg, #0160FF 0%, #0247C9 100%);
  color: var(--ls-neutral-0);
  overflow: hidden;
}
.land-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
}
.land-hero > * { position: relative; z-index: 1; }
.land-hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
}
.land-hero h1 {
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--ls-neutral-0);
}
.land-hero p {
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  margin: 0 auto;
}

.land-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Calculator card grid */
.land-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: -56px;
  position: relative;
  z-index: 2;
}
.land-card {
  background: var(--ls-neutral-0);
  border: 1px solid var(--ls-border);
  border-radius: 16px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--ls-shadow-lg);
  transition: transform var(--ls-transition-transform), border-color var(--ls-transition-color);
}
.land-card:hover {
  transform: translateY(-2px);
  border-color: var(--ls-brand-200);
}
.land-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--ls-brand-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ls-neutral-0);
}
.land-card__icon svg { width: 22px; height: 22px; }
.land-card__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-brand-300);
}
.land-card__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ls-fg);
  line-height: 1.15;
}
.land-card__desc {
  font-size: 14px;
  color: var(--ls-fg-soft);
  line-height: 1.55;
  flex: 1;
}
.land-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--ls-brand-300);
  color: var(--ls-neutral-0);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  align-self: flex-start;
  transition: background var(--ls-transition-color);
}
.land-card__cta:hover { background: #0150D6; text-decoration: none; }
.land-card__cta svg { width: 14px; height: 14px; }

/* Long-form SEO body */
.land-prose {
  padding: 88px 0 96px;
}
.land-prose__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 40px;
}
.land-prose h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 56px 0 16px;
  color: var(--ls-fg);
}
.land-prose h2:first-child { margin-top: 0; }
.land-prose p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ls-fg-soft);
  margin: 0 0 14px;
}
.land-prose ul {
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
}
.land-prose ul li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ls-fg-soft);
}
.land-prose ul li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  width: 6px;
  height: 6px;
  background: var(--ls-brand-300);
  border-radius: 50%;
}
.land-prose ul li b { color: var(--ls-fg); font-weight: 600; }

.land-callout {
  background: var(--ls-brand-100);
  border: 1px solid var(--ls-brand-200);
  border-left: 4px solid var(--ls-brand-300);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 24px 0;
}
.land-callout__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-brand-300);
  margin-bottom: 6px;
}
.land-callout p {
  font-size: 15px;
  color: var(--ls-fg);
  line-height: 1.6;
  margin: 0;
}

/* Land final CTA band */
.land-cta {
  background: var(--ls-neutral-100);
  padding: 56px 40px;
  text-align: center;
  border-top: 1px solid var(--ls-border);
}
.land-cta h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.land-cta p {
  font-size: 15px;
  color: var(--ls-fg-soft);
  max-width: 540px;
  margin: 0 auto 22px;
  line-height: 1.55;
}
.land-cta__row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Land footer */
.land-foot {
  padding: 40px 56px 28px;
  background: var(--ls-neutral-0);
  border-top: 1px solid var(--ls-border);
}
.land-foot__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.land-foot__col-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
  margin-bottom: 14px;
}
.land-foot__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.land-foot__col a {
  font-size: 14px;
  color: var(--ls-fg);
  text-decoration: none;
  cursor: pointer;
}
.land-foot__col a:hover { color: var(--ls-brand-300); }
.land-foot__bottom {
  max-width: 1120px;
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--ls-border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ls-fg-mute);
}

/* =========================================================
 * PROJECT OVERRIDES — additions for the PHP re-skin
 * (Local to this codebase; not part of the upstream design system.)
 * ========================================================= */

/* Validation state — kept named .is-invalid so existing JS keeps working. */
.calc-input.is-invalid,
.calc-select.is-invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12);
}

/* Small chip used in card heads (loan type, qualifying status, payment count) */
.calc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ls-neutral-100);
  color: var(--ls-fg-soft);
  border: 1px solid var(--ls-border);
}
.calc-chip--brand {
  background: var(--ls-brand-100);
  color: var(--ls-brand-300);
  border-color: var(--ls-brand-200);
}
.calc-chip--success {
  background: var(--ls-status-success-bg);
  color: var(--ls-status-success-ink);
  border-color: rgba(36,100,43,0.18);
}
.calc-chip--error {
  background: #fde6e6;
  color: #9b1c1c;
  border-color: rgba(155,28,28,0.18);
}

/* Helper for dynamic show/hide rows in field grids */
.calc-field--hidden { display: none !important; }

/* DSCR — bigger hero value alignment + chip in card head */
.calc-card__head .calc-chip { margin-left: auto; }

/* Print stylesheet */
@media print {
  .calc-rail,
  .calc-appbar,
  .calc-foot__copy,
  .calc-promo,
  .calc-col--right,
  .advertisement-container,
  #addSecondMortgageContainer { display: none !important; }
  .calc-shell { grid-template-columns: 1fr; background: #fff; }
  .calc-main { display: block; }
  .calc-page { padding: 16px 0; max-width: 100%; }
  .calc-grid { grid-template-columns: 1fr; gap: 12px; }
  .calc-card { break-inside: avoid; box-shadow: none; }
  .calc-table { font-size: 11px; }
  .calc-table tbody td, .calc-table thead th { padding: 4px 8px; }
  a[href]:after { content: ""; }
}

/* Closing-cost results — design-system look for .fee-* legacy markup */
.fee-section { border-bottom: 1px solid var(--ls-border); }
.fee-section:last-child { border-bottom: none; }
.fee-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer; user-select: none;
  background: var(--ls-neutral-0); transition: background var(--ls-transition-color);
}
.fee-header:hover { background: var(--ls-neutral-100); }
.fee-header h3 {
  font-size: 14px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 12px; color: var(--ls-fg);
}
.fee-header h3 .fee-amount {
  font-weight: 600; color: var(--ls-fg-soft); font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.fee-header .bi-chevron-right {
  color: var(--ls-fg-mute); transition: transform var(--ls-transition-transform);
}
.fee-header.rotated .bi-chevron-right { transform: rotate(90deg); }
.collapse { display: none; }
.collapse.show { display: block; }
.fee-details { padding: 4px 20px 14px; }
.fee-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0; font-size: 13px; gap: 12px;
}
.fee-item + .fee-item { border-top: 1px dashed var(--ls-border); }
.fee-name { color: var(--ls-fg-soft); }
.fee-item .fee-amount {
  font-weight: 600; color: var(--ls-fg);
  font-variant-numeric: tabular-nums;
}
.total-summary { background: var(--ls-neutral-100); border-radius: 0 0 11px 11px; }
.total-summary .fee-header { background: transparent; cursor: default; }
.total-summary .fee-header h3 { font-size: 15px; }
.total-summary .fee-details { padding: 4px 20px 16px; }
.total-summary .total-item .fee-amount { font-size: 15px; }

/* Second mortgage subsection inside loan-details card */
.second-mortgage-section { padding-top: 14px; border-top: 1px solid var(--ls-border); }
.second-mortgage-section h5 {
  font-size: 13px; font-weight: 600; margin: 0 0 12px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--ls-fg);
}
.second-mortgage-section h5 .btn-link {
  background: transparent; border: 0; font-size: 12px;
  color: #c0392b; cursor: pointer; padding: 0; font-weight: 600;
}

/* "Assumptions" callout */
#assumptionsCard { padding: 14px 18px; }
#assumptionsCard .card-title {
  font-size: 13px; font-weight: 600; color: var(--ls-fg);
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px;
}
#assumptionsContent { font-size: 12px; color: var(--ls-fg-soft); line-height: 1.5; }
#assumptionsContent p { margin: 0; }

/* Header action links (Email / Print) inside .fee-section card head */
.header-link {
  font-size: 13px; color: var(--ls-fg-soft); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border-radius: 6px; transition: background var(--ls-transition-color);
}
.header-link:hover { background: var(--ls-neutral-100); color: var(--ls-fg); text-decoration: none; }
.header-link.mr-3 { margin-right: 8px; }

/* Bootstrap modal compat (only what's needed for the two info modals) */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
         background: rgba(10,21,47,0.55); z-index: 1050; overflow-y: auto;
         padding: 40px 20px; }
.modal.show { display: block; }
.modal-dialog { max-width: 720px; margin: 0 auto; }
.modal-dialog.modal-xl { max-width: 1140px; }
.modal-content {
  background: var(--ls-neutral-0); border-radius: 12px;
  box-shadow: var(--ls-shadow-lg); overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--ls-border);
}
.modal-title { font-size: 15px; font-weight: 600; margin: 0; color: var(--ls-fg); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--ls-border);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal .close {
  background: transparent; border: 0; font-size: 24px; line-height: 1;
  color: var(--ls-fg-mute); cursor: pointer; padding: 4px 8px;
}
.modal .close:hover { color: var(--ls-fg); }

/* Bootstrap button compatibility (used inside modals and form-check switches) */
.btn { font: 600 14px var(--ls-font-sans); padding: 8px 14px; border-radius: 8px;
       border: 1px solid transparent; cursor: pointer; text-decoration: none;
       display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--ls-brand-300); color: #fff; }
.btn-primary:hover { background: #0150D6; }
.btn-secondary { background: var(--ls-neutral-0); color: var(--ls-fg); border-color: var(--ls-border); }
.btn-secondary:hover { background: var(--ls-neutral-100); }

/* Email modal form fields fallback (uses .form-control inside) */
.modal .form-control,
.modal-body .form-control {
  width: 100%; box-sizing: border-box; font: 400 14px var(--ls-font-sans);
  padding: 9px 12px; border: 1px solid var(--ls-border); border-radius: 8px;
  background: var(--ls-neutral-0); color: var(--ls-fg);
}
.modal label { font-size: 12px; font-weight: 600; color: var(--ls-fg); display: block; margin-bottom: 6px; }
.modal .form-group { margin-bottom: 14px; }

/* Global box-sizing + overflow hardening to prevent horizontal scroll. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
.calc-shell { max-width: 100vw; overflow-x: hidden; }
.calc-main { min-width: 0; overflow-x: hidden; }
.calc-page { box-sizing: border-box; }
.calc-card__body[style*="overflow-x: auto"] { max-width: 100%; }

/* (Older sidebar background hack replaced — see the .calc-shell rule
   in the APP RAIL section below for the up-to-date 256px / 64px version.) */

/* =========================================================
 * APP RAIL — Loanspark Partner Portal sidebar (spec-faithful port)
 * Replaces the simpler .calc-rail layout used by the original re-skin.
 * ========================================================= */
.calc-shell {
  display: grid;
  grid-template-columns: var(--rail-w, 256px) 1fr;
  transition: grid-template-columns 220ms ease, background 220ms ease;
  /* Paint the leftmost column white + a 1px border, then the rest in
     page-bg neutral, so the sidebar background extends below the
     sticky rail even when the page scrolls past 100vh. */
  background:
    linear-gradient(to right,
      var(--ls-neutral-0) 0,
      var(--ls-neutral-0) calc(var(--rail-w, 256px) - 1px),
      var(--ls-border) calc(var(--rail-w, 256px) - 1px),
      var(--ls-border) var(--rail-w, 256px),
      var(--ls-neutral-100) var(--rail-w, 256px)
    );
}
body.is-collapsed .calc-shell { --rail-w: 64px; }

.rail {
  background: var(--ls-neutral-0);
  border-right: 1px solid var(--ls-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* Brand row — height must match .calc-appbar (56px) so the rail/appbar
   borders align as a continuous horizontal line across the shell. */
.rail__brand {
  height: 56px;
  padding: 0 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--ls-border);
  flex-shrink: 0;
}
.rail__brand-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; }
.rail__brand-link:hover { text-decoration: none; }
.rail__brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--ls-brand-300);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px -3px rgba(1, 96, 255, 0.45);
}
.rail__brand-mark svg { width: 17px; height: 17px; color: #fff; }
.rail__brand-name {
  font: 600 17px var(--ls-font-sans);
  color: var(--ls-fg);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.rail__collapse, .rail__expand-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: none; background: transparent;
  color: var(--ls-fg-mute);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--ls-transition-color), color var(--ls-transition-color);
}
.rail__collapse svg, .rail__expand-icon svg { width: 16px; height: 16px; transition: transform 220ms ease; }
.rail__collapse:hover, .rail__expand-icon:hover { background: var(--ls-neutral-100); color: var(--ls-fg); }
.rail__expand-icon { display: none; }
/* Collapsed: hide the standalone expand chevron — the spark mark itself
   acts as the expand affordance (see rail__brand-link override below). */
body.is-collapsed .rail__expand-icon { display: none; }
body.is-collapsed .rail__brand-link { cursor: pointer; }
body.is-collapsed .rail__brand-link:hover { opacity: 0.85; }

/* Nav */
.rail__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 10px 12px;
}
.rail__group + .rail__group { margin-top: 14px; }
.rail__group-title {
  font: 600 10px var(--ls-font-sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ls-fg-mute);
  padding: 0 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}
.rail__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font: 500 13.5px var(--ls-font-sans);
  color: var(--ls-fg);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ls-transition-color), color var(--ls-transition-color);
  white-space: nowrap;
  overflow: hidden;
}
.rail__item + .rail__item { margin-top: 2px; }
.rail__item:hover { background: var(--ls-neutral-100); color: var(--ls-fg); text-decoration: none; }
.rail__item--active {
  background: var(--ls-brand-100);
  color: var(--ls-brand-300);
  font-weight: 600;
}
.rail__item-icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: inherit;
}
.rail__item-icon svg { width: 18px; height: 18px; stroke-width: 1.75; }
.rail__item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Collapsed-mode overrides */
body.is-collapsed .rail__brand {
  padding: 0;
  justify-content: center;
}
/* Brand link must shrink to the spark mark's size so the parent's
   justify-content: center properly centers the icon in the 64px column. */
body.is-collapsed .rail__brand-link {
  flex: 0 0 auto;
  width: auto;
  gap: 0;
  justify-content: center;
}
body.is-collapsed .rail__brand-name,
body.is-collapsed .rail__collapse { display: none; }
body.is-collapsed .rail__nav { padding: 14px 6px 12px; }
body.is-collapsed .rail__group-title { display: none; }
body.is-collapsed .rail__item {
  width: 40px; height: 40px;
  padding: 0;
  justify-content: center;
  margin: 0 auto;
  border-radius: 10px;
}
body.is-collapsed .rail__item + .rail__item { margin-top: 4px; }
body.is-collapsed .rail__item-label { display: none; }

/* Hide the legacy .calc-rail markup if it's still present anywhere */
.calc-rail { display: none; }

/* Brand mark — wordmark when expanded, spark mark when collapsed. */
.rail__brand-wordmark { display: block; height: 26px; width: auto; max-width: 100%; }
.rail__brand-spark { display: none; height: 28px; width: 28px; }
body.is-collapsed .rail__brand-wordmark { display: none; }
body.is-collapsed .rail__brand-spark { display: block; }

/* Ad slot — match the surrounding card styling (12px radius, border). */
.advertisement-container {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ls-border);
  background: var(--ls-neutral-0);
}
.advertisement-container .ad-link,
.advertisement-container .fallback-ad,
.advertisement-container img { border-radius: inherit; display: block; }
