/* Finance page layout */
.finance-page {
  --finance-brand: var(--header-top, #1a377b);
  background: linear-gradient(180deg, #f2f6fc 0%, #ffffff 40%);
  color: #4b4f56;
}

body > main.finance-main {
  padding-top: 0 !important;
  padding-bottom: 0;
}

.finance-split-layout {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: calc(100vh - 80px);
  background: #ffffff;
}

.finance-split-left { /* Function: renders the branded finance hero artwork panel. */
  position: relative; /* Function: anchors the overlay layers to this panel. */
  overflow: hidden; /* Function: keeps the generated artwork inside the split layout. */
  isolation: isolate; /* Function: keeps overlay blending contained to the hero panel. */
  background-color: #06163D; /* Function: provides a DriveHaus navy fallback while the image loads. */
  background-image: url('assets/finance_hero_happy_blue.png'); /* Function: keeps the original hero image as the fallback artwork. */
  background-image: image-set(url('assets/finance_hero_happy_blue-1024.avif') type('image/avif'), url('assets/finance_hero_happy_blue-1024.webp') type('image/webp'), url('assets/finance_hero_happy_blue.png') type('image/png')); /* Function: lets modern browsers download a much smaller finance hero image. */
  background-position: 64% center; /* Function: crops toward the vehicle while leaving darker copy space. */
  background-size: cover; /* Function: fills the tall desktop panel without letterboxing. */
  background-repeat: no-repeat; /* Function: prevents tiled artwork on unusual viewport sizes. */
  display: flex; /* Function: allows vertical positioning of the finance copy. */
  flex-direction: column; /* Function: stacks the copy content naturally. */
  justify-content: center; /* Function: centers the hero message in the panel. */
  padding: 4rem; /* Function: gives the headline breathing room away from the viewport edge. */
  color: #fff; /* Function: keeps hero text legible over the navy artwork. */
}

.finance-split-left::before { /* Function: adds a brand-coloured readability overlay above the artwork. */
  content: ""; /* Function: creates the decorative overlay layer. */
  position: absolute; /* Function: stretches the overlay across the panel. */
  inset: 0; /* Function: covers the full finance hero panel. */
  background: linear-gradient(90deg, rgba(6, 22, 61, 0.96) 0%, rgba(6, 22, 61, 0.86) 36%, rgba(10, 36, 99, 0.56) 70%, rgba(10, 36, 99, 0.34) 100%), linear-gradient(180deg, rgba(6, 22, 61, 0.08) 0%, rgba(6, 22, 61, 0.78) 100%); /* Function: blends DriveHaus navy over the image while preserving the gold vehicle highlights. */
  z-index: 1; /* Function: sits above the image and below the live text. */
}

.finance-split-left::after { /* Function: adds a restrained gold glow that connects the image to the DriveHaus logo palette. */
  content: ""; /* Function: creates the accent layer without extra markup. */
  position: absolute; /* Function: places the accent independently of the text. */
  right: -20%; /* Function: lets the glow extend beyond the cropped panel. */
  bottom: -12%; /* Function: anchors the highlight near the vehicle reflection area. */
  width: 78%; /* Function: keeps the warm accent broad and soft. */
  height: 36%; /* Function: limits the glow to the lower hero area. */
  background: radial-gradient(ellipse at center, rgba(251, 182, 73, 0.22) 0%, rgba(251, 182, 73, 0.08) 36%, rgba(251, 182, 73, 0) 72%); /* Function: creates an elegant gold reflection rather than a loud neon effect. */
  pointer-events: none; /* Function: keeps the accent from interfering with interactions. */
  z-index: 1; /* Function: places the accent beneath the headline copy. */
}

.finance-split-left__content { /* Function: positions the hero copy above the branded artwork layers. */
  position: relative; /* Function: allows the copy to sit over pseudo-element overlays. */
  z-index: 2; /* Function: keeps the live text readable above the art overlays. */
  max-width: 480px; /* Function: preserves a polished line length for the headline and subcopy. */
}

.finance-split-left__content::before { /* Function: adds a small gold brand accent beside the finance message. */
  content: ""; /* Function: creates the accent without adding decorative markup. */
  display: block; /* Function: gives the accent a predictable box. */
  width: 4.5rem; /* Function: mirrors the confident DriveHaus logo underline proportion. */
  height: 0.28rem; /* Function: keeps the accent refined rather than heavy. */
  margin-bottom: 1.45rem; /* Function: separates the accent from the headline. */
  background: linear-gradient(90deg, #FBB649 0%, rgba(251, 182, 73, 0.32) 100%); /* Function: brings the DriveHaus gold into the hero art treatment. */
  border-radius: 999px; /* Function: softens the accent into a premium pill shape. */
}

.finance-split-left__content h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: #fff;
  text-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.36); /* Function: keeps the headline crisp over the vehicle reflections. */
}

.finance-split-left__content p {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86); /* Function: softens the supporting copy while maintaining contrast. */
  text-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.32); /* Function: improves legibility over the showroom floor glow. */
}

