/* =========================================================
   Procurement page - "From intake to payment" workflow (section.p2p)
   Ported from tyasuite-workspace assets/css/home-workflow.css.
   Every selector is prefixed .p2p / .p2p-*, keyframes are p2p*.
   JS: assets/js/procurement/sections/p2p-workflow.js
   ========================================================= */
.p2p {
  --ink: #0b3d3a;
  --teal: #006B8D;
  --teal-deep: #006B8D;
  --teal-tint: rgba(0, 107, 141, 0.09);
  --sky: #006B8D;
  --sky-light: #006B8D;
  --sky-tint: rgba(0, 107, 141, 0.1);
  --paper: rgba(0, 107, 141, 0.06);
  --line: #dfe8e6;
  --text: #1c2b29;
  --text-soft: #526663;
  --font-display: "Figtree", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

.p2p * { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  .p2p * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.p2p {
  background: #ffffff;
  color: var(--text);
  padding: clamp(56px, 7vw, 40px) 20px;
  overflow: hidden;
  border-top: 1px solid #e4e6ec;
}

.p2p-inner { width: min(100%, 1180px); margin: 0 auto; }

/* ---- intro ---- */
.p2p .p2p-intro { max-width: 990px; margin: 0 auto clamp(44px, 6vw, 72px); text-align: center; }

.p2p .p2p-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 22px; padding: 7px 16px 7px 12px;
  border-radius: 999px; color: var(--teal); background: var(--teal-tint);
  font-family: var(--font-mono); font-size: 1rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.p2p .p2p-eyebrow svg { width: 15px; height: 15px; }

.p2p .p2p-heading {
  margin: 0 0 20px; font-family: var(--font-base); font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink);
}
.p2p .p2p-heading span {
  background: linear-gradient(92deg, var(--teal) 10%, var(--sky-light) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.p2p .p2p-desc { margin: 0 auto 30px; color: var(--text-soft); font-size: clamp(0.98rem, 1.1vw, 1.1rem); line-height: 1.7; max-width: 920px; }

.p2p .p2p-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px 13px 26px;
  border-radius: 11px; color: #fff; background: linear-gradient(92deg, var(--teal) 0%, var(--sky) 100%);
  box-shadow: 0 16px 36px rgba(0, 107, 141, 0.24); font-size: 0.94rem; font-weight: 700;
  text-decoration: none; transition: transform 0.24s ease, box-shadow 0.24s ease;
}
.p2p .p2p-btn svg { width: 17px; height: 17px; transition: transform 0.24s ease; }
.p2p .p2p-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 20px 44px rgba(0, 107, 141, 0.32); }
.p2p .p2p-btn:hover svg { transform: translateX(3px); }
.p2p .p2p-btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

/* ---- rail ---- */
.p2p .p2p-rail { position: relative; --node: 56px; }

.p2p .p2p-track {
  position: absolute; left: calc(var(--node) / 2 - 1px); top: 10px; bottom: 10px; width: 2px;
  background: var(--line); border-radius: 2px; z-index: 0;
  container-type: size;
  overflow: hidden;
}
.p2p .p2p-track__fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--teal) 0%, var(--sky) 100%);
  border-radius: 2px; transition: height 0.6s cubic-bezier(.22,.8,.36,1);
}
.p2p .p2p-track__pulse {
  position: absolute; left: 50%; top: 0; width: 10px; height: 10px;
  margin-left: -5px; margin-top: -5px;
  border-radius: 50%; background: var(--sky-light);
  box-shadow: 0 0 0 4px rgba(0,107,141,0.22), 0 0 18px 4px rgba(0,107,141,0.55);
  transform: translate(-50%, 0);
  will-change: transform, opacity;
  animation: p2pPulseTravel 7s linear infinite;
}
@keyframes p2pPulseTravel {
  0% { transform: translate(-50%, 0); opacity: 0; }
  6% { opacity: 1; }
  94% { opacity: 1; }
  100% { transform: translate(-50%, calc(100cqh - 10px)); opacity: 0; }
}

.p2p .p2p-stage {
  position: relative; z-index: 1; display: flex; gap: clamp(16px, 2.6vw, 28px);
  margin-bottom: clamp(28px, 3.4vw, 40px);
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(.22,.8,.36,1);
}
.p2p .p2p-stage.is-visible { opacity: 1; }
.p2p .p2p-stage:last-child { margin-bottom: 0; }

.p2p .p2p-stage__marker { flex: 0 0 var(--node); display: flex; justify-content: center; padding-top: 2px; }
.p2p .p2p-node {
  width: var(--node); height: var(--node); border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #006B8D; color: #006B8D;
  transition: background 0.45s ease, border-color 0.45s ease, color 0.45s ease, transform 0.45s ease, box-shadow 0.45s ease;
}
.p2p .p2p-node svg { width: 24px; height: 24px; }
.p2p .p2p-stage.is-active .p2p-node {
  background: #006B8D; border-color: transparent; color: #fff;
  transform: scale(1.08); box-shadow: 0 10px 26px rgba(0,107,141,0.32);
}

