/* Reusable components for the AscendX proposal: buttons, labels, cards, the journey motif, tabs, modal, FAQ.
   Everything reads tokens.css; nothing here hard-codes a brand value. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--surface); color: var(--text); font: 400 var(--step-0)/var(--leading-body) var(--font-body); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; color: var(--text-strong); line-height: var(--leading-tight); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--action); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -60px; background: var(--action); color: var(--action-text); padding: var(--space-2) var(--space-4); border-radius: var(--radius-s); z-index: 100; }
.skip-link:focus { top: var(--space-4); }

.wrap { width: min(100% - 2 * var(--gutter), var(--width)); margin-inline: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); border-radius: var(--radius-pill); border: 1px solid transparent; font: 600 var(--step-0)/1 var(--font-body); text-decoration: none; cursor: pointer; transition: background var(--ease), border-color var(--ease), color var(--ease); }
.btn-primary { background: var(--action); color: var(--action-text); }
.btn-primary:hover { background: var(--action-hover); }
.btn-secondary { background: transparent; color: var(--text-strong); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--text-strong); }
.btn-small { min-height: 40px; padding: 0 var(--space-4); font-size: var(--step--1); }

/* Labels: what is a sample, what is a proposal note */
.eyebrow { font: 600 var(--step--1)/1.2 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--action); }
.label-sample { display: inline-flex; align-items: center; gap: 6px; font: 600 0.75rem/1 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--sample); background: var(--sample-bg); border-radius: var(--radius-pill); padding: 6px 10px; }
.label-sample::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }
.note { border: 1.5px dashed var(--note); background: var(--note-bg); color: var(--note); border-radius: var(--radius-m); padding: var(--space-4) var(--space-5); font-size: var(--step--1); line-height: 1.5; }
.note strong { display: block; font: 700 0.75rem/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.mono { font-family: var(--font-mono); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-6); box-shadow: var(--shadow-card); }
.card h3 { font-size: var(--step-2); margin-bottom: var(--space-3); }
.card p { color: var(--text-muted); }
.chip { display: inline-block; font: 600 var(--step--1)/1.3 var(--font-body); color: var(--text-strong); background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 6px 12px; }

/* The journey motif: three connected stages carrying one customer journey.
   A cyan path joins the stages; the stages carry the content. Content stays visible without animation. */
.journey { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.journey::before { content: ""; position: absolute; left: 12%; right: 12%; top: 38px; height: 2px; background: linear-gradient(90deg, var(--connector), var(--brand-sky), var(--connector)); border-radius: 2px; z-index: 0; }
.stage { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: var(--space-5); box-shadow: var(--shadow-card); }
.stage-head { display: flex; align-items: center; gap: var(--space-3); }
.stage-num { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--connector); color: var(--text-strong); font: 600 0.8125rem/1 var(--font-mono); box-shadow: 0 0 0 4px var(--surface); }
.stage-title { font: 600 var(--step-0)/1.25 var(--font-body); color: var(--text-strong); }
.stage-kicker { font: 600 0.6875rem/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.pulse { position: absolute; top: 34px; left: 12%; width: 10px; height: 10px; border-radius: 50%; background: var(--connector); box-shadow: 0 0 0 4px rgba(21, 239, 254, 0.25); z-index: 0; animation: travel 6s ease-in-out infinite; } /* behind the stages: seen only in the gaps */
@keyframes travel { 0% { left: 12%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: calc(88% - 10px); opacity: 0; } }
@media (max-width: 900px) {
  .journey { grid-template-columns: 1fr; gap: var(--space-4); }
  .journey::before { left: 31px; right: auto; top: 24px; bottom: 24px; width: 2px; height: auto; background: linear-gradient(180deg, var(--connector), var(--brand-sky), var(--connector)); }
  .pulse { display: none; }
}

/* Sample UI pieces inside the stages */
.mini { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface-soft); padding: var(--space-4); font-size: var(--step--1); line-height: 1.5; color: var(--text); }
.mini-row { display: flex; align-items: flex-start; gap: var(--space-2); }
.mini-dot { width: 8px; height: 8px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--action); }
.bubble { max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: var(--step--1); line-height: 1.45; }
.bubble-in { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble-out { margin-left: auto; background: var(--action); color: var(--action-text); border-bottom-right-radius: 4px; }
.meta { font: 500 0.6875rem/1.3 var(--font-mono); letter-spacing: 0.03em; color: var(--text-muted); }

/* Tabs (WAI-ARIA tabs pattern) */
.tablist { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 6px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-on-anchor); width: fit-content; max-width: 100%; }
.tab { min-height: 44px; padding: 0 var(--space-5); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-on-anchor-muted); font: 600 var(--step--1)/1 var(--font-body); cursor: pointer; transition: background var(--ease), color var(--ease); }
.tab[aria-selected="true"] { background: #ffffff; color: var(--text-strong); }
.tab:hover:not([aria-selected="true"]) { color: #ffffff; }
.tabpanel[hidden] { display: none; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-5) 0; font: 600 var(--step-1)/1.35 var(--font-body); color: var(--text-strong); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--action); font: 400 1.25rem/1 var(--font-body); }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 var(--space-5); color: var(--text-muted); max-width: 70ch; }
.faq .answer p + p { margin-top: var(--space-3); }

/* Modal (local sample assessment) */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--gutter); background: rgba(3, 5, 53, 0.55); }
.modal[hidden] { display: none; }
.dialog { width: min(100%, 560px); max-height: calc(100vh - 2 * var(--gutter)); overflow: auto; background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-lift); padding: var(--space-6); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-4); }
.dialog h2 { font-size: var(--step-3); }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-strong); font-size: 1.25rem; cursor: pointer; }
fieldset { border: 0; margin: 0 0 var(--space-5); padding: 0; }
legend { font: 600 var(--step-0)/1.4 var(--font-body); color: var(--text-strong); margin-bottom: var(--space-3); padding: 0; }
.option { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: var(--space-2); cursor: pointer; }
.option:has(input:checked) { border-color: var(--action); background: var(--surface-soft); }
.option input { width: 18px; height: 18px; accent-color: var(--action); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; display: none; }
  * { transition-duration: 0ms !important; }
}
