/* InTech Solutions — CCFS financing lifecycle diagram.
   Adapted from the "Koperasi Financing Lifecycle" artifact: the same flow and animation,
   re-themed to the brand palette and scoped to .ccfs-flow so it cannot affect the rest of
   the page. Colour roles keep the artifact's names so the diagram rules read unchanged. */
.ccfs-flow {
  /* surfaces */
  --bg: transparent;
  --card: #0f1c31;              /* surface */
  --ink: #e9f1fb;
  --muted: #8ba3c2;
  --line: rgba(146, 180, 226, .16);
  --line-strong: rgba(146, 180, 226, .30);

  /* primary accent — InTech cyan */
  --pine: #3eb9f0;
  --pine-soft: rgba(62, 185, 240, .16);

  /* secondary accent — soft blue (replaces the artifact's gold) */
  --gold: #a8dcf5;
  --gold-soft: rgba(168, 220, 245, .16);

  /* swim-lane tints */
  --lane-portal: rgba(62, 185, 240, .07);
  --lane-core: rgba(146, 180, 226, .06);
  --lane-member: rgba(168, 220, 245, .07);

  --chip-bg: #142440;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35);

  color: var(--ink);
}

.ccfs-flow * { box-sizing: border-box; }
.ccfs-flow {
    color: var(--ink);
    font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
  }
.ccfs-flow .wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 24px 56px;
  }
.ccfs-flow header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 20px;
  }
.ccfs-flow .kicker {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pine);
    margin: 0 0 6px;
  }
.ccfs-flow h1 {
    font-family: "Archivo", "Figtree", sans-serif;
    font-weight: 700;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.1;
    margin: 0 0 6px;
    text-wrap: balance;
  }
.ccfs-flow .sub {
    color: var(--muted);
    max-width: 56ch;
    margin: 0;
  }
.ccfs-flow .controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
.ccfs-flow .controls button {
    font-family: "Figtree", sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    border-radius: 9px;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }
.ccfs-flow .controls button:hover { border-color: var(--line-strong); }
.ccfs-flow .controls button:focus-visible, .ccfs-flow .rail button:focus-visible {
    outline: 2px solid var(--pine);
    outline-offset: 2px;
  }
.ccfs-flow .controls .play {
    background: var(--pine);
    border-color: var(--pine);
    color: #fff;
    min-width: 88px;
  }
.ccfs-flow .controls #btn-sound { min-width: 108px; }
.ccfs-flow .controls #btn-sound[aria-pressed="true"] {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-soft);
  }
.ccfs-flow :root[data-theme="dark"] .controls .play, .ccfs-flow .controls .play { color: #fff; }
.ccfs-flow .stage-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 14px 14px 6px;
  }
.ccfs-flow .diagram-scroller { overflow-x: auto; }
.ccfs-flow .diagram-scroller svg {
    display: block;
    min-width: 1080px;
    width: 100%;
    height: auto;
  }
.ccfs-flow .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    padding: 10px 6px 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: var(--muted);
  }
.ccfs-flow .legend span { display: inline-flex; align-items: center; gap: 8px; }
.ccfs-flow .legend i { display: inline-block; }
.ccfs-flow .legend .l-main { width: 26px; border-top: 2px solid var(--line-strong); }
.ccfs-flow .legend .l-dash { width: 26px; border-top: 2px dashed var(--line-strong); }
.ccfs-flow .legend .l-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.ccfs-flow .legend .l-loop { font-style: normal; color: var(--pine); font-weight: 600; }
.ccfs-flow .lane { fill: var(--lane-core); }
.ccfs-flow .lane.portal { fill: var(--lane-portal); }
.ccfs-flow .lane.member { fill: var(--lane-member); }
.ccfs-flow .lane-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    fill: var(--muted);
  }
.ccfs-flow .edge {
    stroke: var(--line-strong);
    stroke-width: 2.84;
    fill: none;
    transition: stroke 0.4s;
  }
.ccfs-flow .edge.dashed { stroke-dasharray: 5 5; }
.ccfs-flow .edge.done { stroke: var(--pine); }
.ccfs-flow .edge-label {
    font-size: 13px;
    fill: var(--muted);
    font-family: "Figtree", sans-serif;
  }
.ccfs-flow #arrowhead path { fill: var(--line-strong); }
.ccfs-flow .node rect {
    fill: var(--card);
    stroke: var(--line);
    stroke-width: 2.27;
    rx: 13.6;
    transition: stroke 0.3s, fill 0.3s;
  }