.finance-split-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(3rem, 6vw, 6rem) 0;
  background: #fafafa;
}

@media (min-width: 901px) {
  .finance-split-right {
    padding-right: max(clamp(0.75rem, 2vw, 1.5rem), calc(50vw - (var(--max-width, 1200px) / 2)));
  }
}

.finance-application {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3.5vw, 3rem) clamp(1.5rem, 4vw, 3rem) 0;
  scroll-margin-top: 6rem; /* Function: leaves room below the fixed navbar after calculator CTA jumps. */
}

.finance-step-shell {
  width: min(100%, 540px);
  margin: 0 auto;
}

/* Progress and selected-vehicle summary */
.finance-progress {
  width: min(100%, 500px);
  margin: 0 auto;
}

.finance-progress--start {
  padding-top: clamp(1.25rem, 3vw, 2.25rem);
  margin-bottom: clamp(1.85rem, 4vw, 3rem);
}

.finance-progress--start .finance-progress__label {
  margin-bottom: 0.75rem;
}

.finance-progress__label {
  margin: 0 0 0.5rem;
  color: #6b7280;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
}

.finance-progress__track {
  height: 6px;
  overflow: hidden;
  background: #f3f4f6;
  border-radius: 99px;
}

.finance-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--finance-brand);
  border-radius: 99px;
  transform: scaleX(var(--dh-progress-ratio, 0));
  transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.finance-summary {
  width: min(100%, 540px);
  margin: 0 auto clamp(1.5rem, 3.2vw, 2.5rem);
  background: #ffffff;
  color: var(--finance-brand);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.finance-summary__content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
}

