/* cash-flow-onboarding
   Cash Flow landing + onboarding wizard (shown while no accounts are
   linked). Exact values from the Figma "Onboarding paid user" (18648:422798,
   18648:425251, 18648:425318, 18648:425467, 18683:25713, 18683:25872,
   18683:25993) and "Onboarding non premium user to premium" (18683:31149,
   18683:31341) frames. */

.cfo-landing p,
.cfo-wizard p,
.cfo-landing :is(h1, h2, h3, h4),
.cfo-wizard :is(h1, h2, h3, h4) {
  margin: 0;
}

/* Headings and lists that replaced styled p/div elements (WCAG 1.3.1) keep
   the look of what they replaced. Zero specificity, so every class rule
   still wins. */
:where(.cfo-landing, .cfo-wizard, .cfo-card) :where(h1, h2, h3, h4) {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.cfo-gold { color: var(--gold); }
.cfo-green { color: var(--link-green); }
.cfo-coral { color: #D1817E; }

/* --- Buttons (Figma Primary / Secondary, 40px pill) --- */

.cfo-btn {
  height: 40px;
  padding: 8px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  border-radius: 40px;
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  text-transform: capitalize;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.cfo-btn img {
  display: block;
}

.cfo-btn-primary {
  background: var(--white);
  border: 1px solid var(--navy-border);
  color: var(--navy-mid);
}

.cfo-btn-secondary {
  background: transparent;
  border: 1px solid var(--white);
  color: var(--white);
}

.cfo-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.cfo-btn-block { width: 100%; }
.cfo-btn-339 { width: 339px; max-width: 100%; }
.cfo-btn-341 { width: 341px; max-width: 100%; }
.cfo-btn-359 { width: 359px; max-width: 100%; }
.cfo-btn-410 { width: 410px; max-width: 100%; }

/* --- Landing (in the app shell) --- */

.cfo-landing {
  /* .groove-content has 48px top/bottom padding; the card sits centered in
     the 1024px-tall Figma content column. */
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cfo-landing-card {
  width: 706px;
  max-width: 100%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  border-radius: 24px;
  background: var(--navy-card);
}

.cfo-landing-image {
  display: block;
  width: 274px;
  height: auto;
  /* The badge art overflows its 274x195 Figma frame top and bottom. */
  margin: -24px 0;
}

.cfo-landing-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: center;
}

.cfo-landing-title {
  color: var(--gold);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-landing-body {
  color: var(--white);
  font-size: 18px;
  line-height: 1.4;
}

.cfo-landing-actions {
  width: 390px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cfo-landing-expiry {
  color: var(--link-green);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.cfo-landing-expiry span {
  font-weight: 700;
}

.cfo-landing-sponsor {
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
}

/* --- Wizard chrome (full screen, no sidebar) --- */

.cfo-wizard {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: linear-gradient(139.48deg, var(--navy-start) 3.2%, var(--navy-mid) 47.24%, var(--navy-end) 108.89%);
  color: var(--white);
}

.cfo-top {
  height: 89px;
  flex-shrink: 0;
  padding: 24px 80px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--navy-mid);
  border-bottom: 1px solid var(--navy-border);
}

.cfo-top-back {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 40px;
  background: var(--navy-card);
}

.cfo-top-back img {
  display: block;
}

.cfo-top-title {
  flex: 1 0 0;
  min-width: 0;
  color: var(--white);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.cfo-top-cancel {
  flex-shrink: 0;
  padding: 0 8px;
  border: none;
  background: none;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  text-decoration: underline;
}

.cfo-top-cancel-spacer {
  width: 70px;
  flex-shrink: 0;
}

.cfo-progress {
  height: 8px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  overflow: hidden;
}

.cfo-progress-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.cfo-body {
  flex: 1 0 auto;
  padding: 62px 24px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.cfo-wizard.has-bottom .cfo-body {
  padding-bottom: 165px;
}

.cfo-body:has(> .cfo-hero) {
  align-items: center;
}

.cfo-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 91;
  min-height: 117px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--navy-mid);
}

.cfo-bottom-col {
  width: 342px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfo-bottom-col .cfo-btn {
  width: 100%;
}

.cfo-bottom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.cfo-sponsor {
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
}

/* --- Step card + heading --- */

.cfo-card {
  width: 800px;
  max-width: 100%;
  padding: 48px 48px 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-radius: 24px;
  background: var(--navy-card);
}

.cfo-heading {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cfo-heading-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-eyebrow {
  color: var(--gold);
  font-size: 14px;
}

.cfo-title {
  color: var(--white);
  font-size: 24px;
}

.cfo-subtitle {
  color: var(--white);
  font-size: 16px;
  line-height: 1.4;
}

.cfo-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* --- My Linked Accounts --- */

.cfo-linked {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-radius: 12px;
  background: var(--navy-card-secondary);
}

.cfo-linked-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cfo-linked-subheader {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cfo-linked-heading {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfo-linked-title {
  color: var(--link-green);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-linked-sub {
  color: var(--light-gray);
  font-size: 12px;
  line-height: 1.4;
}

.cfo-plaid-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cfo-plaid-image {
  position: relative;
  width: 168px;
  height: 126px;
  overflow: hidden;
}

.cfo-plaid-image img {
  position: absolute;
  left: -3.87%;
  top: -8.1%;
  width: 103.92%;
  height: 120.48%;
  max-width: none;
}

.cfo-plaid-powered {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cfo-plaid-powered p {
  color: var(--white);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}

.cfo-plaid-powered img {
  display: block;
  object-fit: cover;
}

.cfo-note {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cfo-note-rule {
  width: 288px;
  max-width: 100%;
  height: 1px;
  background: var(--navy-border);
}

.cfo-note p {
  color: var(--white);
  font-size: 12px;
  line-height: 1.4;
}

/* Accordions */

.cfo-accordions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfo-accordion {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 8px;
  background: var(--navy-card);
}

.cfo-accordion.open {
  padding: 24px;
}

.cfo-accordion-heading {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
}

.cfo-accordion-content {
  display: contents;
}

.cfo-accordion-heading > img {
  display: block;
  flex-shrink: 0;
}

.cfo-accordion-institution {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfo-institution-logo {
  display: block;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.cfo-institution-fallback {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--navy-border);
  color: var(--white);
}

.cfo-institution-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-reauth-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #D62F7A;
}

.cfo-account-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfo-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfo-account-row img {
  display: block;
  flex-shrink: 0;
}

.cfo-account-name {
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.cfo-account-balance {
  flex: 1 0 0;
  min-width: 0;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
}

.cfo-accordion-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.cfo-text-link {
  padding: 0 8px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  text-decoration: underline;
  text-transform: capitalize;
}

.cfo-text-link:disabled {
  opacity: 0.5;
  cursor: default;
}

.cfo-text-link-coral { color: #D1817E; }
.cfo-text-link-white { color: var(--white); }

.cfo-manual-row {
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--navy-border);
  border-radius: 8px;
}

.cfo-manual-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.cfo-manual-type {
  color: var(--link-green);
}

.cfo-manual-name {
  color: var(--white);
  font-weight: 700;
}

.cfo-manual-empty {
  padding: 24px 0;
  color: var(--light-gray);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.cfo-manual-note {
  color: var(--light-gray);
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

/* --- Guess sliders --- */

.cfo-guess-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-radius: 12px;
  background: var(--navy-card);
}

.cfo-guess-hint {
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-guess-graph {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cfo-guess-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cfo-guess-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfo-guess-label {
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.cfo-guess-amount {
  flex: 1 0 0;
  min-width: 0;
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
}

.cfo-guess-amount.cfo-green { color: var(--link-green); }
.cfo-guess-amount.cfo-coral { color: #D1817E; }

.cfo-slider {
  position: relative;
  height: 32px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--navy-border);
  border-radius: 4px;
  background: var(--navy-card-secondary);
  overflow: hidden;
}

.cfo-slider-fill {
  flex-shrink: 0;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-radius: 4px;
  background: var(--figma-green);
}

.cfo-slider-fill img {
  display: block;
}

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

.cfo-result-bar {
  gap: 4px;
}

.cfo-result-value,
.cfo-result-over,
.cfo-result-less {
  flex-shrink: 0;
  border-radius: 4px;
}

.cfo-result-value { background: var(--figma-green); }
.cfo-result-over { background: #C96B67; }
.cfo-result-less { border: 2px solid var(--figma-green); }

.cfo-guess-caption {
  font-size: 14px;
  line-height: 1.4;
  text-align: right;
}

/* --- Results --- */

.cfo-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfo-result-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 12px;
  background: var(--navy-card-secondary);
}

.cfo-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cfo-result-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cfo-result-labels {
  display: flex;
  flex-direction: column;
}

.cfo-result-eyebrow {
  color: var(--light-gray);
  font-size: 12px;
  line-height: 1.4;
}

.cfo-result-label {
  color: var(--white);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-result-amount {
  flex-shrink: 0;
  color: var(--link-green);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.cfo-result-detail {
  color: var(--gold);
  font-size: 14px;
  line-height: 1.4;
}

.cfo-results-note {
  color: var(--light-gray);
  font-size: 12px;
  line-height: 1.4;
}

/* --- Centered hero (trial started / upgrade hand-off / snapshot) --- */

.cfo-hero {
  width: 623px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.cfo-hero-icon {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  padding: 4px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--figma-green);
}

.cfo-hero-icon.cfo-hero-gold {
  background: var(--gold);
}

.cfo-hero-icon img {
  display: block;
}

.cfo-hero-text {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cfo-hero-title {
  color: var(--white);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.cfo-hero-title.cfo-gold {
  color: var(--gold);
}

.cfo-hero-body {
  color: var(--light-gray);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.cfo-hero-error {
  color: #D1817E;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.cfo-store-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.cfo-store-link {
  width: 260px;
  text-transform: none;
}

.cfo-loading-bar {
  width: 100%;
  max-width: 400px;
  height: 4px;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  overflow: hidden;
}

.cfo-loading-bar-fill {
  width: 40%;
  height: 100%;
  border-radius: 8px;
  background: var(--gold);
  animation: cfo-loading 1.2s ease-in-out infinite;
}

@keyframes cfo-loading {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

/* --- Try Premium --- */

.cfo-premium {
  width: 750px;
  max-width: 100%;
  padding: 34px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.cfo-premium-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cfo-premium-sub {
  color: var(--white);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
}

.cfo-benefits {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: 12px;
  background: var(--navy-card);
}

.cfo-benefits-title {
  color: var(--gold);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-benefit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfo-benefit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cfo-benefit img {
  display: block;
  flex-shrink: 0;
}

.cfo-benefit p {
  flex: 1 0 0;
  min-width: 0;
  color: var(--white);
  font-size: 16px;
  line-height: 1.4;
}

.cfo-benefits-rule {
  height: 1px;
  background: var(--navy-border);
}

.cfo-benefits-best {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cfo-benefits-best-label {
  color: var(--light-gray);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.cfo-benefits-best-text {
  color: var(--gold);
  font-size: 16px;
  line-height: 1.4;
}

.cfo-premium-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.cfo-premium-price {
  color: var(--link-green);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

/* --- Narrow viewports --- */

@media (max-width: 720px) {
  .cfo-top { padding: 24px 16px; }
  .cfo-card { padding: 32px 24px; }
  .cfo-landing-card { padding: 32px 24px; }
  .cfo-landing-title,
  .cfo-hero-title { font-size: 32px; }
}

/* --- Reflow (WCAG 1.4.10 / 1.4.4) --- desktop unchanged. */

.cfo-landing-image,
.cfo-store-link {
  max-width: 100%;
}

@media (max-width: 767.98px) {
  .cfo-top {
    height: auto;
    min-height: 89px;
    gap: 12px;
  }

  .cfo-card,
  .cfo-landing-card {
    padding: 24px 16px;
    gap: 24px;
  }

  .cfo-premium {
    padding: 24px 0 32px;
  }

  .cfo-btn {
    height: auto;
    min-height: 40px;
    white-space: normal;
    text-align: center;
  }

  .cfo-landing-title,
  .cfo-hero-title,
  .cfo-title {
    overflow-wrap: anywhere;
  }

  .cfo-linked,
  .cfo-guess-card,
  .cfo-accordion.open {
    padding: 16px;
  }

  .cfo-manual-row {
    padding: 8px 12px;
  }

  .cfo-account-row,
  .cfo-guess-header,
  .cfo-result-top,
  .cfo-accordion-links {
    flex-wrap: wrap;
  }

  .cfo-institution-name,
  .cfo-account-name,
  .cfo-manual-text,
  .cfo-guess-label,
  .cfo-plaid-powered p {
    white-space: normal;
    min-width: 0;
  }
}
