/* ==========================================================================
   Wize AI Agent page: "Watch a request become a result." (scenario tabs + four-step stage).
   Markup: template-parts/rc-v4-wize-ai-agent/flow.php. Behaviour: js/rc-v4-wize-ai-agent/flow.js.
   ========================================================================== */

/* ---------- scenario tabs ---------- */
.rc-wize-flow .rc-wize-flow-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.rc-wize-flow .rc-wize-flow-tabs button {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--rc-wize-line); border-radius: 18px; background: rgba(255, 255, 255, 0.55);
  font-family: var(--rc-font); font-size: 16px; line-height: 1.55; color: var(--rc-ink); cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s;
}
.rc-wize-flow .rc-wize-flow-tabs button:hover { background: #fff; border-color: rgba(20, 18, 31, 0.28); }
.rc-wize-flow .rc-wize-flow-tabs button.is-on { background: #fff; border-color: var(--rc-wize-violet); }
.rc-wize-flow .rc-wize-flow-tab-icon {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: var(--rc-wize-soft); color: var(--rc-wize-violet); transition: background-color 0.25s, color 0.25s;
}
.rc-wize-flow .rc-wize-flow-tabs .is-on .rc-wize-flow-tab-icon { background: var(--rc-wize-violet); color: #fff; }
.rc-wize-flow .rc-wize-flow-tab-text { min-width: 0; }
.rc-wize-flow .rc-wize-flow-tab-text b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.rc-wize-flow .rc-wize-flow-tab-text small {
  display: block; margin-top: 2px; font-family: var(--rc-font-label); font-size: 10.5px; line-height: 1.55;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--rc-wize-muted);
}

/* ---------- stage: four cards joined by links ---------- */
.rc-wize-flow .rc-wize-flow-stage {
  display: grid; align-items: stretch; min-height: 392px; padding: 22px;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1.12fr) 30px minmax(0, 1.12fr) 30px minmax(0, 1.12fr);
  background: #f2f1fe; border: 1px solid #e2e1fe; border-radius: 26px;
}
.rc-wize-flow .rc-wize-flow-step {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px; border-radius: 18px; background: #fff;
  opacity: 0.4; transform: translateY(6px); transition: opacity 0.28s, transform 0.28s var(--rc-ease);
}
.rc-wize-flow .rc-wize-flow-step.is-on { opacity: 1; transform: none; }
.rc-wize-flow .rc-wize-flow-step-head {
  display: flex; align-items: center; gap: 9px; font-family: var(--rc-font-label); font-size: 11px; line-height: 1.55;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--rc-wize-muted);
}
.rc-wize-flow .rc-wize-flow-step-head span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: #ece7ff; color: var(--rc-wize-deep); font-size: 11px; font-weight: 600; letter-spacing: 0;
}
.rc-wize-flow .rc-wize-flow-step-ai .rc-wize-flow-step-head { color: var(--rc-wize-deep); }
.rc-wize-flow .rc-wize-flow-step-ai .rc-wize-flow-step-head span { background: var(--rc-wize-violet); color: #fff; }
.rc-wize-flow .rc-wize-flow-step .rc-wize-bubble { max-width: 100%; animation: none; }

.rc-wize-flow .rc-wize-flow-acts { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rc-wize-flow .rc-wize-flow-acts li {
  display: flex; align-items: flex-start; gap: 10px; font-family: var(--rc-font-text); font-size: 14.5px; line-height: 1.4; color: var(--rc-ink);
  opacity: 0.3; transform: translateX(-6px); transition: opacity 0.28s, transform 0.28s var(--rc-ease);
}
.rc-wize-flow .rc-wize-flow-acts li.is-on { opacity: 1; transform: none; }
.rc-wize-flow .rc-wize-flow-acts li span {
  display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid rgba(20, 18, 31, 0.2); color: transparent; transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.rc-wize-flow .rc-wize-flow-acts li.is-on span { background: var(--rc-wize-violet); border-color: var(--rc-wize-violet); color: #fff; }

.rc-wize-flow .rc-wize-flow-tool { display: flex; flex-direction: column; gap: 10px; }
.rc-wize-flow .rc-wize-flow-tool-top { display: flex; align-items: center; gap: 10px; }
.rc-wize-flow .rc-wize-flow-tool-top b { font-size: 15.5px; font-weight: 600; line-height: 1.55; letter-spacing: -0.01em; }
.rc-wize-flow .rc-wize-flow-tool-icon {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: #fff; border: 1px solid var(--rc-wize-line); color: var(--rc-wize-violet);
}
.rc-wize-flow .rc-wize-flow-tool-call {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--rc-font-label); font-size: 11px; line-height: 1.55; letter-spacing: 0.05em; text-transform: uppercase; color: var(--rc-wize-muted);
}
.rc-wize-flow .rc-wize-flow-tool-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: #eff2f4; color: #4d657c; font-family: var(--rc-font); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.rc-wize-flow .rc-wize-flow-tool-status i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #b2bbc5; }
.rc-wize-flow .rc-wize-flow-tool-status.is-run { background: #e1edff; color: #004fff; }
.rc-wize-flow .rc-wize-flow-tool-status.is-run i { background: #004fff; animation: rc-wize-pulse 0.9s ease-in-out infinite; }
.rc-wize-flow .rc-wize-flow-tool-status.is-done { background: var(--rc-wize-ok-bg); color: var(--rc-wize-ok-ink); }
.rc-wize-flow .rc-wize-flow-tool-status.is-done i { background: var(--rc-wize-ok); }
.rc-wize-flow .rc-wize-flow-tool-rows {
  display: grid; gap: 6px; margin: 0; padding: 12px; border: 1px solid var(--rc-wize-line); border-radius: 12px; background: #fff;
  opacity: 0.35; transition: opacity 0.28s;
}
.rc-wize-flow .rc-wize-flow-tool-rows.is-on { opacity: 1; }
.rc-wize-flow .rc-wize-flow-tool-rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; line-height: 1.55; }
.rc-wize-flow .rc-wize-flow-tool-rows dt { font-weight: 400; color: var(--rc-wize-muted); }
.rc-wize-flow .rc-wize-flow-tool-rows dd { margin: 0; font-weight: 500; text-align: right; }

.rc-wize-flow .rc-wize-flow-result { display: grid; gap: 8px; opacity: 0; transform: translateY(6px); transition: opacity 0.28s, transform 0.28s var(--rc-ease); }
.rc-wize-flow .rc-wize-flow-result.is-on { opacity: 1; transform: none; }
.rc-wize-flow .rc-wize-flow-result p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--rc-ink-2); }
.rc-wize-flow .rc-wize-flow-step-out .rc-wize-outcome { margin: 0; }

.rc-wize-flow .rc-wize-flow-link {
  display: block; position: relative; align-self: center; height: 2px; margin-inline: 4px; overflow: hidden;
  border-radius: 2px; background: rgba(20, 18, 31, 0.12);
}
.rc-wize-flow .rc-wize-flow-link::after {
  content: ''; position: absolute; inset: 0; background: var(--rc-wize-violet);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--rc-ease);
}
.rc-wize-flow .rc-wize-flow-link.is-on::after { transform: scaleX(1); }

.rc-wize-flow .rc-wize-cta-center { margin-top: 32px; }

@media (max-width: 1000px) {
  .rc-wize-flow .rc-wize-flow-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-wize-flow .rc-wize-flow-stage { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .rc-wize-flow .rc-wize-flow-step { opacity: 0.45; }
  .rc-wize-flow .rc-wize-flow-step.is-on { opacity: 1; }
  .rc-wize-flow .rc-wize-flow-link { width: 2px; height: 22px; margin: 0 0 0 26px; }
  .rc-wize-flow .rc-wize-flow-link::after { transform: scaleY(0); transform-origin: top; }
  .rc-wize-flow .rc-wize-flow-link.is-on::after { transform: scaleY(1); }
}
@media (max-width: 700px) {
  .rc-wize-flow .rc-wize-flow-tabs button { padding: 12px; gap: 10px; }
  .rc-wize-flow .rc-wize-flow-tab-icon { width: 34px; height: 34px; }
  .rc-wize-flow .rc-wize-flow-tab-text b { font-size: 14.5px; }
}

/* ---------- tighter corner radii, stepping down from the big box to the small parts (V4 2130849) ---------- */
.rc-wize-flow .rc-wize-flow-tabs button { border-radius: 12px; }
.rc-wize-flow .rc-wize-flow-tab-icon { border-radius: 8px; }
.rc-wize-flow .rc-wize-flow-stage { border-radius: 16px; }
.rc-wize-flow .rc-wize-flow-step { border-radius: 12px; }
.rc-wize-flow .rc-wize-flow-tool-icon { border-radius: 8px; }
.rc-wize-flow .rc-wize-flow-tool-rows { border-radius: 8px; }
.rc-wize-flow .rc-wize-bubble-customer { border-radius: 12px 12px 4px 12px; }
.rc-wize-flow .rc-wize-bubble-agent { border-radius: 12px 12px 12px 4px; }
