/* ============================================================================
   EqualWeb Design System — Components
   All styling references var(--ew-*) tokens from tokens.css. No hardcoded
   colors or magic numbers (except 0/1px hairlines and %/structural values).
   Prefix: .ew-  •  Pattern: block__element--modifier
   ============================================================================ */

/* ---------- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.ew {
  margin: 0;
  font-family: var(--ew-font-body);
  font-size: var(--ew-text-body);
  line-height: var(--ew-leading-normal);
  color: var(--ew-color-text);
  background: var(--ew-color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ew img, .ew svg, .ew video { max-width: 100%; display: block; }
.ew :is(h1,h2,h3,h4,h5,p,figure) { margin: 0; }

/* ---------- Global focus indicator (WCAG 2.4.11 / 2.4.7) ----------------- */
.ew :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ew-color-focus);
  outline-offset: 2px;
  border-radius: var(--ew-radius-xs);
}
/* Remove default outline only where focus-visible is supported */
.ew :where(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible) {
  outline: none;
}
/* On teal-filled controls the default teal focus ring is invisible (≈2:1).
   Switch to an ink ring (≈8.5:1 against teal) so focus is clear on either theme. */
.ew .ew-btn--primary:focus-visible,
.ew .ew-widget-fab:focus-visible,
.ew .ew-on-dark .ew-btn--primary:focus-visible {
  outline-color: var(--ew-ink-900);
}

/* Skip link (keyboard + screen-reader) */
.ew-skip-link {
  position: absolute; left: var(--ew-space-3); top: var(--ew-space-3);
  transform: translateY(-150%);
  background: var(--ew-color-action-ink); color: var(--ew-color-action-ink-text);
  padding: var(--ew-space-2) var(--ew-space-4); border-radius: var(--ew-radius-sm);
  z-index: var(--ew-z-toast); font-weight: var(--ew-weight-semibold);
  transition: transform var(--ew-duration-base) var(--ew-ease-out);
}
.ew-skip-link:focus { transform: translateY(0); }

/* Visually hidden but available to assistive tech */
.ew-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ------------------------------------------------------- */
.ew-container { width: 100%; max-width: var(--ew-container); margin-inline: auto; padding-inline: var(--ew-space-5); }
.ew-container--wide { max-width: var(--ew-container-wide); }
.ew-container--narrow { max-width: var(--ew-container-narrow); }
.ew-section { padding-block: var(--ew-space-9); }
.ew-section--tight { padding-block: var(--ew-space-7); }
.ew-section.ew-on-dark { background: var(--ew-color-bg); color: var(--ew-color-text); }

.ew-stack > * + * { margin-top: var(--ew-space-4); }
.ew-cluster { display: flex; flex-wrap: wrap; gap: var(--ew-space-3); align-items: center; }
.ew-grid { display: grid; gap: var(--ew-space-5); }
.ew-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ew-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ew-grid--4 { grid-template-columns: repeat(4, 1fr); }
.ew-grid--5 { grid-template-columns: repeat(5, 1fr); }

/* ---------- Typography helpers ------------------------------------------ */
.ew-display { font-family: var(--ew-font-display); font-size: var(--ew-text-display);
  font-weight: var(--ew-weight-extrabold); line-height: var(--ew-leading-tight);
  letter-spacing: var(--ew-tracking-tight); }
.ew-h1 { font-family: var(--ew-font-display); font-size: var(--ew-text-h1); font-weight: var(--ew-weight-bold); line-height: var(--ew-leading-tight); letter-spacing: var(--ew-tracking-tight); }
.ew-h2 { font-family: var(--ew-font-display); font-size: var(--ew-text-h2); font-weight: var(--ew-weight-bold); line-height: var(--ew-leading-snug); letter-spacing: var(--ew-tracking-snug); }
.ew-h3 { font-family: var(--ew-font-display); font-size: var(--ew-text-h3); font-weight: var(--ew-weight-semibold); line-height: var(--ew-leading-snug); }
.ew-h4 { font-size: var(--ew-text-h4); font-weight: var(--ew-weight-semibold); }
.ew-lead { font-size: var(--ew-text-body-lg); color: var(--ew-color-text-muted); line-height: var(--ew-leading-relaxed); }
.ew-muted { color: var(--ew-color-text-muted); }
.ew-text-teal { color: var(--ew-color-brand-text); }

