/* ==========================================================================
   Global accessibility + consent layer
   Loaded on every page. Owns the font scale, contrast modes, focus rings,
   skip link, accessibility toolbar and cookie banner.
   ========================================================================== */

/* Font scaling is applied to the root font-size, so every rem-based measure
   grows together and grid tracks defined in rem scale with the text instead
   of overflowing it. Layouts using px or vw are unaffected by design. */
:root { --a11y-scale: 1; }
html { font-size: calc(100% * var(--a11y-scale)); }

/* --- Skip link --- */
.a11y-skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 2000;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 8px 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease-in-out;
}

.a11y-skip:focus {
  top: 0;
}

/* --- Focus rings ---
   :focus-visible only, so a pointer click does not leave a ring behind while
   keyboard users always get one. Applied broadly rather than per component so
   controls added later inherit it. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #7c3aed;
  outline-offset: 2px;
  border-radius: 4px;
}

html[data-contrast="high"] :focus-visible,
html[data-contrast="mono"] :focus-visible {
  outline-color: #ffcc00;
  outline-width: 4px;
}

/* --- Contrast modes ---
   Applied at the root so they cover every page without each stylesheet
   needing its own variant. */
html[data-contrast="high"] {
  --bg-primary: #000000;
  --bg-card: #0a0a0a;
  --text-main: #ffffff;
  --text-muted: #e6e6e6;
  --border-color: #ffffff;
  --accent-cyan: #00e5ff;
  --accent-purple: #d0a2ff;
  --accent-indigo: #b3c7ff;
  --success: #7CFFB2;
  --warning: #ffcc00;
  background: #000000;
  color: #ffffff;
}

/* Surfaces: pure black with a 2px white edge, so a card boundary is visible
   rather than inferred from a shadow that high contrast removes. */
