/* ==========================================================================
   Credit Card Payoff — page theme

   Same ground as the rest of the site: cream fields, brand blue accents,
   flat pills, hairline edges, soft shadows. Tokens stay scoped to .cp-page.
   ========================================================================== */

.cp-page {
  --field: var(--surface-alt, #F5F5F7);
  --field-deep: #ECECEF;
  --cp-ink: var(--ink, #1D1D1F);
}

/* ---------- buttons: brand pill ---------- */
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 30px; border-radius: var(--r-pill, 980px);
  background: var(--primary, #0060B0); color: #fff;
  border: 0;
  font-size: var(--text-body, 1.0625rem); font-weight: 500; line-height: 1;
  letter-spacing: -.01em; cursor: pointer;
  transition: background var(--dur, .3s) var(--ease, ease);
}
.cp-btn:hover { background: var(--primary-600, #004E90); text-decoration: none; }
.cp-btn:active { background: var(--secondary, #200050); }
/* On the dark result panel and closing band the blue loses its edge. */
.cp-result .cp-btn, .cp-close .cp-btn { background: #fff; color: var(--secondary, #200050); }
.cp-result .cp-btn:hover, .cp-close .cp-btn:hover { background: rgba(255,255,255,.88); }
.cp-btn .arr { transition: transform var(--dur, .22s) var(--ease, ease); }
.cp-btn:hover .arr { transform: translateX(4px); }

/* ---------- hero ---------- */
.cp-hero {
  position: relative;
  background: var(--field);
  padding: 60px 0 150px;
  overflow: hidden;
}
/* The curved sweep along the bottom edge. Offset left so the field lingers
   under the illustration on the right rather than ending on a symmetric dome. */
.cp-hero::after {
  content: "";
  position: absolute; left: -34%; right: -6%; bottom: -80%;
  height: 100%;
  background: var(--surface, #fff);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.cp-hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
}
.cp-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  line-height: 1.05; letter-spacing: -.04em; font-weight: 600;
  color: var(--cp-ink); margin: 0 0 26px;
}
.cp-hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.5;
  color: var(--cp-ink); margin-bottom: 36px; max-width: 30ch;
}
.cp-hero-sub strong { font-weight: 600; }
.cp-hero-art { justify-self: center; }
.cp-hero-art img { width: 100%; max-width: 560px; height: auto; }

/* ---------- powered by ---------- */
.cp-eyebrow {
  text-align: center; text-transform: uppercase;
  letter-spacing: .12em; font-size: var(--text-small, .9375rem); font-weight: 600;
  color: var(--cp-ink); margin-bottom: 46px;
}
.cp-powered { padding: 70px 0 40px; background: var(--surface, #fff); }
.cp-logos {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 34px 20px; align-items: center; list-style: none;
}
.cp-logos li { display: grid; place-items: center; }
.cp-logos .p-logo { margin-bottom: 0; width: 130px; height: 44px; }

/* ---------- savings calculator ---------- */
.cp-calc-section { padding: 60px 0 90px; background: var(--surface, #fff); }
.cp-calc-grid {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: center;
}
.cp-calc-art img { width: 100%; max-width: 400px; height: auto; }

.cp-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: var(--r-xl, 30px);
  padding: 36px;
  box-shadow: var(--sh-lg);
}
.cp-card h2 { font-size: var(--text-h3, 1.375rem); color: var(--cp-ink); margin: 0 0 24px; }

/* the single question: a slider over a paired label/amount field */
.cp-amount-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; margin-top: 22px; }
.cp-amount-label {
  display: grid; place-items: center; padding: 16px 22px;
  background: var(--field-deep); border-radius: var(--r-md, 16px);
  font-weight: 600; color: var(--cp-ink); white-space: nowrap;
}
.cp-amount-field {
  display: flex; align-items: center; gap: 4px;
  padding: 16px 20px; background: var(--field); border-radius: var(--r-md, 16px);
}
.cp-amount-field .cur { font-size: 1.35rem; font-weight: 700; color: var(--cp-ink); }
.cp-amount-field input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 1.35rem; font-weight: 700; color: var(--cp-ink);
  letter-spacing: -.01em;
}
/* Chrome shows spinners on number inputs; the slider is the control here. */
.cp-amount-field input::-webkit-outer-spin-button,
.cp-amount-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cp-result {
  margin-top: 28px; padding: 30px;
  background: var(--grad, #0060B0); border-radius: var(--r-lg, 22px);
  color: #fff;
}
.cp-result-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cp-result-split > div + div { border-left: 1px solid rgba(255, 255, 255, .28); padding-left: 20px; }
.cp-result-label { font-size: .95rem; font-weight: 600; color: rgba(255,255,255,.82); min-height: 3em; }
.cp-result-value {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 600;
  line-height: 1; letter-spacing: -.04em; color: #fff; margin: 6px 0 2px;
}
.cp-result-unit { font-size: .9rem; color: rgba(255,255,255,.75); }
.cp-result .cp-btn { margin-top: 24px; }

/* ---------- breakdown dialog ---------- */
.cp-breakdown {
  border: 1px solid var(--line, rgba(0,0,0,.1)); border-radius: var(--r-xl, 30px);
  box-shadow: var(--sh-xl);
  padding: 0; max-width: 560px; width: calc(100vw - 32px);
  background: var(--surface, #fff); color: var(--cp-ink);
}
.cp-breakdown::backdrop { background: rgba(20, 24, 31, .55); }
.cp-breakdown-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 26px; border-bottom: 1px solid var(--line, #E2E8F0);
}
.cp-breakdown-head h2 { font-size: 1.2rem; margin: 0; }
.cp-breakdown-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-alt, #F1F5F9); cursor: pointer;
}
.cp-breakdown-body { padding: 26px; }
.cp-breakdown-rows { display: grid; gap: 14px; margin: 0; }
.cp-breakdown-rows > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line, #E2E8F0);
}
.cp-breakdown-rows > div:last-child { border-bottom: 0; padding-bottom: 0; }
.cp-breakdown-rows dt { color: var(--ink-2, #475569); font-size: .92rem; }
.cp-breakdown-rows dd { margin: 0; font-weight: 700; font-size: 1.02rem; }
.cp-breakdown-rows .is-saving dd { color: #047857; }
.cp-breakdown-note {
  margin-top: 20px; font-size: .8rem; line-height: 1.6; color: var(--ink-3, #94A3B8);
}

/* ---------- user stories ---------- */
.cp-stories { padding: 80px 0 90px; background: var(--surface, #fff); }
.cp-story-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px; list-style: none; padding-top: 34px;
}
.cp-story {
  position: relative;
  background: var(--field); border: 1px solid var(--line, rgba(0,0,0,.1));
  border-radius: var(--r-xl, 30px);
  padding: 48px 30px 28px;
}
.cp-story-avatar {
  position: absolute; top: -26px; left: 22px;
  width: 62px; height: 62px; border-radius: 50%;
  overflow: hidden; background: var(--field-deep);
  display: grid; place-items: center;
}
.cp-story-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cp-story blockquote {
  margin: 0 0 26px; font-size: 1.02rem; line-height: 1.55; color: var(--cp-ink);
}
.cp-story-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cp-story-name { font-size: .9rem; font-weight: 600; color: var(--cp-ink); }
.cp-story-role { font-size: .8rem; color: var(--cp-ink); opacity: .7; }
.cp-story-stars { color: var(--primary, #0060B0); font-size: 1rem; letter-spacing: 2px; }

/* ---------- closing call to action ---------- */
.cp-close { background: var(--grad, #200050); padding: 72px 0; text-align: center; }
.cp-close h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem); letter-spacing: -.03em; font-weight: 600;
  color: #fff; margin: 0 0 14px;
}
.cp-close p { color: rgba(255,255,255,.8); margin-bottom: 30px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .cp-hero-grid, .cp-calc-grid { grid-template-columns: 1fr; }
  .cp-hero-art { order: -1; max-width: 320px; }
  .cp-calc-art { display: none; }
  .cp-logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cp-story-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 720px) {
  .cp-hero { padding: 40px 0 110px; }
  /* The offset sweep reads as a stray wedge once the hero is this narrow. */
  .cp-hero::after { left: -20%; right: -20%; bottom: -84%; }
  .cp-card { padding: 24px; }
  .cp-result { padding: 22px; }
  .cp-result-split { grid-template-columns: 1fr; gap: 18px; }
  .cp-result-split > div + div {
    border-left: 0; padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .28); padding-top: 18px;
  }
  .cp-result-label { min-height: 0; }
  .cp-amount-row { grid-template-columns: 1fr; }
  .cp-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cp-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cp-btn, .cp-btn .arr { transition: none; }
}