/* Eyebrow / overline */
.ew-eyebrow {
  display: inline-flex; align-items: center; gap: var(--ew-space-2);
  font-size: var(--ew-text-xs); font-weight: var(--ew-weight-bold);
  letter-spacing: var(--ew-tracking-wide); text-transform: uppercase;
  color: var(--ew-color-brand-text);
}
.ew-on-dark .ew-eyebrow { color: var(--ew-color-brand-text); }
.ew-eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: currentColor; border-radius: var(--ew-radius-pill); }

/* Gradient teal accent on a word (use sparingly) */
.ew-grad-teal {
  background: linear-gradient(100deg, var(--ew-teal-500), var(--ew-teal-glow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Section header block */
.ew-section-head { max-width: 44rem; margin-inline: auto; text-align: center; }
.ew-section-head > * + * { margin-top: var(--ew-space-3); }
.ew-section-head .ew-lead { margin-top: var(--ew-space-4); }

/* ---------- Links -------------------------------------------------------- */
.ew-link { color: var(--ew-color-link); text-decoration: underline; text-underline-offset: 2px;
  text-decoration-thickness: 1px; font-weight: var(--ew-weight-medium);
  transition: color var(--ew-duration-fast) var(--ew-ease-standard); }
.ew-link:hover { color: var(--ew-color-link-hover); text-decoration-thickness: 2px; }

/* ---------- Buttons ------------------------------------------------------ */
.ew-btn {
  --_pad-y: var(--ew-space-3); --_pad-x: var(--ew-space-5);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ew-space-2);
  min-height: var(--ew-tap-target);
  padding: var(--_pad-y) var(--_pad-x);
  font-family: var(--ew-font-body); font-size: var(--ew-text-body); font-weight: var(--ew-weight-semibold);
  line-height: 1; text-decoration: none; white-space: nowrap;
  border: var(--ew-border-width-strong) solid transparent; border-radius: var(--ew-radius-pill);
  cursor: pointer; user-select: none;
  transition: transform var(--ew-duration-fast) var(--ew-ease-standard),
              background-color var(--ew-duration-base) var(--ew-ease-standard),
              box-shadow var(--ew-duration-base) var(--ew-ease-standard),
              color var(--ew-duration-base) var(--ew-ease-standard);
}
.ew-btn:hover { transform: translateY(-1px); }
.ew-btn:active { transform: translateY(0); }
.ew-btn[disabled], .ew-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.ew-btn .ew-btn__icon { width: 1.15em; height: 1.15em; flex: none; }

/* Primary — Request a Demo: electric teal + ink text (~9:1) */
.ew-btn--primary { background: var(--ew-color-action); color: var(--ew-color-action-text); box-shadow: var(--ew-shadow-sm); }
.ew-btn--primary:hover { background: var(--ew-color-action-hover); box-shadow: var(--ew-glow-teal); }

/* Ink — solid alternative primary */
.ew-btn--ink { background: var(--ew-color-action-ink); color: var(--ew-color-action-ink-text); }
.ew-btn--ink:hover { background: var(--ew-color-action-ink-hover); box-shadow: var(--ew-shadow-md); }

/* Secondary — Start Free Trial: outline */
.ew-btn--secondary { background: transparent; color: var(--ew-color-text); border-color: var(--ew-color-border-strong); }
.ew-btn--secondary:hover { border-color: var(--ew-color-text); background: var(--ew-color-bg-subtle); }
.ew-on-dark .ew-btn--secondary { color: var(--ew-color-text); border-color: var(--ew-color-border-strong); }
.ew-on-dark .ew-btn--secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--ew-white); }

/* Ghost — low emphasis */
.ew-btn--ghost { background: transparent; color: var(--ew-color-text); }
.ew-btn--ghost:hover { background: var(--ew-color-bg-subtle); }

/* Sizes */
.ew-btn--lg { --_pad-y: var(--ew-space-4); --_pad-x: var(--ew-space-6); font-size: var(--ew-text-body-lg); }
.ew-btn--sm { --_pad-y: var(--ew-space-2); --_pad-x: var(--ew-space-4); min-height: 36px; font-size: var(--ew-text-sm); }
.ew-btn--block { display: flex; width: 100%; }