html[data-contrast="high"] body,
html[data-contrast="high"] section,
html[data-contrast="high"] header,
html[data-contrast="high"] footer,
html[data-contrast="high"] nav,
html[data-contrast="high"] .card,
html[data-contrast="high"] .glass-card,
html[data-contrast="high"] .pricing-card,
html[data-contrast="high"] .engagement-card,
html[data-contrast="high"] .calculator-card,
html[data-contrast="high"] .modal-container,
html[data-contrast="high"] .consult-dialog,
html[data-contrast="high"] .modal-card,
html[data-contrast="high"] .a11y-panel,
html[data-contrast="high"] .cookie-banner,
html[data-contrast="high"] .policy-section {
  background: #000000 !important;
  background-image: none !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

html[data-contrast="high"] .card,
html[data-contrast="high"] .glass-card,
html[data-contrast="high"] .pricing-card,
html[data-contrast="high"] .engagement-card,
html[data-contrast="high"] .calculator-card,
html[data-contrast="high"] .modal-container,
html[data-contrast="high"] .consult-dialog,
html[data-contrast="high"] .modal-card,
html[data-contrast="high"] .a11y-panel,
html[data-contrast="high"] .cookie-banner {
  border: 2px solid #FFFFFF !important;
}

html[data-contrast="high"] .site-header,
html[data-contrast="high"] .nav-more-menu,
html[data-contrast="high"] .mobile-menu {
  background: #000000 !important;
  border-color: #FFFFFF !important;
}

/* Text. Body copy pure white; secondary copy #E5E7EB, which still clears 7:1
   on black and stays distinguishable from primary text. */
html[data-contrast="high"] p,
html[data-contrast="high"] li,
html[data-contrast="high"] td,
html[data-contrast="high"] th,
html[data-contrast="high"] label,
html[data-contrast="high"] dt,
html[data-contrast="high"] dd,
html[data-contrast="high"] h1,
html[data-contrast="high"] h2,
html[data-contrast="high"] h3,
html[data-contrast="high"] h4,
html[data-contrast="high"] h5 {
  color: #FFFFFF !important;
}

html[data-contrast="high"] .section-subtitle,
html[data-contrast="high"] .pricing-tagline,
html[data-contrast="high"] .engagement-blurb,
html[data-contrast="high"] .calc-foot,
html[data-contrast="high"] .addon-note,
html[data-contrast="high"] .policy-hint,
html[data-contrast="high"] .field-hint,
html[data-contrast="high"] .rate-badge-kind,
html[data-contrast="high"] .calc-badge-label,
html[data-contrast="high"] .calc-badge-note,
html[data-contrast="high"] .engagement-label,
html[data-contrast="high"] .stat-label,
html[data-contrast="high"] small {
  color: #E5E7EB !important;
}

/* Nav links kept lighter than body text would allow them to blend into it. */
html[data-contrast="high"] .nav-links a,
html[data-contrast="high"] .nav-more-toggle,
html[data-contrast="high"] a {
  color: #00E5FF !important;
}

html[data-contrast="high"] .nav-burger-bar {
  background: #FFFFFF !important;
}

/* Figures read as data, not prose, so they take the cyan accent. */
html[data-contrast="high"] .price-amount,
html[data-contrast="high"] .price-currency,
html[data-contrast="high"] .price-period,
html[data-contrast="high"] .calc-badge-value,
html[data-contrast="high"] .calc-total,
html[data-contrast="high"] .rate-badge-amount,
html[data-contrast="high"] .stat-value,
html[data-contrast="high"] .role-count {
  color: #00FFFF !important;
  -webkit-text-fill-color: #00FFFF !important;
}

html[data-contrast="high"] .pricing-header h3,
html[data-contrast="high"] .section-title,
html[data-contrast="high"] .modal-title,
html[data-contrast="high"] .hero-title,
html[data-contrast="high"] .engagement-heading {
  /* Stated explicitly rather than relying on inheritance: these carry
     gradient fills, and an inherited colour is invisible behind one. */
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  background: none !important;
  background-image: none !important;
}

/* Buttons: solid white with black text. A tinted background cannot be relied
   on to clear 7:1 against white label text. */
html[data-contrast="high"] .btn-primary,
html[data-contrast="high"] .btn-submit,
html[data-contrast="high"] .btn-checkout,
html[data-contrast="high"] .engagement-cta,
html[data-contrast="high"] .calc-cta,
html[data-contrast="high"] .cookie-accept,
html[data-contrast="high"] .a11y-btn[aria-pressed="true"] {
  background: #FFFFFF !important;
  background-image: none !important;
  color: #000000 !important;
  border: 2px solid #FFFFFF !important;
  text-shadow: none !important;
}

html[data-contrast="high"] .btn-secondary,
html[data-contrast="high"] .btn-row,
html[data-contrast="high"] .a11y-btn,
html[data-contrast="high"] .cookie-actions button,
html[data-contrast="high"] .btn-tenant-action {
  background: #000000 !important;
  color: #FFFFFF !important;
  border: 2px solid #FFFFFF !important;
}

/* Pills and badges carry meaning through colour, so they are inverted rather
   than flattened to the page background. */
html[data-contrast="high"] .addon-pill,
html[data-contrast="high"] .popular-badge {
  background: #000000 !important;
  color: #00FFFF !important;
  -webkit-text-fill-color: #00FFFF !important;
  border: 2px solid #FFFFFF !important;
}

html[data-contrast="high"] input,
html[data-contrast="high"] select,
html[data-contrast="high"] textarea {
  background: #000000 !important;
  color: #FFFFFF !important;
  border: 2px solid #FFFFFF !important;
}

html[data-contrast="high"] input::placeholder,
html[data-contrast="high"] textarea::placeholder {
  color: #E5E7EB !important;
  opacity: 1;
}

/* Decorative washes and blurs reduce effective contrast; both are removed. */
html[data-contrast="high"] *::before,
html[data-contrast="high"] *::after {
  background-image: none !important;
  backdrop-filter: none !important;
}

html[data-contrast="mono"] {
  filter: grayscale(1) contrast(1.15);
}

/* --- Accessibility toolbar --- */
.a11y-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1500;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #4f46e5;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
}

.a11y-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.75rem;
  z-index: 1500;
  width: min(310px, calc(100vw - 2rem));
  padding: 1.1rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
}

.a11y-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: #0f172a;
}

.a11y-group { margin-bottom: 1rem; }

.a11y-group-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
}