.p2p .p2p-stage__card {
  flex: 1; min-width: 0; background: #fff; border: 1px solid #006B8D; border-radius: 18px;
  padding: clamp(20px, 2.6vw, 28px) clamp(20px, 3vw, 30px);
  box-shadow: 0 18px 44px rgba(11,61,58,0.06);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.p2p .p2p-stage.is-active .p2p-stage__card { border-color: #006B8D; box-shadow: 0 22px 52px rgba(11,61,58,0.11); }

.p2p .p2p-stage__index {
  display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--sky);
}
.p2p .p2p-stage__title { margin: 0 0 10px; font-family: var(--font-display); font-size: clamp(1.18rem, 1.7vw, 1.44rem); font-weight: 700; line-height: 1.3; color: var(--ink); letter-spacing: -0.01em; }
.p2p .p2p-stage__body { margin: 0 0 18px; color: var(--text-soft); font-size: 0.98rem; line-height: 1.68; }

/* AI callout */
.p2p .p2p-ai {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px;
  background: var(--teal-tint); border: 1px solid #006B8D;
}
.p2p .p2p-ai__icon {
  flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: var(--teal); animation: p2pSparkle 2.6s ease-in-out infinite;
}
.p2p .p2p-ai__icon svg { width: 18px; height: 18px; }
@keyframes p2pSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.18) rotate(14deg); opacity: 1; }
}
.p2p .p2p-ai p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--ink); }
.p2p .p2p-ai strong { color: var(--teal-deep); font-weight: 700; }

/* wide stages: sub-item grid */
.p2p .p2p-subgrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 20px;
}
.p2p .p2p-subitem { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: var(--paper); border: 1px solid #006B8D; }
.p2p .p2p-subitem__icon {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--sky-tint); color: var(--sky);
}
.p2p .p2p-subitem__icon svg { width: 18px; height: 18px; }
.p2p .p2p-subitem h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 0.92rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.p2p .p2p-subitem p { margin: 0; font-size: 0.85rem; line-height: 1.55; color: var(--text-soft); }

/* stat strip */
.p2p .p2p-statstrip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: clamp(48px, 6vw, 76px);
  background: #006B8D; border: 1px solid #006B8D; border-radius: 18px; overflow: hidden;
}
.p2p .p2p-stat { background: #eef6f9; padding: clamp(22px, 3vw, 30px) 18px; text-align: center; }
.p2p .p2p-stat__num {
  display: block; font-family: var(--font-mono); font-weight: 700; font-size: clamp(1.7rem, 3vw, 2.4rem);
  color: var(--ink); letter-spacing: -0.02em; margin-bottom: 6px;
}
.p2p .p2p-stat__label { font-size: 0.82rem; color: var(--text-soft); line-height: 1.4; }

/* stage 06: "See Validation in Action" (#vcOpenBtn, home_new.php's trigger).
   Hover / shine / glow come from assets/home/css/button-animations.css (.btn-white);
   the fill matches home's validation-intelligence.css .btn-white. */
/* Desktop/tablet: pinned to the card's top-right corner, level with the stage index.
   (The stage is position:relative too, and the card is its top-right child, so the
   corner is the same even where :has() isn't supported.) */
.p2p .p2p-stage__card { position: relative; }
.p2p .p2p-vc {
  position: absolute; z-index: 2;
  top: clamp(20px, 2.6vw, 28px); right: clamp(20px, 3vw, 30px);
}
/* keep the index/title text clear of the button */
.p2p .p2p-stage__card:has(> .p2p-vc) > .p2p-stage__index,
.p2p .p2p-stage__card:has(> .p2p-vc) > .p2p-stage__title { padding-right: 270px; }
@media (max-width: 760px) {
  .p2p .p2p-vc { position: static; margin-top: 22px; }
  .p2p .p2p-stage__card:has(> .p2p-vc) > .p2p-stage__index,
  .p2p .p2p-stage__card:has(> .p2p-vc) > .p2p-stage__title { padding-right: 0; }
}
.p2p .p2p-vc .btn-white {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px; border: 0; border-radius: 12px;
  background: rgb(0, 107, 141); color: #fff;
  font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.p2p .p2p-vc .btn-white:hover { color: #fff; }

@media (max-width: 900px) {
  .p2p .p2p-subgrid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .p2p .p2p-statstrip { grid-template-columns: repeat(2, 1fr); }
  /* 3 stats in 2 columns: let the odd one fill the row instead of leaving an empty cell */
  .p2p .p2p-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .p2p .p2p-stage { gap: 14px; }
  .p2p .p2p-rail { --node: 44px; }
  .p2p .p2p-node svg { width: 19px; height: 19px; }
  .p2p .p2p-vc .btn-white { width: 100%; min-height: 50px; padding: 0 12px; font-size: 0.9rem; }
}

/* Procurement's animations.css fades every "section h2 / h2 + p" on load;
   this section has its own scroll reveal, so opt out of that one. */
.p2p .p2p-heading,
.p2p .p2p-heading + .p2p-desc { animation: none; }