/* Loading state */
.ew-btn--loading { color: transparent !important; pointer-events: none; position: relative; }
.ew-btn--loading::after {
  content: ""; position: absolute; width: 1.1em; height: 1.1em;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  color: var(--ew-color-action-text);
  animation: ew-spin 0.7s linear infinite;
}
.ew-btn--ink.ew-btn--loading::after { color: var(--ew-color-action-ink-text); }
@keyframes ew-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ew-btn--loading::after { animation-duration: 1.6s; } }

/* ---------- Badges & pills ---------------------------------------------- */
.ew-badge {
  display: inline-flex; align-items: center; gap: var(--ew-space-1);
  padding: 0.2rem var(--ew-space-2); border-radius: var(--ew-radius-sm);
  font-size: var(--ew-text-xs); font-weight: var(--ew-weight-semibold); line-height: 1.4;
}
.ew-badge--brand   { background: var(--ew-teal-100); color: var(--ew-teal-800); }
.ew-badge--success { background: var(--ew-color-success-bg); color: var(--ew-green-700); }
.ew-badge--warning { background: var(--ew-color-warning-bg); color: var(--ew-amber-700); }
.ew-badge--danger  { background: var(--ew-color-danger-bg);  color: var(--ew-red-700); }
.ew-badge--info    { background: var(--ew-color-info-bg);    color: var(--ew-blue-700); }
.ew-badge--neutral { background: var(--ew-line-100); color: var(--ew-slate-500); }

.ew-pill {
  display: inline-flex; align-items: center; gap: var(--ew-space-2);
  padding: var(--ew-space-2) var(--ew-space-4); border-radius: var(--ew-radius-pill);
  border: var(--ew-border); background: var(--ew-color-surface);
  font-size: var(--ew-text-sm); font-weight: var(--ew-weight-medium);
}
.ew-on-dark .ew-pill { background: rgba(255,255,255,0.06); }

/* Compliance badge (WCAG / ADA / Section 508 …) */
.ew-compliance-badge {
  display: inline-flex; align-items: center; gap: var(--ew-space-2);
  padding: var(--ew-space-2) var(--ew-space-4);
  border: var(--ew-border-width) solid var(--ew-color-border);
  border-radius: var(--ew-radius-pill);
  font-size: var(--ew-text-sm); font-weight: var(--ew-weight-semibold);
  color: var(--ew-color-text);
}
.ew-compliance-badge__check {
  display: grid; place-items: center; width: 1.4rem; height: 1.4rem; flex: none;
  border-radius: 50%; background: var(--ew-color-brand); color: var(--ew-ink-900);
  font-size: 0.7rem;
}

/* ---------- Cards -------------------------------------------------------- */
.ew-card {
  background: var(--ew-color-surface); border: var(--ew-border);
  border-radius: var(--ew-radius-lg); padding: var(--ew-space-6);
  transition: transform var(--ew-duration-base) var(--ew-ease-out),
              box-shadow var(--ew-duration-base) var(--ew-ease-out),
              border-color var(--ew-duration-base) var(--ew-ease-out);
}
.ew-card--interactive:hover { transform: translateY(-4px); box-shadow: var(--ew-shadow-lg); border-color: transparent; }
.ew-card__icon {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem;
  border-radius: var(--ew-radius-md); margin-bottom: var(--ew-space-4);
  background: linear-gradient(135deg, var(--ew-teal-500), var(--ew-teal-700));
  color: var(--ew-ink-900);
}
.ew-card__icon svg { width: 1.6rem; height: 1.6rem; }
.ew-card__title { font-size: var(--ew-text-h4); font-weight: var(--ew-weight-semibold); margin-bottom: var(--ew-space-2); }
.ew-card__body { color: var(--ew-color-text-muted); }
.ew-card__link { margin-top: var(--ew-space-4); display: inline-flex; align-items: center; gap: var(--ew-space-1);
  color: var(--ew-color-brand-text); font-weight: var(--ew-weight-semibold); text-decoration: none; }
.ew-card__link:hover { gap: var(--ew-space-3); }

/* Stat card */
.ew-stat { text-align: center; }
.ew-stat__value { font-family: var(--ew-font-display); font-size: var(--ew-text-h1);
  font-weight: var(--ew-weight-extrabold); line-height: 1; color: var(--ew-color-text); }
