/*
 * Money-flow animation — the visual for the "Omzet" showcase spotlight.
 * A single app-card that walks through inbox -> offerte -> factuur -> iDEAL ->
 * betaald as a satisfying, auto-looping sequence (driven by js/money-flow.js,
 * gated on an IntersectionObserver so it only plays while on screen).
 *
 * Everything is prefixed `mf-` and every custom property is scoped to
 * `.mf-device`, so this component can never collide with landing styles.
 */
.mf-device {
  /* Light is the default (matches landing convention: :root = light,
     [data-theme="dark"] overrides). Every colour routes through these
     scoped vars, so theming is a variable swap only. */
  --mf-surface: #ffffff;
  --mf-surface-2: #f4f2fa;
  --mf-ink: #1e1a2b;
  --mf-ink-soft: #4b4658;
  --mf-ink-faint: #6c6780;
  --mf-line: #ebe7f2;
  --mf-line-strong: #d9d3e6;
  --mf-violet: #7c3aed;
  --mf-violet-soft: rgba(124, 58, 237, 0.12);
  --mf-green: #059669;
  --mf-green-deep: #047857;
  --mf-green-soft: rgba(5, 150, 105, 0.12);
  --mf-ideal: #cc0066;
  --mf-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1.5rem 3rem rgba(124, 58, 237, 0.14);
  --mf-num: ui-monospace, "SF Mono", "Geist Mono", Menlo, monospace;
  --mf-ease: cubic-bezier(0.2, 0.75, 0.2, 1);
  --mf-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  width: min(100%, 26rem);
  margin: 0 auto;
  background: var(--mf-surface);
  border: 1px solid var(--mf-line-strong);
  border-radius: 1.4rem;
  box-shadow: var(--mf-shadow);
  overflow: hidden;
  color: var(--mf-ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] .mf-device {
  --mf-surface: #191423;
  --mf-surface-2: #211a30;
  --mf-ink: #f4f1fb;
  --mf-ink-soft: #bab3cd;
  --mf-ink-faint: #8a8399;
  --mf-line: #292337;
  --mf-line-strong: #392f4e;
  --mf-violet: #8b5cf6;
  --mf-violet-soft: rgba(139, 92, 246, 0.16);
  --mf-green: #10b981;
  --mf-green-deep: #059669;
  --mf-green-soft: rgba(16, 185, 129, 0.15);
  --mf-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 2rem 4rem rgba(88, 28, 135, 0.4);
}
.mf-device *,
.mf-device *::before,
.mf-device *::after { box-sizing: border-box; }

.mf-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--mf-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}
.mf-brandmark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.45rem;
  flex: none;
  background: linear-gradient(135deg, var(--mf-violet), var(--mf-green));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}
.mf-brandname { font-weight: 700; font-size: 0.85rem; letter-spacing: -0.01em; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--mf-ink-faint);
  text-transform: lowercase;
}
.mf-live i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--mf-green);
  animation: mf-pulse 2s var(--mf-ease) infinite;
}

/* ---- rail ---- */
.mf-rail { display: flex; padding: 1rem 1.1rem 0.4rem; }
.mf-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}
.mf-node + .mf-node::before {
  content: "";
  position: absolute;
  top: 0.72rem;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--mf-line-strong);
  z-index: 0;
}
.mf-node + .mf-node::after {
  content: "";
  position: absolute;
  top: 0.72rem;
  right: 50%;
  width: 0%;
  height: 2px;
  background: var(--mf-green);
  z-index: 1;
  transition: width 0.5s var(--mf-ease);
}
.mf-node.mf-done + .mf-node::after,
.mf-node.mf-active + .mf-node::after { width: 100%; }
.mf-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  background: var(--mf-surface-2);
  border: 2px solid var(--mf-line-strong);
  display: grid;
  place-items: center;
  transition: all 0.35s var(--mf-spring);
  color: var(--mf-ink-faint);
}
.mf-dot svg {
  width: 0.8rem;
  height: 0.8rem;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.3s var(--mf-spring);
}
.mf-node.mf-active .mf-dot {
  border-color: var(--mf-violet);
  background: var(--mf-violet-soft);
  color: var(--mf-violet);
  transform: scale(1.12);
  box-shadow: 0 0 0 5px var(--mf-violet-soft);
}
.mf-node.mf-done .mf-dot { border-color: var(--mf-green); background: var(--mf-green); color: #fff; }
.mf-node.mf-done .mf-dot svg { opacity: 1; transform: scale(1); }
.mf-num { font-size: 0.72rem; font-weight: 700; font-family: var(--mf-num); }
.mf-node.mf-done .mf-num { display: none; }
.mf-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mf-ink-faint);
  text-transform: uppercase;
  transition: color 0.35s var(--mf-ease);
}
.mf-node.mf-active .mf-label { color: var(--mf-ink); }
.mf-node.mf-done .mf-label { color: var(--mf-green); }

