/* ==========================================
   Payvanta Doc Modal (sidebar variant)
   Builds on modal.css: reuses .modal-backdrop / .modal-shell /
   .modal-bar / .modal-close, replaces the top tab bar with a
   doc-style | sidebar | content | layout.
   Markup lives inside .case-study so page component styles apply.
   ========================================== */

/* Re-sync tokens with the page theme (modal.css ships older values) */
.modal-backdrop.doc-modal{
  --cs-accent: #5c47e6;
  --cs-muted:  #49536b;
  --cs-sans:   'FC Iconic', sans-serif;
  font-family: var(--cs-sans);
}
.modal-backdrop.doc-modal[hidden]{ display: none; }
.doc-modal .modal-shell{ min-height: 0; }

/* Bar: title + language switch + close */
.doc-modal .modal-bar{ padding: 12px 24px; }
.doc-modal .modal-bar-inner{ max-width: none; }
.doc-modal .modal-lbl{
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 15px;
  letter-spacing: 0;
}
.doc-modal .modal-lbl small{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}
.doc-lang{
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 100px;
  background: rgba(255,255,255,.1);
}
.doc-lang button{
  border: none;
  background: transparent;
  color: rgba(255,255,255,.7);
  font: 600 11px/1 var(--cs-sans);
  padding: 6px 10px;
  border-radius: 100px;
  cursor: pointer;
}
.doc-lang button.active{ background: #fff; color: var(--cs-primary); }

/* Layout */
.doc-layout{
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}
.doc-nav{
  overflow-y: auto;
  border-right: 1px solid var(--cs-line);
  background: #f9f9fc;
  padding: 24px 14px 32px;
}
.doc-nav-group{
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cs-ink);
  padding: 18px 12px 0;
  margin: 18px 0 6px;
  border-top: 1px solid var(--cs-line); /* hr between groups */
}
.doc-nav-group:first-child{ margin-top: 0; padding-top: 0; border-top: none; }
.doc-nav-item{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  font: 400 14.5px/1.35 var(--cs-sans);
  color: #4b4a5c;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.doc-nav-item:hover{ background: rgba(92,71,230,.07); }
.doc-nav-item.on{
  background: rgba(92,71,230,.12);
  color: var(--cs-brand);
  font-weight: 700;
}
.doc-nav-item:focus-visible,
.doc-pager button:focus-visible{
  outline: 2px solid var(--cs-brand);
  outline-offset: 2px;
}

.doc-content{
  overflow-y: auto;
  container-type: inline-size;
  background: #fff;
}
.doc-panel{
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 40px 56px;
}
@media (max-width: 1599px){ .doc-panel[data-panel="builder"]{ max-width: 1200px; } }
.doc-panel[hidden]{ display: none; }

/* Panel typography */
.case-study .doc-panel .doc-kicker{
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cs-accent);
  margin-bottom: 10px;
}
.case-study .doc-panel h3.doc-title{
  font-size: 28px;
  line-height: 1.3;
  color: var(--cs-ink);
  margin: 0 0 12px;
}
.case-study .doc-panel h4.doc-sub{
  font-size: 18px;
  font-weight: 700;
  color: var(--cs-ink);
  margin: 36px 0 12px;
}
.case-study .doc-panel p.body{ font-size: 16px; }
.case-study .doc-panel p.body + p.body{ margin-top: 10px; }
.case-study .doc-panel .doc-block{ margin-top: 28px; }

/* Stat strip (Form overview) */
.doc-stats{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 28px;
}
.doc-stat{
  border: 1px solid var(--cs-line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fafbfe;
}
.case-study .doc-stat strong{
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--cs-brand);
  line-height: 1.2;
}
.case-study .doc-stat span{ font-size: 14px; color: var(--cs-muted); }
.case-study .doc-stat strong span{ font-size: inherit; color: inherit; }

/* Decision list (Form overview) */
.decision-list{
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}
.decision-item{
  border: 1px solid var(--cs-line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
}
.case-study .decision-item .decision-step{
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cs-brand);
  background: rgba(92,71,230,.09);
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
}
.case-study .decision-item strong{
  display: block;
  font-size: 15.5px;
  color: var(--cs-ink);
  line-height: 1.45;
  margin-bottom: 4px;
}
.case-study .decision-item p{ font-size: 14px; color: var(--cs-muted); line-height: 1.55; }