.ew-on-dark .ew-stat__value { color: var(--ew-color-brand-text); }
.ew-stat__label { margin-top: var(--ew-space-2); color: var(--ew-color-text-muted); font-size: var(--ew-text-sm); }

/* Testimonial */
.ew-testimonial { background: var(--ew-color-surface); border: var(--ew-border);
  border-radius: var(--ew-radius-lg); padding: var(--ew-space-6); }
.ew-testimonial__quote { font-size: var(--ew-text-body-lg); line-height: var(--ew-leading-relaxed); }
.ew-testimonial__quote::before { content: "\201C"; color: var(--ew-color-brand); font-weight: 700; }
.ew-testimonial__author { display: flex; align-items: center; gap: var(--ew-space-3); margin-top: var(--ew-space-5); }
.ew-testimonial__avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; flex: none;
  background: var(--ew-line-100); display: grid; place-items: center; font-weight: var(--ew-weight-bold);
  color: var(--ew-color-text-muted); }
.ew-testimonial__name { font-weight: var(--ew-weight-semibold); }
.ew-testimonial__role { font-size: var(--ew-text-sm); color: var(--ew-color-text-muted); }

/* Pricing tier */
.ew-price {
  background: var(--ew-color-surface); border: var(--ew-border-width-strong) solid var(--ew-color-border);
  border-radius: var(--ew-radius-xl); padding: var(--ew-space-6); display: flex; flex-direction: column; gap: var(--ew-space-4);
}
.ew-price--featured { border-color: var(--ew-color-brand); box-shadow: var(--ew-glow-teal); position: relative; }
.ew-price--featured::before {
  content: "Most popular"; position: absolute; top: 0; right: var(--ew-space-5); transform: translateY(-50%);
  background: var(--ew-color-brand); color: var(--ew-ink-900); font-size: var(--ew-text-xs);
  font-weight: var(--ew-weight-bold); padding: var(--ew-space-1) var(--ew-space-3); border-radius: var(--ew-radius-pill);
}
.ew-price__name { font-weight: var(--ew-weight-semibold); font-size: var(--ew-text-h4); }
.ew-price__amount { font-family: var(--ew-font-display); font-size: var(--ew-text-h1); font-weight: var(--ew-weight-extrabold); line-height: 1; }
.ew-price__period { font-size: var(--ew-text-sm); color: var(--ew-color-text-muted); font-weight: var(--ew-weight-regular); }
.ew-price__features { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--ew-space-3); }
.ew-price__features li { display: flex; gap: var(--ew-space-2); color: var(--ew-color-text-muted); }
.ew-price__features li::before { content: "✓"; color: var(--ew-color-brand-text); font-weight: 700; flex: none; }

/* Feature list with checks */
.ew-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--ew-space-3); }
.ew-checklist li { display: flex; gap: var(--ew-space-3); align-items: flex-start; }
.ew-checklist li::before {
  content: "✓"; flex: none; width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; border-radius: 50%;
  background: var(--ew-teal-100); color: var(--ew-teal-800); display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700;
}

/* ---------- Header / nav ------------------------------------------------ */
.ew-header { position: sticky; top: 0; z-index: var(--ew-z-header);
  background: var(--ew-color-bg); /* fallback for no color-mix */
  background: color-mix(in srgb, var(--ew-color-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: var(--ew-border); }
.ew-header__inner { display: flex; align-items: center; gap: var(--ew-space-6);
  min-height: 4.5rem; }
.ew-logo { display: inline-flex; align-items: center; gap: var(--ew-space-3); text-decoration: none; color: var(--ew-color-text); }
.ew-logo__mark { width: 2rem; height: 2rem; flex: none; }
.ew-logo__img { height: 1.75rem; width: auto; flex: none; }
.ew-logo__text { font-family: var(--ew-font-display); font-weight: var(--ew-weight-extrabold);
  font-size: var(--ew-text-body-lg); letter-spacing: var(--ew-tracking-snug); }
.ew-nav { display: flex; align-items: center; gap: var(--ew-space-1); margin-inline-start: var(--ew-space-4); }
.ew-nav__link { display: inline-flex; align-items: center; gap: var(--ew-space-1);
  padding: var(--ew-space-2) var(--ew-space-3); border-radius: var(--ew-radius-sm);
  color: var(--ew-color-text); text-decoration: none; font-weight: var(--ew-weight-medium); font-size: var(--ew-text-sm);
  transition: background var(--ew-duration-fast) var(--ew-ease-standard); }
.ew-nav__link:hover { background: var(--ew-color-bg-subtle); color: var(--ew-color-brand-text); }
.ew-header__actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--ew-space-3); }
.ew-header__burger { display: none; background: none; border: 0; padding: var(--ew-space-2);
  min-width: var(--ew-tap-target); min-height: var(--ew-tap-target); color: var(--ew-color-text); cursor: pointer; }

