.flow-page {
  width: calc(100% - 70px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 82px;
  display: grid;
  grid-template-rows: auto minmax(250px, 1fr) auto;
}

.flow-topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 64px;
}

.flow-page.is-entering .flow-topbar {
  animation: flow-text-enter 320ms cubic-bezier(0.16, 1, 0.3, 1) 0ms both;
}

.flow-topbar .button.primary.small {
  min-height: 44px;
  margin-top: -28px;
  margin-right: 60px;
  display: inline-flex;
  align-items: center;
}

.flow-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: -28px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 0 18px;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(7, 28, 85, 0.13);
  transition: transform 0.18s cubic-bezier(0.2, 1.7, 0.36, 1), background 0.16s ease;
}

.flow-back:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translate(2px, 2px) scale(1.02);
}

.flow-hero {
  position: relative;
  top: 0;
  max-width: 1120px;
  align-self: center;
  margin: 0 auto;
  text-align: center;
  transform: translateY(-2px);
  will-change: transform;
}

.flow-page.is-expanded .flow-hero {
  top: -22px;
}

.flow-eyebrow {
  margin: 0 0 16px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flow-page.is-entering .flow-eyebrow {
  animation: flow-text-enter 340ms cubic-bezier(0.16, 1, 0.3, 1) 20ms both;
}

.flow-hero h1 {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: clamp(70px, 6vw, 100px);
  font-weight: 950;
  line-height: 1.02;
}

.flow-page.is-entering .flow-hero h1 {
  animation: flow-text-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) 50ms both;
}

.flow-lead {
  position: relative;
  top: 18px;
  width: min(980px, 100%);
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 26px;
  font-weight: 780;
  line-height: 1.7;
  text-align: justify;
  text-align-last: justify;
}

.flow-page.is-entering .flow-lead {
  animation: flow-text-enter 380ms cubic-bezier(0.16, 1, 0.3, 1) 90ms both;
}

.flow-stage {
  position: relative;
  display: grid;
  align-self: end;
  gap: 6px;
  margin-top: 0;
  padding: 0 0 clamp(86px, 10vh, 118px);
}

.flow-cards {
  position: relative;
  top: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
  will-change: transform;
}

.flow-stage.is-expanded .flow-cards {
  top: 0;
}

.flow-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 228px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  padding: 20px 18px 18px;
  text-align: left;
  box-shadow: 5px 5px 0 rgba(7, 28, 85, 0.1);
  transition: transform 0.22s cubic-bezier(0.2, 1.8, 0.34, 1), background 0.18s ease, box-shadow 0.18s ease;
}

.flow-page.is-entering .flow-card {
  animation: flow-card-enter 390ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

.flow-page.is-entering .flow-card:nth-child(1) {
  animation-delay: 150ms;
}

.flow-page.is-entering .flow-card:nth-child(2) {
  animation-delay: 190ms;
}

.flow-page.is-entering .flow-card:nth-child(3) {
  animation-delay: 230ms;
}

.flow-page.is-entering .flow-card:nth-child(4) {
  animation-delay: 270ms;
}

.flow-page.is-entering .flow-card:nth-child(5) {
  animation-delay: 310ms;
}

.flow-page.is-entering .flow-card:nth-child(6) {
  animation-delay: 350ms;
}

.flow-card:hover,
.flow-card.is-active {
  background: rgba(255, 255, 255, 0.68);
  transform: translateY(-3px) scale(1.014);
  box-shadow: 7px 8px 0 rgba(7, 28, 85, 0.12);
}

.flow-card.is-active {
  outline: 3px solid rgba(22, 170, 162, 0.18);
}

.flow-card.is-active span {
  background: var(--amber);
  color: var(--ink);
  animation: jelly-pop 0.48s ease both;
}

.flow-card span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(135deg, #28c3b7, var(--teal-dark));
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 9px 18px rgba(22, 170, 162, 0.18);
}

.flow-card strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
  line-height: 1.15;
}

.flow-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.68;
}

.flow-detail {
  position: relative;
  justify-self: start;
  display: block;
  width: var(--detail-width, 540px);
  min-height: 228px;
  margin: -2px 0 0 var(--detail-x, 0px);
  border: 2px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(22, 170, 162, 0.1), transparent 48%, rgba(255, 195, 66, 0.18)),
    rgba(255, 255, 255, 0.52);
  padding: 30px 34px;
  box-shadow: 8px 8px 0 rgba(7, 28, 85, 0.1);
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  text-align: left;
  will-change: transform, opacity;
}

.flow-stage.is-expanded {
  padding-bottom: clamp(72px, 8vh, 96px);
}

.flow-detail.is-align-right {
  justify-self: start;
}

.flow-detail[hidden] {
  display: none;
}

.flow-detail.is-preparing {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.985);
}

.flow-detail.is-changing {
  animation: detail-in 900ms cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.flow-detail p {
  max-width: none;
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 720;
  line-height: 1.86;
}

@keyframes flow-text-enter {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes flow-card-enter {
  0% {
    opacity: 0;
    transform: translateX(-22px) translateY(12px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

@keyframes detail-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 26px, 0) scale(0.985);
  }
  18% {
    opacity: 0;
    transform: translate3d(0, 26px, 0) scale(0.985);
  }
  58% {
    opacity: 0.88;
    transform: translate3d(0, 6px, 0) scale(0.998);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