.ccfs-flow .node.optional rect { stroke-dasharray: 5 4; }
.ccfs-flow .node text {
    font-family: "Figtree", sans-serif;
    font-size: 15.3px;
    font-weight: 600;
    fill: var(--ink);
  }
.ccfs-flow .node .icon {
    stroke: var(--line-strong);
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s;
  }
.ccfs-flow .node.visited .icon, .ccfs-flow .node.current .icon { stroke: var(--pine); }
.ccfs-flow .node .icon .thick { stroke-width: 2.2; }
.ccfs-flow .node .num circle { fill: var(--chip-bg); stroke: var(--line); stroke-width: 1.13; transition: fill 0.3s; }
.ccfs-flow .node .num text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14.2px; font-weight: 600; fill: var(--muted); transition: fill 0.3s; }
.ccfs-flow .node.visited rect { stroke: var(--pine); stroke-opacity: 0.45; }
.ccfs-flow .node.visited .num circle { fill: var(--pine-soft); stroke: none; }
.ccfs-flow .node.visited .num text { fill: var(--pine); }
.ccfs-flow .node.current rect {
    stroke: var(--pine);
    stroke-opacity: 1;
    filter: drop-shadow(0 3px 10px var(--pine-soft));
    animation: nodepulse 1.5s ease-in-out infinite;
  }
@keyframes nodepulse {
    0%, 100% { stroke-width: 2.95; }
    50%      { stroke-width: 4.54; }
  }
.ccfs-flow .node.current .num circle { fill: var(--pine); }
.ccfs-flow .node.current .num text { fill: #fff; }
.ccfs-flow .node .opt-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.6px;
    font-weight: 600;
    letter-spacing: 0.12em;
    fill: var(--gold);
  }
.ccfs-flow .inchip rect {
    fill: var(--card);
    stroke: var(--line-strong);
    stroke-width: 1.47;
    stroke-dasharray: 5 4;
  }
.ccfs-flow .inchip text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.9px;
    font-weight: 500;
    fill: var(--muted);
  }
.ccfs-flow .inchip .tag { fill: var(--pine); font-weight: 600; }
.ccfs-flow .edge.pulse {
    stroke: var(--gold);
    stroke-dasharray: 6 6;
    animation: dashmove 0.9s linear infinite;
  }
@keyframes dashmove { to { stroke-dashoffset: -24; } }
.ccfs-flow #tokenG { transition: opacity 0.2s; pointer-events: none; }
.ccfs-flow #token-halo { fill: var(--gold-soft); }
.ccfs-flow #tokenG .coin { fill: var(--gold); stroke: var(--card); stroke-width: 1.5; }
.ccfs-flow #tokenG .coin-in { fill: rgba(255, 255, 255, 0.5); }
.ccfs-flow #tokenG .spark line { stroke: rgba(255, 255, 255, 0.9); stroke-width: 1.4; stroke-linecap: round; }
.ccfs-flow #tokenG .spark {
    transform-origin: 0 0;
    animation: spin 1.1s linear infinite;
  }
@keyframes spin { to { transform: rotate(360deg); } }
.ccfs-flow .trail-dot { fill: var(--gold); pointer-events: none; }
.ccfs-flow .edge-glow {
    stroke: var(--pine);
    stroke-width: 3.4;
    fill: none;
    stroke-linecap: round;
    opacity: 0.85;
    pointer-events: none;
  }
.ccfs-flow .ripple {
    fill: none;
    stroke: var(--pine);
    stroke-width: 2;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    pointer-events: none;
  }
.ccfs-flow .ripple.go { animation: ripplefx 0.9s ease-out; }
.ccfs-flow .ripple.go.d2 { animation-delay: 0.16s; }
@keyframes ripplefx {
    0%   { opacity: 0.75; transform: scale(0.25); }
    100% { opacity: 0;    transform: scale(1.55); }
  }
.ccfs-flow .node { cursor: pointer; }
.ccfs-flow .node.pop {
    animation: pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-box: fill-box;
    transform-origin: center;
  }
@keyframes pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.07); }
    100% { transform: scale(1); }
  }
.ccfs-flow .callout {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    background: var(--card);
    border: 1.5px solid var(--pine);
    border-radius: 12px;
    padding: 10px 13px;
    box-shadow: var(--shadow);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
  }