/* Screen map (Form overview), ported from _payvanta-merchant-backup/onboarding-flow */
.sm-pair{ display:flex; flex-direction:column; gap:24px; margin-top:12px; }
.sm-switch [hidden]{ display:none !important; }
.sm-switch{ margin:36px 0 44px; }
.sm-tabs{
  display:flex; width:fit-content; max-width:100%; gap:4px; margin:0 auto; padding:5px;
  background:#fff; border:1px solid var(--cs-line); border-radius:12px;
  box-shadow:0 2px 8px rgba(20,16,50,.06);
}
.case-study .sm-tab{
  font: inherit; font-size:14px; font-weight:700; color:var(--cs-muted);
  padding:10px 20px; border:0; border-radius:8px; background:transparent; cursor:pointer;
  transition: background .15s, color .15s;
}
.case-study .sm-tab:hover{ color:var(--cs-ink); background:#f5f4fa; }
.case-study .sm-tab.on{ color:#fff; }
.case-study .sm-tab.on.jur{ background:#4364e8; }
.case-study .sm-tab.on.ind{ background:var(--cs-brand); }
.case-study .sm-path-label{
  font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.1em;
  padding:6px 12px; border-left:4px solid; margin-bottom:6px; border-radius:0 4px 4px 0;
}
.case-study .sm-path-label.ind{ border-color:var(--cs-brand); background:#f5f3ff; color:var(--cs-brand); }
.case-study .sm-path-label.jur{ border-color:#4364e8; background:#f0f3ff; color:#4364e8; }
.sm-wrap{ overflow-x:auto; border:1px solid var(--cs-line); border-radius:12px; }
.sm-table{ width:100%; min-width:680px; border-collapse:collapse; }
.case-study .sm-table thead th{
  background:#261a50; color:#fff;
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.1em;
  padding:8px 8px 6px; text-align:center; line-height:1.4;
  border-right:1px solid rgba(255,255,255,.12);
}
.sm-table thead th:last-child{ border-right:none; }
.sm-table tbody td{
  padding:9px 10px; vertical-align:top; text-align:left;
  border-top:1px solid var(--cs-line); border-right:1px solid var(--cs-line);
  background:#fff;
}
.sm-table tbody td:last-child{ border-right:none; }
.sm-table tbody td.sm-empty{ background:#fafafa; }
.case-study .sm-screen-id{ font-size:11px; color:var(--cs-muted); margin-bottom:3px; font-weight:600; letter-spacing:.04em; }
.case-study .sm-screen-name{ font-size:13px; font-weight:600; color:var(--cs-ink); line-height:1.35; }
.case-study .sm-screen-note{ font-size:12px; color:var(--cs-muted); margin-top:3px; line-height:1.4; }
.sm-table tbody td.fork{ background:#fffbeb; border-left:3px solid #d97706; padding-left:7px; }
.sm-table tbody td.terminal{ background:#f0fdf4; border-left:3px solid #15803d; padding-left:7px; }
.sm-table tbody td.ind-only{ border-left:3px solid var(--cs-brand); background:#faf8ff; padding-left:7px; }
.sm-table tbody td.jur-only{ border-left:3px solid #4364e8; background:#f0f3ff; padding-left:7px; }
.case-study .sm-legend{
  display:flex; gap:16px; margin-top:12px; font-size:13px; color:var(--cs-muted);
  align-items:center; flex-wrap:wrap;
}
.case-study .sm-ind-note{ margin-top:20px; }
.sm-legend-item{ display:flex; align-items:center; gap:6px; }
.sm-legend-swatch{ width:12px; height:12px; border:1px solid var(--cs-line); flex-shrink:0; border-radius:2px; }
.sw-fork{ background:#fffbeb; border-left:3px solid #d97706; }
.sw-term{ background:#f0fdf4; border-left:3px solid #15803d; }
.sw-ind{ border-left:3px solid var(--cs-brand); background:#faf8ff; }
.sw-jur{ border-left:3px solid #4364e8; background:#f0f3ff; }

/* Timing split (Validation overview) */
.timing-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.timing-card{
  border-radius: 14px;
  padding: 22px;
  border: 1px solid var(--cs-line);
}
.timing-card--sync{ background: #fbf9ff; border-color: #ddd4fb; }
.timing-card--async{ background: #f0f3ff; border-color: #d4dafb; }
.case-study .timing-card .timing-tag{
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cs-brand);
  margin-bottom: 8px;
}
.case-study .timing-card strong{ display: block; font-size: 18px; color: var(--cs-ink); margin-bottom: 6px; }
.case-study .timing-card p{ font-size: 14.5px; color: var(--cs-muted); line-height: 1.6; }

/* Flag list (Manual review) */
.flag-list{
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.flag-item{
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--cs-line);
  border-radius: 12px;
  padding: 14px 18px;
}
.flag-ico{
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.case-study .flag-item strong{ display: block; font-size: 15.5px; color: var(--cs-ink); }
.case-study .flag-item p{ font-size: 14px; color: var(--cs-muted); line-height: 1.55; margin-top: 2px; }

/* Wide diagram frame */
.doc-figure{
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--cs-line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}
.doc-figure img{ min-width: 900px; width: 100%; display: block; }

/* Prev / next pager */
.doc-pager{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--cs-line);
}
.doc-pager button{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--cs-line);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
  font: 600 15px/1.35 var(--cs-sans);
  color: var(--cs-ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, color .15s;
}
.doc-pager button:hover{ border-color: var(--cs-brand); color: var(--cs-brand); }
.doc-pager .doc-pager-arrow{ flex-shrink: 0; color: var(--cs-muted); transition: color .15s, transform .15s; }
.doc-pager button:hover .doc-pager-arrow{ color: var(--cs-brand); transform: translateX(-2px); }
.doc-pager .doc-pager-next{ grid-column: 2; justify-content: flex-end; text-align: right; }
.doc-pager .doc-pager-next:hover .doc-pager-arrow{ transform: translateX(2px); }

/* Component adjustments inside the narrower content pane */
.doc-modal .walk-split{ margin-top: 24px; }
.case-study .doc-modal .check-grid{ grid-template-columns: 1fr; margin-top: 32px; }
.doc-modal .ctree-wrap{ margin-top: 20px; }
/* Form overview: no root node, larger cards */
.ctree-wrap--flat .ctree-branch::before{ display: none; }
.ctree-wrap--flat .ctree-cols{ gap: 16px; }
.ctree-wrap--flat .ctree-cat{ font-size: 15px; padding: 12px 16px; border-radius: 10px 10px 0 0; }
.ctree-wrap--flat .ctree-items{ border-radius: 0 0 10px 10px; }
.ctree-wrap--flat .ctree-items li{ font-size: 14px; padding: 10px 16px; line-height: 1.5; }
.case-study .ctree-remark{ margin-top: 14px; font-size: 13px; color: var(--cs-muted); text-align: center; }

/* FAQ toggle */
.doc-faq{ margin-top: 32px; border: 1px solid var(--cs-line); border-radius: 12px; padding: 0 20px; background: #fff; }
.doc-faq > summary{ list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; font-size: 16px; font-weight: 700; color: var(--cs-ink); }
.doc-faq > summary::-webkit-details-marker{ display: none; }
.doc-faq > summary::after{ content: ''; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--cs-muted); border-bottom: 2px solid var(--cs-muted); transform: rotate(45deg); margin-top: -4px; transition: transform .2s; }
.doc-faq[open] > summary::after{ transform: rotate(-135deg); margin-top: 4px; }
.doc-faq[open]{ padding-bottom: 20px; }
.doc-faq .why-table-wrap{ margin-top: 4px; }

/* Peek table: first rows visible, toggle expands the rest */
.doc-faq.peek{ padding: 0 32px 24px; }
@media (max-width: 600px){ .doc-faq.peek{ padding: 0 16px 20px; } }
.case-study .peek-title{ margin: 0; padding: 20px 0 20px; font-size: 20px; font-weight: 700; color: var(--cs-ink); }
.peek .why-table-wrap{ position: relative; margin-top: 0; transition: max-height .35s ease; }
.peek:not(.is-open) .why-table-wrap{ overflow-y: hidden; border-bottom: 0; border-radius: 12px 12px 0 0; }
.peek:not(.is-open) .why-table-wrap::after{ content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; }
.peek-toggle{ display: flex; align-items: center; gap: 8px; margin: 12px auto 0; padding: 8px 16px; border: 1px solid var(--cs-line); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--cs-brand); cursor: pointer; }
.peek-toggle:hover{ border-color: var(--cs-brand); }
.peek-toggle::after{ content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -4px; transition: transform .2s; }
.peek.is-open .peek-toggle::after{ transform: rotate(-135deg); margin-top: 3px; }
.peek .peek-label-less, .peek.is-open .peek-label-more{ display: none; }
.peek.is-open .peek-label-less{ display: inline; }

/* Form overview: why each field/document is collected */
.why-table-wrap{ margin-top: 16px; overflow-x: auto; border: 1px solid var(--cs-line); border-radius: 12px; }
.why-table{ width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.why-table th{ text-align: left; padding: 12px 16px; background: #fafbfe; font-size: 12px; font-weight: 700; color: var(--cs-muted); white-space: nowrap; }
.why-table td{ padding: 12px 16px; border-top: 1px solid var(--cs-line); color: var(--cs-ink); vertical-align: top; }
.why-table .why-item{ width: 28%; font-weight: 600; }
.why-table td:nth-child(2){ width: 1%; white-space: nowrap; }
.why-table .why-sub{ display: block; font-weight: 400; font-size: 13px; color: var(--cs-muted); }
.why-table .why-group td{ background: #fafbfe; font-size: 12px; font-weight: 700; color: var(--cs-muted); padding: 8px 16px; }
.why-table .br-badge{ font-size: 11px; padding: 3px 8px; }
.why-table .why-group--id td{ background: #eef1ff; color: var(--cs-accent); }
.why-table .why-group--biz td{ background: #f3f0ff; color: var(--cs-brand); }
.why-table .why-group--fin td{ background: #f0fdf9; color: #0d7a5f; }
.why-table .why-group--doc td{ background: #fff7ed; color: #c2410c; }
@container (max-width: 860px){
  .doc-modal .walk-split{ grid-template-columns: 1fr; gap: 24px; }
  .doc-modal .walk-phone-wrap{ margin: 0 auto; }
  .doc-modal .check-grid{ grid-template-columns: repeat(2, 1fr); }
  .doc-modal .ctree-cols{ grid-template-columns: repeat(2, 1fr); }
  .doc-modal .ctree-stem::before{ left: 25%; right: 25%; }
}
@container (max-width: 620px){
  .doc-modal .check-grid,
  .doc-modal .ekyc-hsteps,
  .timing-grid,
  .doc-stats{ grid-template-columns: 1fr; }
}
@container (max-width: 480px){
  .doc-modal .ctree-cols{ grid-template-columns: 1fr; }
  .doc-modal .ctree-stem{ display: none; }
}

/* Small screens: sidebar collapses to a horizontal chip row */
@media (max-width: 820px){
  .doc-layout{
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .doc-nav{
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--cs-line);
    padding: 10px 16px;
    scrollbar-width: none;
  }
  .doc-nav::-webkit-scrollbar{ display: none; }
  .doc-nav-group{ display: none; }
  .doc-nav-item{
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid var(--cs-line);
    background: #fff;
    border-radius: 100px;
    font-size: 13px;
    padding: 7px 14px;
  }
  .doc-panel{ padding: 24px 16px 40px; }
  .case-study .doc-panel h3.doc-title{ font-size: 23px; }
  .doc-modal .modal-bar{ padding: 10px 16px; }
  .doc-modal .modal-close .doc-close-txt{ display: none; }
}

/* ==========================================
   Page-level CTA block on each Solution flow-card
   ========================================== */
.flow-cta{
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--cs-line);
}
/* Category pill on deep-dive cards (colour per category) */
.flow-cta-pill{
  justify-self: start; box-sizing: border-box; width: 96px; padding: 3px 8px; border-radius: 6px; text-align: center;
  background: rgba(92,71,230,.09); color: var(--cs-brand);
  font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: .01em; white-space: nowrap;
}
.flow-cta-pill--req{    background: #e8f0fc; color: #2357a8; }
.flow-cta-pill--ia{     background: #e3f4f1; color: #0f6e66; }
.flow-cta-pill--design{ background: #efebfd; color: #5c47e6; }
.flow-cta-pill--ekyc{   background: #fcefdf; color: #a8540c; }
/* Stacked CTA: one column, list full width */
.case-study .deep-dive-cta.deep-dive-cta--stack{ grid-template-columns: 1fr; padding: 0; background: none; border: 0; border-radius: 0; margin-top: 40px; }

/* Deep-dive cards: 4 across. Icon tile, a line on what is inside, then a link-coloured label with an arrow. */
.case-study .dd-cards{ list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.case-study .dd-cards--2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-study .dd-cards--3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Form Builder demo: the builder needs ~960px (tree | phone preview | inspector), so narrow screens scroll sideways */
.bld-embed{ margin-top: 24px; border: 1px solid var(--cs-line); border-radius: 12px; overflow-x: auto; }
.bld-embed iframe{ display: block; width: 100%; min-width: 960px; height: 900px; border: 0; }
.case-study .dd-card{
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; height: 100%;
  padding: 20px; background: #fff; border: 1px solid var(--cs-line); border-radius: 10px;
  text-align: left; cursor: pointer; font: inherit; color: var(--cs-ink); transition: border-color .15s;
}
.case-study .dd-card:hover{ border-color: rgba(92,71,230,.45); }
.case-study .dd-card:focus-visible{ outline: 2px solid var(--cs-brand); outline-offset: 2px; }
.case-study .dd-card-desc{ flex: 1; font-size: 15px; line-height: 1.5; color: var(--cs-ink); }
.case-study .dd-card-link{ font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--cs-brand); }
.case-study .dd-card-link::after{ content: "→"; display: inline-block; margin-left: 6px; transition: transform .15s; }
.case-study .dd-card:hover .dd-card-link::after{ transform: translateX(3px); }
@media (max-width: 900px){ .case-study .dd-cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px){ .case-study .dd-cards{ grid-template-columns: 1fr; } }
/* Deep-dive label: a small eyebrow, not a heading, so the cards read as optional extra detail */
.case-study .deep-dive-cta.deep-dive-cta--stack .deep-dive-title{
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cs-muted);
}
.case-study .dd-card .flow-cta-pill{ width: auto; padding: 3px 10px; font-size: 12px; justify-self: auto; }