/* ---------- Footer ------------------------------------------------------ */
.ew-footer { background: var(--ew-color-bg); color: var(--ew-color-text); padding-block: var(--ew-space-9) var(--ew-space-6); }
.ew-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: var(--ew-space-6); }
.ew-footer__col h4 { font-size: var(--ew-text-sm); text-transform: uppercase; letter-spacing: var(--ew-tracking-wide);
  color: var(--ew-color-text-muted); margin-bottom: var(--ew-space-4); }
.ew-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--ew-space-2); }
.ew-footer__col a { color: var(--ew-color-text); opacity: 0.85; text-decoration: none; font-size: var(--ew-text-sm); }
.ew-footer__col a:hover { opacity: 1; color: var(--ew-color-brand-text); text-decoration: underline; }
.ew-footer__bottom { display: flex; flex-wrap: wrap; gap: var(--ew-space-4); justify-content: space-between;
  align-items: center; margin-top: var(--ew-space-8); padding-top: var(--ew-space-5);
  border-top: var(--ew-border); color: var(--ew-color-text-muted); font-size: var(--ew-text-sm); }

/* ---------- Trust / logo wall ------------------------------------------- */
.ew-logowall { display: flex; flex-wrap: wrap; gap: var(--ew-space-7); align-items: center; justify-content: center; }
.ew-logowall__item { font-weight: var(--ew-weight-bold); color: var(--ew-color-text-subtle);
  font-size: var(--ew-text-body-lg); letter-spacing: var(--ew-tracking-snug); opacity: 0.8; }

/* ---------- Comparison table -------------------------------------------- */
.ew-compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ew-text-sm); }
.ew-compare th, .ew-compare td { padding: var(--ew-space-4) var(--ew-space-4); text-align: center; border-bottom: var(--ew-border); }
.ew-compare thead th { font-weight: var(--ew-weight-semibold); color: var(--ew-color-text-muted);
  font-size: var(--ew-text-xs); text-transform: uppercase; letter-spacing: var(--ew-tracking-wide); }
.ew-compare tbody th { text-align: left; font-weight: var(--ew-weight-medium); color: var(--ew-color-text); }
.ew-compare__own { background: var(--ew-teal-50); }
.ew-compare__own-head { color: var(--ew-color-text) !important; font-weight: var(--ew-weight-bold) !important; position: relative; }
.ew-compare__own-head::after { content: ""; position: absolute; inset: 0 0 -1px 0;
  border: var(--ew-border-width-strong) solid var(--ew-color-brand); border-radius: var(--ew-radius-md) var(--ew-radius-md) 0 0; }
.ew-compare__yes { color: var(--ew-green-700); font-weight: var(--ew-weight-bold); }
.ew-compare__no  { color: var(--ew-slate-500); }
.ew-compare__partial { color: var(--ew-amber-700); font-weight: var(--ew-weight-semibold); }

/* ---------- Stepper (How it works) -------------------------------------- */
.ew-steps { counter-reset: ew-step; display: grid; gap: var(--ew-space-5); }
.ew-steps--row { grid-template-columns: repeat(4, 1fr); }
.ew-step { position: relative; padding-top: var(--ew-space-6); }
/* Connecting progress line between step nodes (decorative; hidden when stacked) */
.ew-steps--row .ew-step:not(:last-child)::before {
  content: ""; position: absolute; top: 1.25rem; left: 2.5rem; right: calc(-1 * var(--ew-space-5));
  height: 2px; background: linear-gradient(90deg, var(--ew-color-brand), transparent);
  z-index: var(--ew-z-base);
}
.ew-step__num { counter-increment: ew-step; position: absolute; top: 0; left: 0;
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--ew-color-brand); color: var(--ew-ink-900);
  font-family: var(--ew-font-display); font-weight: var(--ew-weight-bold); }