.ccfs-flow .callout b {
    display: block;
    color: var(--ink);
    font-weight: 600;
    margin-bottom: 2px;
    font-family: "Figtree", sans-serif;
  }
.ccfs-flow .callout:not(.below) { transform: translateY(-100%); }
.ccfs-flow .callout.show { opacity: 1; animation: bubble 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bubble { from { opacity: 0; scale: 0.88; } }
.ccfs-flow .callout::after {
    content: "";
    position: absolute;
    left: calc(var(--px, 50%) - 6px);
    width: 11px;
    height: 11px;
    background: var(--card);
    border: 1.5px solid var(--pine);
    transform: rotate(45deg);
  }
.ccfs-flow .callout:not(.below)::after { bottom: -7px; border-top: none; border-left: none; }
.ccfs-flow .callout.below::after { top: -7px; border-bottom: none; border-right: none; }
.ccfs-flow .loop-label { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.2px; fill: var(--muted); letter-spacing: 0.06em; }
.ccfs-flow .loop-label.on { fill: var(--pine); font-weight: 600; }
.ccfs-flow .below {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    margin-top: 18px;
    align-items: start;
  }
.ccfs-flow .rail {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
.ccfs-flow .rail button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    font-family: "Figtree", sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
.ccfs-flow .rail button:hover { background: var(--pine-soft); color: var(--ink); }
.ccfs-flow .rail .n {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--chip-bg);
    color: var(--muted);
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
  }
.ccfs-flow .rail button.visited .n { background: var(--pine-soft); color: var(--pine); }
.ccfs-flow .rail button.current {
    background: var(--card);
    border-color: var(--line);
    color: var(--ink);
    font-weight: 600;
    box-shadow: var(--shadow);
  }
.ccfs-flow .rail button.current .n { background: var(--pine); color: #fff; }
.ccfs-flow .rail .opt {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-left: auto;
  }
.ccfs-flow .panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 22px 26px 24px;
    min-height: 208px;
  }
.ccfs-flow .panel .eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--pine);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
.ccfs-flow .panel .eyebrow .optional-badge {
    background: var(--gold-soft);
    color: var(--gold);
    border-radius: 5px;
    padding: 1px 7px;
  }
.ccfs-flow .panel h2 {
    font-family: "Archivo", "Figtree", sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    text-wrap: balance;
  }
.ccfs-flow .panel p {
    margin: 0 0 14px;
    max-width: 62ch;
    color: var(--ink);
  }
.ccfs-flow .outputs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
.ccfs-flow .outputs span {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    background: var(--chip-bg);
    border-radius: 6px;
    padding: 4px 10px;
  }
.ccfs-flow .panel-fade { animation: fadeup 0.35s ease both; }
@keyframes fadeup {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: none; }
  }
@media (max-width: 900px) {
.ccfs-flow .below { grid-template-columns: 1fr; }
.ccfs-flow .rail { flex-direction: row; flex-wrap: wrap; }
.ccfs-flow .rail button { width: auto; }
.ccfs-flow .rail button span.t { display: none; }
.ccfs-flow .rail button.current span.t { display: inline; }
.ccfs-flow .rail .opt { display: none; }
  
}



/* ---- controls, docked inside the diagram panel ------------------------- */
/* The artifact kept its controls in its own page header; here they float in the
   top-right of the stage card itself, compact so they don't crowd the diagram. */
.ccfs-flow .stage-card { position: relative; padding-top: 14px; }

.ccfs-flow .ccfs-controls-row {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  margin: 0;
  display: flex;
  justify-content: flex-end;
}
.ccfs-flow .ccfs-controls-row .controls { margin: 0; gap: 5px; }

.ccfs-flow .ccfs-controls-row .controls button {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  line-height: 1.5;
}
.ccfs-flow .ccfs-controls-row .controls .play { min-width: 58px; }
.ccfs-flow .ccfs-controls-row .controls #btn-sound { min-width: 78px; }

