/* Identity & AML page only: three stages, the flow-builder demo, timeline and decision. */

/* three stages */
.id-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.id-stage { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); padding: clamp(22px, 3vw, 32px); display: grid; gap: 10px; align-content: start; overflow: hidden; }
.id-stage-n { font: 600 var(--step-3)/1 var(--font-display); color: var(--accent); }
.id-stage h3 { font-size: 1.2rem; }
.id-stage p { color: var(--fg-muted); font-size: .97rem; }
@media (max-width: 860px) { .id-stages { grid-template-columns: minmax(0, 1fr); } }

/* flow builder */
.id-demo { align-items: start; }
.id-checks { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.id-checks legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; padding: 0; }
.id-checks label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg); cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.id-checks label:hover { border-color: var(--accent); }
.id-checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.id-checks input { accent-color: var(--accent); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.id-checks span { font-weight: 500; font-size: .95rem; line-height: 1.3; }
.id-checks small { display: block; color: var(--fg-muted); font-weight: 400; font-size: .84rem; margin-top: 2px; }
.id-rule { margin-top: 14px; padding: 12px 14px; border-inline-start: 3px solid var(--accent); background: var(--bg); border-radius: 0 var(--radius-m) var(--radius-m) 0; display: grid; gap: 4px; font-size: .9rem; }
.id-rule span { color: var(--fg-muted); }
.id-run { margin: 16px 0 10px; }

.id-out { display: grid; gap: 18px; min-width: 0; }
.id-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; min-height: 120px; }
.id-timeline:empty::before { content: "The checks you choose will appear here, in the order they run."; color: var(--fg-muted); font-size: .95rem; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius-m); }
.id-timeline li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); opacity: .45; transition: opacity .3s ease; }
.id-timeline li.is-done, .id-timeline li.is-active { opacity: 1; }
.id-timeline li.is-skipped { opacity: .4; }
.id-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .8rem; color: var(--fg-muted); background: var(--surface); }
.is-active .id-dot { border-color: var(--accent); animation: id-pulse 1s ease-in-out infinite; }
.is-done[data-res="pass"] .id-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.is-done[data-res="review"] .id-dot { background: #B7791F; border-color: #B7791F; color: #fff; }
.is-done[data-res="fail"] .id-dot { background: #C0392B; border-color: #C0392B; color: #fff; }
.id-name { font-weight: 500; font-size: .95rem; }
.id-name small { display: block; color: var(--fg-muted); font-weight: 400; font-size: .83rem; margin-top: 1px; }
.id-res { font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--fg-muted); white-space: nowrap; }
.is-done[data-res="pass"] .id-res { background: var(--accent-soft); color: var(--accent); }
.is-done[data-res="review"] .id-res { background: rgba(183, 121, 31, .14); color: #8A5A12; }
.is-done[data-res="fail"] .id-res { background: rgba(192, 57, 43, .12); color: #A3291C; }
@keyframes id-pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }

.id-decision { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; display: grid; gap: 4px; background: var(--bg); transition: border-color .3s ease, background-color .3s ease; }
.id-decision small { color: var(--fg-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.id-decision b { font: 600 var(--step-1)/1.2 var(--font-display); }
.id-decision p { color: var(--fg-muted); font-size: .92rem; }
.id-decision[data-state="pass"] { border-color: var(--accent); background: var(--accent-soft); }
.id-decision[data-state="pass"] b { color: var(--accent); }
.id-decision[data-state="review"] { border-color: #B7791F; background: rgba(183, 121, 31, .1); }
.id-decision[data-state="review"] b { color: #8A5A12; }
.id-decision[data-state="fail"] { border-color: #C0392B; background: rgba(192, 57, 43, .08); }
.id-decision[data-state="fail"] b { color: #A3291C; }
.id-out .readout b { white-space: normal; }

:root[data-theme="dark"] .is-done[data-res="review"] .id-res, :root[data-theme="dark"] .id-decision[data-state="review"] b { color: #F0B85A; }
:root[data-theme="dark"] .is-done[data-res="fail"] .id-res, :root[data-theme="dark"] .id-decision[data-state="fail"] b { color: #F08A7E; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .is-done[data-res="review"] .id-res, :root:not([data-theme="light"]) .id-decision[data-state="review"] b { color: #F0B85A; }
  :root:not([data-theme="light"]) .is-done[data-res="fail"] .id-res, :root:not([data-theme="light"]) .id-decision[data-state="fail"] b { color: #F08A7E; }
}
@media (prefers-reduced-motion: reduce) { .is-active .id-dot { animation: none; } }
.id-out .readout b#id-monitor { font-size: 1.05rem; line-height: 1.3; }
.id-dot { font-weight: 700; }