.ew-step__num::before { content: counter(ew-step); }
.ew-step__title { font-weight: var(--ew-weight-semibold); font-size: var(--ew-text-h4); margin-bottom: var(--ew-space-2); margin-top: var(--ew-space-3); }
.ew-step__body { color: var(--ew-color-text-muted); }

/* ---------- Alerts / banners -------------------------------------------- */
.ew-alert { display: flex; gap: var(--ew-space-3); padding: var(--ew-space-4) var(--ew-space-5);
  border-radius: var(--ew-radius-md); border: var(--ew-border-width) solid transparent; }
.ew-alert__title { font-weight: var(--ew-weight-semibold); }
.ew-alert--info    { background: var(--ew-color-info-bg);    border-color: var(--ew-blue-600); }
.ew-alert--success { background: var(--ew-color-success-bg); border-color: var(--ew-green-600); }
.ew-alert--warning { background: var(--ew-color-warning-bg); border-color: var(--ew-amber-600); }
.ew-alert--danger  { background: var(--ew-color-danger-bg);  border-color: var(--ew-red-600); }

/* Top trust banner */
.ew-topbar { background: var(--ew-ink-950); color: var(--ew-white); font-size: var(--ew-text-sm); }
.ew-topbar__inner { display: flex; gap: var(--ew-space-4); align-items: center; justify-content: center;
  min-height: 2.75rem; text-align: center; }
.ew-topbar a { color: var(--ew-teal-glow); }

/* ---------- Forms -------------------------------------------------------- */
.ew-field { display: grid; gap: var(--ew-space-2); }
.ew-label { font-weight: var(--ew-weight-medium); font-size: var(--ew-text-sm); color: var(--ew-color-text); }
.ew-label__req { color: var(--ew-color-danger); }
.ew-input, .ew-select, .ew-textarea {
  width: 100%; min-height: var(--ew-tap-target);
  padding: var(--ew-space-3) var(--ew-space-4); font: inherit; color: var(--ew-color-text);
  background: var(--ew-color-surface);
  border: var(--ew-border-width-strong) solid var(--ew-color-field-border);
  border-radius: var(--ew-radius-md);
  transition: border-color var(--ew-duration-fast) var(--ew-ease-standard),
              box-shadow var(--ew-duration-fast) var(--ew-ease-standard);
}
.ew-textarea { min-height: 7rem; resize: vertical; }
.ew-input::placeholder, .ew-textarea::placeholder { color: var(--ew-color-text-muted); }
.ew-input:hover, .ew-select:hover, .ew-textarea:hover { border-color: var(--ew-color-border-strong); }
.ew-input:focus, .ew-select:focus, .ew-textarea:focus {
  outline: none; border-color: var(--ew-color-brand);
  box-shadow: 0 0 0 3px var(--ew-teal-200); /* fallback */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ew-color-brand) 30%, transparent);
}
.ew-field__help { font-size: var(--ew-text-sm); color: var(--ew-color-text-muted); }
.ew-field--error .ew-input, .ew-field--error .ew-select, .ew-field--error .ew-textarea { border-color: var(--ew-color-danger); }
.ew-field__error { font-size: var(--ew-text-sm); color: var(--ew-color-danger); display: flex; gap: var(--ew-space-1); align-items: center; }

/* Checkbox / consent row */
.ew-check { display: flex; gap: var(--ew-space-2); align-items: flex-start; }
.ew-check input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--ew-color-brand); flex: none; }
.ew-check label { font-size: var(--ew-text-sm); color: var(--ew-color-text-muted); }

/* ---------- Tabs --------------------------------------------------------- */
.ew-tabs__list { display: inline-flex; gap: var(--ew-space-1); padding: var(--ew-space-1);
  background: var(--ew-color-bg-subtle); border-radius: var(--ew-radius-pill); }