@media (max-width: 720px) {
  /* On a narrow screen the row would sit on top of the diagram: put it back in flow. */
  .ccfs-flow .stage-card { padding-top: 14px; }
  .ccfs-flow .ccfs-controls-row {
    position: static;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
}

/* The lifecycle sits in one of the site's dark bands, so its section heading
   takes the dark-zone ink colours rather than the light-content ones. */
#ccfs-lifecycle .section-head h2 { color: var(--d-ink); }
#ccfs-lifecycle .section-head p { color: var(--d-muted); }
#ccfs-lifecycle .section-head .eyebrow { color: var(--blue); }

/* ---- completed steps turn green ---------------------------------------- */
/* Same language as the order journey: cyan = in progress, green = completed. */
.ccfs-flow { --ok: #4ec98d; --ok-soft: rgba(78, 201, 141, .18); }

.ccfs-flow .node.visited rect { stroke: var(--ok); stroke-opacity: .55; }
.ccfs-flow .node.visited .num circle { fill: var(--ok-soft); stroke: none; }
.ccfs-flow .node.visited .num text { fill: var(--ok); }
.ccfs-flow .node.visited .icon { stroke: var(--ok); }
/* the step being played stays cyan, so it reads apart from the finished ones */
.ccfs-flow .node.current .icon { stroke: var(--pine); }

/* the rail below the diagram follows the same rule */
.ccfs-flow .rail button.visited .n { background: var(--ok-soft); color: var(--ok); }

/* ---- fit the diagram to the panel -------------------------------------- */
/* The artifact pinned the SVG to 1080px, which forced the whole panel to scroll
   sideways on anything narrower than a wide desktop. The SVG has a viewBox, so it
   scales cleanly instead: let it take the panel width and shrink with it. Below the
   phone breakpoint scaling would make the labels unreadable, so there it keeps a
   floor and scrolls horizontally as before. */
.ccfs-flow .diagram-scroller svg { min-width: 0; width: 100%; }

/* No breakpoint re-enables scrolling: the SVG scales all the way down. */

/* ---- caption bar, matching the order journey --------------------------- */
/* The rail and detail panel were replaced by this one-line commentary above the
   diagram, so the three product flows read identically. */
.ccfs-flow .caption-bar {
  margin: 26px 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-height: 58px;
}
.ccfs-flow .caption-bar .stepno {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  color: var(--pine);
  font-size: 13px;
  letter-spacing: 1.5px;
  white-space: nowrap;
}
.ccfs-flow .caption-bar .cap {
  font-size: 16.5px;
  font-weight: 500;
  color: var(--ink);
}

/* the play button carries the accent fill, as it does on the order journey */
.ccfs-flow .controls button.primary {
  background: var(--pine);
  border-color: var(--pine);
  color: #06263a;
}
.ccfs-flow .controls button.primary:hover { color: #06263a; filter: brightness(1.08); }
.ccfs-flow .controls #btn-sound[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

/* ---- legend, matching the order journey --------------------------------
   Moved out of the figure into its own row under the panel, and keyed to the
   animation's states (running / done / optional) rather than to line styles. */
.ccfs-flow .controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ccfs-flow .legend {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
  font-family: inherit;
  padding: 0;
}
.ccfs-flow .legend span { display: inline-flex; align-items: center; gap: 7px; }
.ccfs-flow .legend i {
  width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 0;
}
.ccfs-flow .legend .l-act i  { background: var(--pine); }
.ccfs-flow .legend .l-ok i   { background: var(--ok); }
.ccfs-flow .legend .l-warn i { background: var(--gold); }

/* Same gap between the docked buttons and the diagram as the Onyx journey. */
/* Same as the order journey: the SVG headroom is the gap; no extra padding. */
.ccfs-flow .stage-card { padding-top: 0; }

/* ---- static height, no scrolling ----------------------------------------
   Same as the other two journeys: clip instead of scroll, with the viewBox
   (1180 x 800) reserving the height so nothing shifts mid-animation. */
.ccfs-flow .diagram-scroller { overflow: hidden; }
.ccfs-flow .diagram-scroller svg { aspect-ratio: 1180 / 780; height: auto; min-width: 0; }

/* ---- legend, docked inside the panel ------------------------------------
   Was a row under the panel, outside its border. It now sits bottom-left in the
   space the diagram leaves, opposite the playback buttons. The step dialog is
   opaque and stacks above it, so a dialog opening downwards simply covers it
   for the moment it is open. */
.ccfs-flow .legend-row {
  position: absolute;
  left: 18px;
  bottom: 12px;
  z-index: 1;
}
.ccfs-flow .legend-row .legend { margin: 0; }

/* ---- panel, matched to the order journey -------------------------------
   14px of side padding made this SVG 8px narrower than the order journey's,
   which would have thrown the scale factor off; and the card carried a 16px
   radius against its 14px. */
.ccfs-flow .stage-card { padding: 0 10px 6px; border-radius: 14px; }