/* ---- stage ---- */
.mf-stage { position: relative; height: 21rem; margin: 0.3rem 0.4rem 0; }
.mf-panel {
  position: absolute;
  inset: 0;
  padding: 0.6rem 1.1rem 1rem;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.45s var(--mf-ease), transform 0.45s var(--mf-ease);
}
.mf-panel.mf-is-active { opacity: 1; transform: none; }
.mf-panel.mf-is-leaving {
  opacity: 0;
  transform: translateY(-14px) scale(0.985);
  transition-duration: 0.32s;
}

.mf-phead { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; }
.mf-ptitle { font-size: 0.82rem; font-weight: 700; letter-spacing: -0.01em; }
.mf-psub { font-size: 0.7rem; color: var(--mf-ink-faint); font-family: var(--mf-num); }
.mf-chip {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--mf-line-strong);
  color: var(--mf-ink-faint);
  background: var(--mf-surface-2);
  white-space: nowrap;
}
.mf-chip.mf-violet { color: var(--mf-violet); background: var(--mf-violet-soft); border-color: transparent; }

/* stagger children of the active panel */
.mf-panel.mf-is-active .mf-st { animation: mf-rise 0.5s var(--mf-ease) both; }
.mf-panel.mf-is-active .mf-st:nth-child(2) { animation-delay: 0.08s; }
.mf-panel.mf-is-active .mf-st:nth-child(3) { animation-delay: 0.16s; }
.mf-panel.mf-is-active .mf-st:nth-child(4) { animation-delay: 0.24s; }

/* mail row */
.mf-mailrow {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: var(--mf-surface-2);
  border: 1px solid var(--mf-line);
}
.mf-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(135deg, #f472b6, #a855f7);
}
.mf-mailmeta { min-width: 0; }
.mf-mailfrom { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 700; }
.mf-unread { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--mf-violet); flex: none; }
.mf-panel.mf-is-active .mf-unread { animation: mf-ping 1.4s var(--mf-ease) 1 0.5s; }
.mf-mailsub { font-size: 0.76rem; color: var(--mf-ink-soft); margin-top: 0.15rem; }
.mf-mailsnip {
  font-size: 0.72rem;
  color: var(--mf-ink-faint);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mf-caption { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.9rem; font-size: 0.72rem; color: var(--mf-ink-faint); }
.mf-caption svg { color: var(--mf-violet); flex: none; }

/* document */
.mf-doc {
  background: var(--mf-surface-2);
  border: 1px solid var(--mf-line);
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem 0.8rem;
  position: relative;
  overflow: hidden;
}
.mf-who { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.5rem; }
.mf-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--mf-ink-soft);
  padding: 0.26rem 0;
  border-bottom: 1px dashed var(--mf-line-strong);
}
.mf-line:last-of-type { border-bottom: none; }
.mf-amt { font-family: var(--mf-num); font-variant-numeric: tabular-nums; color: var(--mf-ink); }
.mf-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1.5px solid var(--mf-line-strong);
}
.mf-total .mf-lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--mf-ink-faint); font-weight: 600; }
.mf-total .mf-big { font-family: var(--mf-num); font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.45rem; letter-spacing: -0.02em; }

/* akkoord stamp */
.mf-stamp {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mf-green);
  border: 2px solid var(--mf-green);
  border-radius: 0.5rem;
  padding: 0.2rem 0.5rem;
  transform: rotate(-11deg) scale(0);
  opacity: 0;
}
.mf-panel.mf-is-active .mf-stamp { animation: mf-thunk 0.55s var(--mf-spring) 1.1s both; }

/* ideal */
.mf-paybtn {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--mf-green-deep);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 0.65rem;
  padding: 0.65rem;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.32);
}
.mf-ideal-tag {
  font-size: 0.66rem;
  font-weight: 800;
  font-style: italic;
  background: rgba(255, 255, 255, 0.22);
  padding: 0.08rem 0.32rem;
  border-radius: 0.28rem;
}
.mf-panel.mf-is-active .mf-paybtn.mf-tap { animation: mf-tap 0.5s var(--mf-ease) 1s both; }