.ew-tab { appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: var(--ew-space-2) var(--ew-space-4); min-height: 40px; border-radius: var(--ew-radius-pill);
  font: inherit; font-size: var(--ew-text-sm); font-weight: var(--ew-weight-medium); color: var(--ew-color-text-muted); }
.ew-tab[aria-selected="true"] { background: var(--ew-color-surface); color: var(--ew-color-text);
  box-shadow: var(--ew-shadow-xs); font-weight: var(--ew-weight-semibold); }

/* ---------- FAQ accordion (native <details>) ---------------------------- */
.ew-accordion { border: var(--ew-border); border-radius: var(--ew-radius-lg); overflow: hidden; }
.ew-accordion__item { border-bottom: var(--ew-border); }
.ew-accordion__item:last-child { border-bottom: 0; }
.ew-accordion__item summary { list-style: none; cursor: pointer; padding: var(--ew-space-5);
  display: flex; justify-content: space-between; align-items: center; gap: var(--ew-space-4);
  font-weight: var(--ew-weight-semibold); min-height: var(--ew-tap-target); }
.ew-accordion__item summary::-webkit-details-marker { display: none; }
.ew-accordion__item summary::after { content: "+"; font-size: 1.4rem; color: var(--ew-color-brand-text);
  transition: transform var(--ew-duration-base) var(--ew-ease-standard); flex: none; }
.ew-accordion__item[open] summary::after { transform: rotate(45deg); }
.ew-accordion__body { padding: 0 var(--ew-space-5) var(--ew-space-5); color: var(--ew-color-text-muted); }

/* ---------- Modal (Request a Demo) -------------------------------------- */
.ew-modal { border: 0; padding: 0; background: transparent; max-width: 32rem; width: calc(100% - 2rem); }
.ew-modal::backdrop { background: rgba(7, 11, 16, 0.6); backdrop-filter: blur(2px); }
.ew-modal__panel { background: var(--ew-color-surface); border-radius: var(--ew-radius-xl);
  padding: var(--ew-space-7); box-shadow: var(--ew-shadow-xl); }
.ew-modal__head { display: flex; justify-content: space-between; align-items: start; gap: var(--ew-space-4); margin-bottom: var(--ew-space-5); }
.ew-modal__close { appearance: none; border: 0; background: var(--ew-color-bg-subtle); cursor: pointer;
  width: var(--ew-tap-target); height: var(--ew-tap-target); border-radius: 50%; font-size: 1.2rem; color: var(--ew-color-text); flex: none; }
.ew-modal__close:hover { background: var(--ew-line-200); }

/* ---------- Hero ---------------------------------------------------------- */
.ew-hero { position: relative; overflow: hidden; background: var(--ew-ink-950); color: var(--ew-white); }
.ew-hero::before { /* teal radial glow */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 60% at 75% 10%, rgba(0,192,168,0.28), transparent 60%),
    radial-gradient(50% 50% at 10% 100%, rgba(46,230,194,0.14), transparent 60%);
}
.ew-hero::after { /* subtle grid */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(70% 70% at 50% 30%, #000, transparent 75%);
}
.ew-hero__inner { position: relative; z-index: var(--ew-z-raised);
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--ew-space-8); align-items: center;
  padding-block: var(--ew-space-10) var(--ew-space-9); }

/* Browser/product mock frame */
.ew-mock { background: var(--ew-ink-800); border: var(--ew-border-width) solid rgba(255,255,255,0.12);
  border-radius: var(--ew-radius-xl); box-shadow: var(--ew-shadow-xl); overflow: hidden; }
.ew-mock__bar { display: flex; align-items: center; gap: var(--ew-space-2); padding: var(--ew-space-3) var(--ew-space-4);
  border-bottom: var(--ew-border-width) solid rgba(255,255,255,0.10); }
.ew-mock__dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: rgba(255,255,255,0.25); }
.ew-mock__body { padding: var(--ew-space-5); }

/* ---------- Accessibility widget (signature element) -------------------- */
.ew-widget-fab {
  position: fixed; bottom: var(--ew-space-5); inset-inline-end: var(--ew-space-5);
  width: 3.5rem; height: 3.5rem; min-width: var(--ew-tap-target); min-height: var(--ew-tap-target);
  border-radius: 50%; border: 0; cursor: pointer; z-index: var(--ew-z-widget);
  background: var(--ew-color-brand); color: var(--ew-ink-900);
  display: grid; place-items: center; box-shadow: var(--ew-glow-teal);
}
.ew-widget-fab:hover { background: var(--ew-color-brand-strong); transform: scale(1.05); }
.ew-widget-fab svg { width: 1.9rem; height: 1.9rem; }