.a11y-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.a11y-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.a11y-btn[aria-pressed="true"] {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  font-weight: 700;
}

.a11y-hint {
  margin: 0.5rem 0 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: #475569;
}

/* --- Cookie consent --- */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1600;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.2rem 1.3rem;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
}

.cookie-banner h2 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

.cookie-banner p {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #334155;
}

.cookie-options {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cookie-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
  font-size: 0.86rem;
  line-height: 1.5;
}

.cookie-option input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; }
.cookie-option small { display: block; color: #475569; font-size: 0.76rem; }

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-actions button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.cookie-actions .cookie-accept {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  font-weight: 600;
}

/* --- Policy footer --- */
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem 0.9rem;
  padding: 1.25rem 1rem;
  font-size: 0.84rem;
  line-height: 1.6;
}

.legal-footer a,
.legal-footer button {
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.legal-footer .sep { opacity: 0.5; }

@media (prefers-reduced-motion: reduce) {
  .a11y-skip { transition: none; }
}

/* ── Services & delivery timelines, high contrast ───────────────────────────
   The section uses the page's own light surfaces, so these rules only push it
   the rest of the way: muted body copy and the indigo accents become pure
   black on pure white, and borders take over the separating that tint did.
   ------------------------------------------------------------------------- */

html[data-contrast="high"] .svc-band,
html[data-contrast="high"] .svc-card,
html[data-contrast="high"] .svc-card-featured,
html[data-contrast="high"] .svc-roadmap {
  background: #FFFFFF !important;
  color: #000000 !important;
  border-color: #000000 !important;
}

html[data-contrast="high"] .svc-band h2,
html[data-contrast="high"] .svc-band h3,
html[data-contrast="high"] .svc-band h4,
html[data-contrast="high"] .svc-band p,
html[data-contrast="high"] .svc-band li,
html[data-contrast="high"] .svc-eyebrow,
html[data-contrast="high"] .svc-lede,
html[data-contrast="high"] .svc-blurb,
html[data-contrast="high"] .svc-tier,
html[data-contrast="high"] .svc-delivery,
html[data-contrast="high"] .svc-days,
html[data-contrast="high"] .svc-scope {
  color: #000000 !important;
}

html[data-contrast="high"] .svc-tick,
html[data-contrast="high"] .svc-clock { color: #000000 !important; }

html[data-contrast="high"] .svc-tier { background: #FFFFFF !important; border: 2px solid #000000 !important; }
html[data-contrast="high"] .svc-scope a { color: #000000 !important; }

/* The badge and timeline nodes carry meaning, so they stay filled and are
   inverted rather than flattened away. */
html[data-contrast="high"] .svc-popular {
  background: #000000 !important;
  color: #FFFFFF !important;
}

html[data-contrast="high"] .svc-phase { border-color: #000000 !important; }
html[data-contrast="high"] .svc-phase::before {
  background: #000000 !important;
  box-shadow: 0 0 0 4px #FFFFFF !important;
}

@media (max-width: 520px) {
  .a11y-panel { right: 0.5rem; left: 0.5rem; width: auto; }
  .cookie-actions button { flex: 1 1 100%; }
}

/* --- Policy page typography ---
   Measure capped near 70 characters and generous line-height: legal text is
   read in long runs, and machine translation lengthens most European
   languages by 15-30%, which a tighter column would break. */
.policy-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
  color: var(--text-main, #0f172a);
}

.policy-header { margin-bottom: 2.5rem; }

.policy-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-purple, #7c3aed);
}

.policy-page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 0.75rem; }
.policy-page h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 0 0 1rem; }
.policy-page h3 { font-size: 1.05rem; margin: 1.75rem 0 0.6rem; }

.policy-lead { font-size: 1.02rem; line-height: 1.7; color: var(--text-muted, #475569); margin: 0 0 0.75rem; }
.policy-updated { font-size: 0.82rem; color: var(--text-muted, #475569); margin: 0 0 1.5rem; }

.policy-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  font-size: 0.9rem;
}

.policy-section {
  margin-bottom: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
  scroll-margin-top: 1.5rem;
}

.policy-page p,
.policy-page li { font-size: 0.95rem; line-height: 1.75; max-width: 68ch; }
.policy-page ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.policy-page li { margin-bottom: 0.5rem; }

.policy-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.policy-table caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }
.policy-table th, .policy-table td {
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.policy-table th { background: var(--bg-primary, #f8fafc); }

.policy-inline-btn {
  background: none; border: none; padding: 0;
  font: inherit; color: var(--accent-cyan, #0e7490);
  text-decoration: underline; cursor: pointer;
}

.policy-form { margin-top: 1.5rem; max-width: 520px; }
.policy-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.policy-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted, #475569); }
.policy-field input,
.policy-field select,
.policy-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #0f172a);
  font: inherit;
  font-size: 0.92rem;
}
.policy-note { font-size: 0.8rem; color: var(--text-muted, #475569); margin-top: 0.9rem; }
.policy-error {
  padding: 0.7rem 0.85rem; border: 1px solid var(--warning, #b45309);
  border-radius: 8px; color: var(--warning, #b45309); font-size: 0.86rem;
}
.policy-success {
  padding: 1.25rem; border: 1px solid var(--success, #047857);
  border-radius: 10px; margin-top: 1.5rem;
}
.policy-success h3 { margin-top: 0; }

@media (max-width: 520px) {
  .policy-page { padding: 2rem 1rem 3rem; }
  .policy-table { font-size: 0.84rem; }
  .policy-table th, .policy-table td { padding: 0.5rem; }
}

/* Inline hint under an auto-populated field, so an inferred value is visibly
   a suggestion rather than something the visitor is assumed to have chosen. */
.policy-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted, #475569);
}

.policy-hint:empty { display: none; }

/* Showcase drawer in high contrast: the mockups are markup, so they follow
   the same rules as the rest of the page rather than needing their own. */
html[data-contrast="high"] .showcase-drawer,
html[data-contrast="high"] .showcase-stage,
html[data-contrast="high"] .mk-frame,
html[data-contrast="high"] .mk-hero,
html[data-contrast="high"] .mk-card,
html[data-contrast="high"] .mk-stat,
html[data-contrast="high"] .mk-role,
html[data-contrast="high"] .mk-tenant,
html[data-contrast="high"] .mk-status li,
html[data-contrast="high"] .mk-form,
html[data-contrast="high"] .mk-field {
  background: #000000 !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
}

html[data-contrast="high"] .showcase-trigger,
html[data-contrast="high"] .mk-v,
html[data-contrast="high"] .mk-nav {
  color: #00E5FF !important;
}

html[data-contrast="high"] .showcase-chip[aria-pressed="true"] {
  background: #FFFFFF !important;
  color: #000000 !important;
  border: 2px solid #FFFFFF !important;
}

html[data-contrast="high"] .mk-btn {
  background: #FFFFFF !important;
  color: #000000 !important;
}

html[data-contrast="high"] .mk-dot {
  background: #00FFFF !important;
}

/* The dark STRUCTiO sample sets its own colours, so high contrast has to
   reclaim it explicitly or it keeps a slate palette on a black page. */
html[data-contrast="high"] .mk-dark,
html[data-contrast="high"] .mk-dark .mk-panel,
html[data-contrast="high"] .mk-dark .mk-status li,
html[data-contrast="high"] .mk-dark .mk-chip,
html[data-contrast="high"] .mk-dark .mk-asset,
html[data-contrast="high"] .mk-dark .mk-gbtn,
html[data-contrast="high"] .stack-row,
html[data-contrast="high"] .mk-panel,
html[data-contrast="high"] .mk-chip,
html[data-contrast="high"] .mk-asset,
html[data-contrast="high"] .mk-gbtn,
html[data-contrast="high"] .mk-badge {
  background: #000000 !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
}

html[data-contrast="high"] .mk-dark .mk-nav,
html[data-contrast="high"] .mk-dark .mk-v,
html[data-contrast="high"] .mk-panel-head,
html[data-contrast="high"] .mk-note,
html[data-contrast="high"] .showcase-track,
html[data-contrast="high"] .stack-row dd {
  color: #E5E7EB !important;
}

html[data-contrast="high"] .mk-chip-on {
  background: #FFFFFF !important;
  color: #000000 !important;
}