.mf-sheet {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: -0.4rem;
  background: var(--mf-surface);
  border: 1px solid var(--mf-line-strong);
  border-bottom: none;
  border-radius: 1rem 1rem 0 0;
  padding: 0.85rem 0.95rem 1.1rem;
  transform: translateY(115%);
  transition: transform 0.5s var(--mf-spring);
  box-shadow: 0 -1.5rem 3rem rgba(0, 0, 0, 0.5);
}
.mf-panel.mf-is-active .mf-sheet { transform: translateY(0); transition-delay: 1.25s; }
.mf-grip { width: 2.2rem; height: 0.28rem; border-radius: 999px; background: var(--mf-line-strong); margin: 0 auto 0.7rem; }
.mf-sheet-title { font-size: 0.78rem; font-weight: 700; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.4rem; }
.mf-ideal-mark { color: var(--mf-ideal); font-weight: 900; font-style: italic; font-size: 0.9rem; letter-spacing: -0.03em; }
.mf-bank {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid var(--mf-line);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.mf-bank .mf-bankdot { width: 1.4rem; height: 1.4rem; border-radius: 0.4rem; flex: none; display: grid; place-items: center; font-size: 0.62rem; font-weight: 800; color: #fff; }
.mf-bank .mf-pick { margin-left: auto; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--mf-line-strong); }
.mf-panel.mf-is-active .mf-bank.mf-sel { animation: mf-bank-sel 0.4s var(--mf-ease) 2s both; }
.mf-panel.mf-is-active .mf-bank.mf-sel .mf-pick { animation: mf-pick-on 0.35s var(--mf-spring) 2.25s both; }
.mf-sheet-status { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 0.7rem; font-size: 0.76rem; font-weight: 600; color: var(--mf-ink-faint); opacity: 0; }
.mf-panel.mf-is-active .mf-sheet-status { animation: mf-fade-up 0.4s var(--mf-ease) 2.7s both; }
.mf-spin { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--mf-line-strong); border-top-color: var(--mf-ideal); animation: mf-spin 0.7s linear infinite; }

/* paid */
.mf-paid { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; gap: 0.15rem; position: relative; }
.mf-ring { width: 4.5rem; height: 4.5rem; margin-bottom: 0.7rem; }
.mf-ring circle.mf-ring-bg { fill: var(--mf-green-soft); }
.mf-ring circle.mf-ring-line {
  fill: none;
  stroke: var(--mf-green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 189;
  stroke-dashoffset: 189;
  transform: rotate(-90deg);
  transform-origin: center;
}
.mf-ring path { fill: none; stroke: var(--mf-green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.mf-panel.mf-is-active .mf-ring circle.mf-ring-line { animation: mf-draw 0.6s var(--mf-ease) 0.15s forwards; }
.mf-panel.mf-is-active .mf-ring path { animation: mf-draw 0.4s var(--mf-ease) 0.6s forwards; }
.mf-paid-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mf-green); }
.mf-paid-amt { font-family: var(--mf-num); font-variant-numeric: tabular-nums; font-weight: 800; font-size: 2.4rem; letter-spacing: -0.03em; }
.mf-paid-note { font-size: 0.78rem; color: var(--mf-ink-soft); }
.mf-paid-via { margin-top: 0.55rem; display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.7rem; color: var(--mf-ink-faint); }
.mf-paid-via b { color: var(--mf-ideal); font-style: italic; }
.mf-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

@keyframes mf-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes mf-pulse { 0% { box-shadow: 0 0 0 0 var(--mf-green-soft); } 70% { box-shadow: 0 0 0 0.4rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes mf-ping { 0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.55); } 70% { box-shadow: 0 0 0 0.5rem rgba(139, 92, 246, 0); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes mf-thunk { 0% { transform: rotate(-11deg) scale(2.2); opacity: 0; } 60% { transform: rotate(-11deg) scale(0.9); opacity: 1; } 100% { transform: rotate(-11deg) scale(1); opacity: 1; } }
@keyframes mf-tap { 0%, 100% { transform: none; } 45% { transform: scale(0.96); filter: brightness(1.15); } }
@keyframes mf-bank-sel { to { border-color: var(--mf-ideal); background: rgba(204, 0, 102, 0.08); } }
@keyframes mf-pick-on { to { border-color: var(--mf-ideal); background: var(--mf-ideal); box-shadow: inset 0 0 0 3px var(--mf-surface); } }
@keyframes mf-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mf-spin { to { transform: rotate(360deg); } }
@keyframes mf-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mf-device *,
  .mf-device *::before,
  .mf-device *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