.finance-summary__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 56px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.finance-summary-car {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.finance-summary__details {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.2rem;
  min-width: 0;
}

.finance-summary__details strong {
  color: var(--finance-brand);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.finance-summary__details span {
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
}

.finance-summary__edit {
  padding: 0.35rem 0.75rem;
  color: #4b5563;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: 600 0.9rem var(--font-body);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  margin-left: auto;
}

.finance-summary__edit:hover {
  background: #f3f4f6;
  color: var(--finance-brand);
}

.finance-progress--summary {
  width: 100%;
  padding: 1rem 1.75rem 1.25rem;
  background: transparent;
  border-top: 1px solid #f3f4f6;
  margin-top: 0;
}

.finance-progress--summary .finance-progress__label {
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: left;
}

.finance-progress--summary .finance-progress__track {
  background: #e5e7eb;
}

.finance-progress--summary .finance-progress__bar {
  background: var(--finance-brand);
  box-shadow: none;
}

/* Step content */
.finance-heading {
  margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
  color: var(--finance-brand);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.finance-heading--large {
  width: min(100%, 600px);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.finance-heading:focus {
  outline: 0;
}

.finance-option-list {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
}

.finance-option,
.finance-pill-option {
  position: relative;
  min-height: 56px;
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  width: 100%;
  padding: 0 1.25rem;
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: 500 0.95rem/1.2 var(--font-body);
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, color 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.finance-option-list .finance-option {
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
}

.finance-option-list .finance-option:last-child {
  border-bottom: 0;
}

.finance-option.is-selected,
.finance-pill-option.is-selected {
  background: #f9fafb;
  border-color: var(--finance-brand);
  color: var(--finance-brand);
  box-shadow: 0 0 0 1px var(--finance-brand) inset;
}

.finance-option-list .finance-option.is-selected {
  box-shadow: none;
  border-bottom-color: #e5e7eb;
}

.finance-option:hover:not(.is-selected),
.finance-pill-option:hover:not(.is-selected) {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.finance-option-list .finance-option:hover:not(.is-selected) {
  transform: none;
  border-bottom-color: #e5e7eb;
}

.finance-radio {
  width: 22px;
  height: 22px;
  border: 2px solid #d1d5db;
  border-radius: 999px;
  transition: border-color 0.2s ease;
}

.is-selected .finance-radio {
  position: relative;
  border-color: var(--finance-brand);
}

.is-selected .finance-radio::after {
  position: absolute;
  inset: 4px;
  content: "";
  background: var(--finance-brand);
  border-radius: inherit;
  animation: radioPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes radioPop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.finance-option-label,
.finance-pill-label {
  justify-self: center;
}

.finance-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.finance-choice-grid .finance-pill-option {
  min-height: 56px;
}

/* Vehicle type grid */
.finance-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  box-shadow: none;
}

.finance-vehicle-option {
  position: relative;
  min-height: 104px;
  display: grid;
  gap: 0.36rem;
  align-content: center;
  justify-items: center;
  padding: 0.82rem 0.75rem;
  color: #374151;
  background: transparent;
  border: 0;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  font: 700 0.92rem/1.2 var(--font-body);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Function: keeps vehicle selection flat like the following radio-option sections. */
.finance-vehicle-option::before {
  content: none;
}

/* Function: disables decorative selected badges so the selector stays professional. */
.finance-vehicle-option::after {
  content: none;
}

.finance-vehicle-option:hover:not(.is-selected) {
  background: #f9fafb;
  color: #374151;
}

.finance-vehicle-option:nth-child(3n) {
  border-right: 0;
}

.finance-vehicle-option:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.finance-vehicle-option.is-selected {
  background: #eaf2ff;
  color: var(--finance-brand);
  animation: financeVehicleSelect 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: none;
  z-index: 1;
}

.finance-vehicle-option.is-selected::before {
  content: none;
}

.finance-vehicle-art {
  align-items: center;
  display: flex;
  height: 42px;
  justify-content: center;
  width: 68px;
  transition: transform 0.2s ease;
}

.finance-vehicle-option:hover:not(.is-selected) .finance-vehicle-art {
  transform: translateY(-1px);
}

.finance-vehicle-option.is-selected .finance-vehicle-art {
  transform: none;
}

.finance-vehicle-icon {
  display: block;
  color: #2f3a4a;
  filter: none;
  height: 36px;
  max-width: 66px;
  opacity: 0.92;
  overflow: hidden;
  width: 66px;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
  transform: scaleX(-1);
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* Function: draws the body of the inline vehicle icons with a subtle 2D fill. */
.finance-vehicle-icon__body {
  fill: currentColor;
  fill-opacity: 0.08;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 3.4;
}

/* Function: keeps the icon windows readable while allowing the outline to follow the selected color. */
.finance-vehicle-icon__glass {
  fill: #ffffff;
  fill-opacity: 0.86;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 3;
}

/* Function: adds restrained 2D detail lines to the vehicle silhouettes. */
.finance-vehicle-icon__line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

/* Function: draws consistent vehicle wheels across every icon. */
.finance-vehicle-icon__wheel {
  fill: #ffffff;
  stroke: currentColor;
  stroke-width: 3.4;
}

/* Function: gives the vehicle wheels a small center detail without adding visual noise. */
.finance-vehicle-icon__hub {
  fill: currentColor;
  opacity: 0.34;
}

.finance-summary-car.finance-vehicle-icon {
  height: 44px;
  max-width: 96px;
  width: 96px;
}

.finance-vehicle-option.is-selected .finance-vehicle-icon {
  animation: financeVehicleIconSelect 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--finance-brand);
  opacity: 1;
}

.finance-vehicle-option > span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.finance-vehicle-option.is-selected > span:last-child {
  animation: financeVehicleLabelSelect 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Function: softly flashes the selected vehicle cell while preserving the flat layout language. */
@keyframes financeVehicleSelect {
  0% {
    background: #ffffff;
  }
  55% {
    background: #cce0ff;
  }
  100% {
    background: #eaf2ff;
  }
}

/* Function: gives the selected vehicle icon a short tactile lift on selection changes. */
@keyframes financeVehicleIconSelect {
  0% {
    opacity: 0.72;
    transform: translateY(2px) scale(-0.94, 0.94);
  }
  65% {
    opacity: 1;
    transform: translateY(-2px) scale(-1.06, 1.06);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(-1, 1);
  }
}

/* Function: settles the selected label into place after the icon motion. */
@keyframes financeVehicleLabelSelect {
  0% {
    transform: translateY(2px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Function: respects reduced-motion preferences for vehicle selector state changes. */
@media (prefers-reduced-motion: reduce) {
  .finance-vehicle-option,
  .finance-vehicle-art,
  .finance-vehicle-icon,
  .finance-vehicle-option > span:last-child {
    animation: none !important;
    transition: none !important;
  }
}

/* Inputs */
.finance-input-group {
  display: grid;
  gap: 0.85rem;
}

.finance-input-label {
  color: #525252;
  font: 400 clamp(1rem, 2vw, 1.35rem)/1.2 var(--font-body);
}

.finance-money-input,
.finance-text-input,
.finance-duration-control {
  min-height: 52px;
  display: grid;
  align-items: center;
  color: var(--finance-brand);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.finance-money-input {
  grid-template-columns: 86px 1fr;
}

.finance-money-input span {
  justify-self: center;
  color: #4b5563;
  font-size: 1.25rem;
  font-weight: 600;
}

.finance-money-input input,
.finance-text-input input,
.finance-duration-control input {
  width: 100%;
  min-width: 0;
  color: var(--finance-brand);
  background: transparent;
  border: 0;
  outline: 0;
  font: 600 0.95rem/1.2 var(--font-body);
}

.finance-money-input input::placeholder,
.finance-text-input input::placeholder,
.finance-duration-control input::placeholder {
  color: #9ca3af;
  opacity: 1;
  font-weight: 400;
}

.finance-duration-grid {
  display: grid;
  gap: 1.7rem;
}

.finance-duration-control {
  grid-template-columns: 1fr 1px 1fr;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.finance-duration-control input {
  text-align: center;
}

.finance-duration-divider {
  width: 1px;
  height: 60%;
  background: #e0e4ea;
}

.finance-duration-unit {
  justify-self: center;
  color: #4b4f56;
  font-size: 1rem;
}

.finance-text-stack {
  display: grid;
  gap: 1.6rem;
}

.finance-text-input {
  padding: 0 1.8rem;
}

/* Buttons and helper copy */
.finance-actions {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  margin-top: clamp(0.86rem, 2vw, 1.33rem);
}

.finance-actions[hidden] {
  display: none !important;
}

.finance-btn {
  min-height: 52px;
  border-radius: 99px;
  font: 700 1.05rem/1.2 var(--font-body);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.finance-btn:active {
  transform: translateY(1px);
}

.finance-btn--back {
  color: #374151;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: none;
}

.finance-btn--back:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.finance-btn--primary {
  flex: 1;
  color: #ffffff;
  background: var(--finance-brand);
  border: 0;
  box-shadow: none;
}

.finance-btn--primary:hover:not(:disabled) {
  background-color: #244a91;
  box-shadow: 0 4px 12px rgba(26, 55, 123, 0.2);
  transform: translateY(-2px);
}

.finance-btn--primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.finance-helper {
  min-height: 1.5em;
  margin: 1.9rem auto 0;
  color: #525252;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  line-height: 1.45;
  text-align: center;
}

.finance-error {
  min-height: 1.4em;
  margin: 1.25rem 0 0;
  color: #b42318;
  font-weight: 700;
  text-align: center;
}

.finance-actions .is-hidden {
  display: none;
}

/* Step transition animations */
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.finance-step {
  animation: stepFadeIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.finance-step.is-exiting {
  animation: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.finance-btn--back.is-hidden + .finance-btn--primary {
  grid-column: 1 / -1;
  width: min(100%, 640px);
  justify-self: center;
}

/* Completion state */
.finance-complete {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  border: 1px solid #dde1e6;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  animation: completeReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes completeReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.finance-complete h1 {
  margin: 0 0 1rem;
  color: #263238;
  font-size: clamp(2rem, 4vw, 3rem);
}

.finance-complete p {
  margin: 0 auto 1.8rem;
  max-width: 560px;
  color: #58616b;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.finance-complete p strong {
  color: #263238;
}

/* Animated success checkmark */
.finance-complete__check {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.finance-complete__check svg {
  width: 80px;
  height: 80px;
}

.finance-complete__check .check-circle {
  fill: none;
  stroke: #22c55e;
  stroke-width: 3;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawCircle 0.6s 0.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.finance-complete__check .check-mark {
  fill: none;
  stroke: #22c55e;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawCheck 0.35s 0.7s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.finance-complete__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.finance-complete__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0.75rem 1.3rem;
  border-radius: 7px;
  font-weight: 800;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.finance-complete__links a:hover {
  transform: translateY(-2px);
}

.finance-complete__links a:first-child {
  color: #1a1a1a;
  background: #FBB649;
  box-shadow: 0 4px 12px rgba(251, 182, 73, 0.25);
}

.finance-complete__links a:first-child:hover {
  background: #f0a32f;
  box-shadow: 0 6px 16px rgba(251, 182, 73, 0.35);
}

.finance-complete__links a:last-child {
  color: #1a377b;
  background: transparent;
  border: 2px solid #d9dce0;
}

.finance-complete__links a:last-child:hover {
  border-color: #b0b6bd;
  background: #f8fafc;
}

/* Spacing utilities moved from inline styles */
.finance-housing-payment-group {
  margin-top: clamp(2rem, 5vw, 3.25rem);
}

.finance-eligibility-spacer {
  margin-top: clamp(3rem, 7vw, 5rem);
}

/* Calculator Section */
.finance-calculator-wrapper {
  margin: 0;
  background: #fafafa;
  padding: clamp(4rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid #eaeaea;
}

.finance-calculator-header {
  text-align: center;
  margin-bottom: 3rem;
}

.finance-calculator-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--finance-brand);
  margin-bottom: 1rem;
}

.finance-calculator-header p {
  color: #6b7280;
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.finance-calc-tabs {
  display: inline-flex;
  width: min(100%, 560px);
  background: #f3f4f6;
  padding: 0.35rem;
  border-radius: 99px;
  position: relative;
  isolation: isolate;
}

.finance-calc-tabs::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 0.35rem;
  width: calc(50% - 0.35rem);
  background: #ffffff;
  border-radius: 99px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.finance-calc-tabs:has(.finance-calc-tab:nth-child(1).is-active)::before {
  transform: translateX(0);
}

.finance-calc-tabs:has(.finance-calc-tab:nth-child(2).is-active)::before {
  transform: translateX(100%);
}

.finance-calc-tab {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #4b5563;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.3s ease;
}

.finance-calc-tab.is-active {
  color: var(--finance-brand);
}

.finance-calculator {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.finance-calc-inputs {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  gap: 2rem;
}

.finance-calc-group {
  display: grid;
  gap: 0.75rem;
}

/* Function: hides inactive calculator mode fields while keeping shared fields visible. */
.finance-calculator [data-calc-panel] {
  display: none;
}

/* Function: shows the vehicle price row for the payment calculator mode. */
.finance-calculator[data-active-calc-mode="payment"] [data-calc-panel="payment"] {
  display: grid;
}

/* Function: shows the desired payment row for the affordability calculator mode. */
.finance-calculator[data-active-calc-mode="afford"] [data-calc-panel="afford"] {
  display: grid;
}

.finance-calc-group--row {
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 42%);
  align-items: center;
  gap: 1.5rem;
}

.finance-calc-label-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finance-calc-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.finance-calc-optional {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.finance-calc-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 0.95rem;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

.finance-calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  margin-top: 0.35rem;
}

.finance-calc-slider:focus {
  outline: none;
  background: transparent;
  box-shadow: none;
}

.finance-money-input input:focus,
.finance-text-input input:focus,
.finance-duration-control input:focus,
.finance-calc-number:focus {
  box-shadow: none;
  background: transparent;
  outline: none;
}

.finance-calc-select:focus {
  box-shadow: none;
  outline: none;
}

/* Function: paints finance calculator sliders like the inventory filters while keeping a single handle. */
.finance-calc-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--finance-brand) 0%, var(--finance-brand) var(--finance-slider-progress, 0%), #e5e7eb var(--finance-slider-progress, 0%), #e5e7eb 100%);
  border: 0;
  border-radius: 999px;
}

.finance-calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--finance-brand);
  box-shadow: 0 2px 8px rgba(26, 55, 123, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.16s ease;
}

/* Function: mirrors the inventory filter focus ring on finance calculator sliders. */
.finance-calc-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(26, 55, 123, 0.18), 0 2px 8px rgba(26, 55, 123, 0.25);
}

/* Function: gives the finance slider handle the same pressed feedback as the filter handle. */
.finance-calc-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

/* Function: paints the Firefox finance calculator slider track with the filter-style neutral rail. */
.finance-calc-slider::-moz-range-track {
  height: 6px;
  background: #e5e7eb;
  border: 0;
  border-radius: 999px;
}

/* Function: fills the Firefox finance calculator slider from the minimum to the single handle. */
.finance-calc-slider::-moz-range-progress {
  height: 6px;
  background: var(--finance-brand);
  border-radius: 999px;
}

/* Function: matches Firefox slider thumbs to the inventory filter thumb style. */
.finance-calc-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--finance-brand);
  box-shadow: 0 2px 8px rgba(26, 55, 123, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.16s ease;
}

/* Function: mirrors the inventory filter focus ring for Firefox slider users. */
.finance-calc-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(26, 55, 123, 0.18), 0 2px 8px rgba(26, 55, 123, 0.25);
}

/* Function: gives Firefox slider thumbs the same pressed scale as the filter thumb. */
.finance-calc-slider::-moz-range-thumb:active {
  transform: scale(1.15);
}

.finance-calc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.finance-calc-prefix {
  padding-left: 1rem;
  color: #6b7280;
  font-weight: 500;
}

.finance-calc-number {
  width: 100%;
  padding: 0.75rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--finance-brand);
  font-weight: 600;
  font-size: 0.95rem;
}

.finance-calc-results {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  position: sticky;
  top: 2rem;
}

.finance-calc-results__inner {
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.finance-calc-results__title {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1rem;
}

.finance-calc-results__main {
  text-align: center;
  font-size: clamp(3rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--finance-brand);
  line-height: 1;
  margin-bottom: 2rem;
}

.finance-calc-breakdown {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.finance-calc-breakdown__row {
  display: flex;
  justify-content: space-between;
  color: #4b5563;
  font-size: 0.95rem;
}

.finance-calc-breakdown__total {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
  font-weight: 700;
  color: var(--finance-brand);
}

.finance-calc-results__footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.finance-calc-results__footer p {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.finance-calc-cta {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--finance-brand);
  color: #ffffff;
  border: 0;
  border-radius: 99px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.finance-calc-cta:hover {
  background-color: #244a91;
  transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .finance-split-layout {
    grid-template-columns: 1fr;
  }

  .finance-split-left {
    padding: 3rem 1.5rem 120px 1.5rem;
    min-height: 440px;
    background-position: 58% center; /* Function: keeps the vehicle visible in the shorter stacked hero. */
  }

  .finance-split-left::after {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 240px;
    background: linear-gradient(to bottom, rgba(250, 250, 250, 0) 0%, rgba(250, 250, 250, 0.5) 60%, rgba(250, 250, 250, 1) 100%);
    z-index: 3;
    pointer-events: none;
  }

  .finance-split-right {
    padding: 0 0 3rem 0;
    margin-top: -120px;
    position: relative;
    z-index: 4;
    background: linear-gradient(180deg, transparent 0%, transparent 120px, #fafafa 120px);
  }

  .finance-calculator {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .finance-main {
    padding-top: clamp(4.25rem, 3.5rem + 2vw, 5rem);
  }

  .finance-summary__content {
    grid-template-columns: 110px 1fr;
  }

  .finance-summary__edit {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
  }

  .finance-vehicle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .finance-vehicle-option:nth-child(3n) {
    border-right: 1px solid #e5e7eb;
  }

  .finance-vehicle-option:nth-child(2n) {
    border-right: 0;
  }

  .finance-vehicle-option:nth-last-child(-n + 3) {
    border-bottom: 1px solid #e5e7eb;
  }

  .finance-vehicle-option:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .finance-choice-grid {
    grid-template-columns: 1fr;
  }

  .finance-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Function: keeps mobile finance calculator labels beside their entry fields. */
  .finance-calc-group--row {
    grid-template-columns: minmax(0, 1fr) minmax(8.75rem, 42%); /* Function: makes mobile fields compact while leaving more horizontal space for labels. */
    align-items: center; /* Function: vertically pairs each mobile label with its matching field. */
    column-gap: 0.75rem; /* Function: separates mobile labels from right-aligned controls. */
  }

  /* Function: lets mobile slider rows place labels, values, and sliders on the parent grid. */
  .finance-calc-group--row > .finance-calc-label-col {
    display: contents; /* Function: allows the nested mobile label and slider to share the two-column row. */
  }

  /* Function: keeps mobile finance calculator labels in the left column. */
  .finance-calc-group--row > label,
  .finance-calc-group--row > .finance-calc-label-col > label {
    order: 1; /* Function: places mobile labels before the right-aligned fields. */
  }

  /* Function: right-aligns mobile finance calculator entry fields inside their row. */
  .finance-calc-group--row > .finance-calc-select,
  .finance-calc-group--row > .finance-calc-input-wrap {
    order: 2; /* Function: places mobile calculator fields beside labels. */
    justify-self: end; /* Function: moves mobile calculator fields to the right edge of the row. */
    max-width: 100%; /* Function: keeps mobile fields inside the smaller right-side column. */
  }

  /* Function: restores full-width mobile sliders below each label-and-value row. */
  .finance-calc-group--row > .finance-calc-label-col > .finance-calc-slider {
    grid-column: 1 / -1; /* Function: lets mobile sliders span beneath both columns. */
    margin-top: 0.15rem; /* Function: gives mobile sliders a small breathing gap below the field row. */
    order: 3; /* Function: keeps mobile sliders after the label and field pair. */
  }

  /* Function: keeps mobile finance calculator select values readable in the compact right column. */
  .finance-calc-group--row > .finance-calc-select {
    text-align: right; /* Function: aligns mobile select text with the right-side field edge. */
    text-overflow: ellipsis; /* Function: shortens long mobile select values instead of widening the row. */
  }

  .finance-btn {
    min-height: 58px;
  }

  .finance-btn--back {
    order: 2;
  }
}

@media (max-width: 520px) {
  .finance-application {
    padding-inline: 1rem;
  }

  /* Function: tightens the mobile finance progress area so it does not overpower the question. */
  .finance-progress--start {
    padding-top: 0.9rem;
    margin-bottom: 1.75rem;
  }

  /* Function: improves mobile progress label contrast while keeping its compact scale. */
  .finance-progress__label {
    color: #374151;
    font-size: 0.88rem;
    font-weight: 700;
  }

  /* Function: keeps mobile finance questions prominent without feeling oversized. */
  .finance-heading {
    margin-bottom: 1.25rem;
    font-size: 1.45rem;
    line-height: 1.18;
  }

  /* Function: keeps the mobile option card compact while preserving a tappable target. */
  .finance-option-list {
    border-radius: 10px;
  }

  .finance-option,
  .finance-pill-option {
    grid-template-columns: 48px 1fr;
    min-height: 58px;
    padding: 0 0.85rem;
    font-size: 0.98rem;
  }

  /* Function: overrides the stacked option-list row height that otherwise wins on mobile. */
  .finance-option-list .finance-option {
    min-height: 58px;
  }

  .finance-radio {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }

  .is-selected .finance-radio::after {
    inset: 5px;
  }

  /* Function: aligns mobile finance action buttons with the tighter button proportions in the lower sections. */
  .finance-actions {
    gap: 0.75rem;
    margin-top: 0.66rem;
  }

  /* Function: makes mobile Continue and Back buttons less oversized while staying easy to tap. */
  .finance-btn {
    min-height: 54px;
    padding: 0.75rem 1.2rem;
    font-size: 0.98rem;
  }

  .finance-vehicle-option {
    min-height: 96px;
    font-size: 0.9rem;
    padding: 0.72rem 0.55rem;
  }

  .finance-vehicle-art {
    height: 36px;
    width: 58px;
  }

  .finance-vehicle-icon {
    height: 31px;
    max-width: 58px;
    width: 58px;
  }

  .finance-money-input,
  .finance-text-input,
  .finance-duration-control {
    min-height: 74px;
  }

  /* Function: prevents iOS Safari from zooming in when fields are focused */
  .finance-calc-select,
  .finance-calc-number,
  .finance-money-input input,
  .finance-text-input input,
  .finance-duration-control input {
    font-size: 16px;
  }
}