.ew-widget-menu { width: 20rem; background: var(--ew-color-surface); border-radius: var(--ew-radius-xl);
  box-shadow: var(--ew-shadow-xl); border: var(--ew-border); overflow: hidden; }
.ew-widget-menu__head { background: var(--ew-color-brand); color: var(--ew-ink-900);
  padding: var(--ew-space-4) var(--ew-space-5); font-weight: var(--ew-weight-bold); display: flex;
  justify-content: space-between; align-items: center; }
.ew-widget-menu__body { padding: var(--ew-space-4); display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ew-space-3); }
.ew-widget-tile { appearance: none; font: inherit; cursor: pointer; width: 100%;
  border: var(--ew-border); border-radius: var(--ew-radius-md); padding: var(--ew-space-3);
  background: var(--ew-color-surface); min-height: var(--ew-tap-target);
  text-align: center; font-size: var(--ew-text-xs); color: var(--ew-color-text-muted); display: grid; gap: var(--ew-space-2); justify-items: center; }
.ew-widget-tile:hover { border-color: var(--ew-color-border-strong); }
.ew-widget-tile svg { width: 1.4rem; height: 1.4rem; color: var(--ew-color-text); }
.ew-widget-tile[aria-pressed="true"] { border-color: var(--ew-color-brand); background: var(--ew-teal-50); color: var(--ew-teal-800); }

/* ---------- CTA band ----------------------------------------------------- */
.ew-cta-band { position: relative; overflow: hidden; background: var(--ew-ink-950); color: var(--ew-white);
  border-radius: var(--ew-radius-2xl); padding: var(--ew-space-9); text-align: center; }
.ew-cta-band::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 80% at 50% 0%, rgba(0,192,168,0.30), transparent 60%); }
.ew-cta-band > * { position: relative; z-index: var(--ew-z-raised); }

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 980px) {
  .ew-hero__inner { grid-template-columns: 1fr; gap: var(--ew-space-7); padding-block: var(--ew-space-8); }
  .ew-grid--3, .ew-grid--4, .ew-grid--5 { grid-template-columns: repeat(2, 1fr); }
  .ew-steps--row { grid-template-columns: repeat(2, 1fr); }
  .ew-footer__grid { grid-template-columns: 1fr 1fr; }
  .ew-nav { display: none; }
  /* Mobile reveal — class-based so it can't outlive the breakpoint like inline styles do */
  .ew-nav.ew-nav--open { display: flex; flex-direction: column; align-items: stretch;
    position: absolute; inset-inline-end: var(--ew-space-5); top: 4.5rem;
    background: var(--ew-color-surface); padding: var(--ew-space-3);
    border: var(--ew-border); border-radius: var(--ew-radius-lg); box-shadow: var(--ew-shadow-lg); }
  .ew-header__burger { display: grid; place-items: center; margin-inline-start: auto; }
  .ew-header__actions { display: none; }
  .ew-compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ew-compare { min-width: 720px; }
}
@media (max-width: 600px) {
  .ew-grid--2, .ew-grid--3, .ew-grid--4, .ew-grid--5 { grid-template-columns: 1fr; }
  .ew-steps--row { grid-template-columns: 1fr; }
  .ew-steps--row .ew-step:not(:last-child)::before { display: none; }
  .ew-footer__grid { grid-template-columns: 1fr; }
  .ew-section { padding-block: var(--ew-space-8); }
  .ew-cta-band { padding: var(--ew-space-7) var(--ew-space-5); }
}

/* ---------- Reduced motion: also suppress positional movement -------------
   Durations already collapse to 0 (tokens.css), but transforms still "jump".
   Neutralize hover/active movement so nothing shifts position. */
@media (prefers-reduced-motion: reduce) {
  .ew-btn:hover, .ew-btn:active,
  .ew-card--interactive:hover,
  .ew-widget-fab:hover { transform: none; }
  .ew-card__link:hover { gap: var(--ew-space-1); }
}
