/* =========================================================
   Criterio — Main Stylesheet
   ========================================================= */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700;800&display=swap');

/* ----- Design Tokens ----- */
:root {
  /* Decorative accent — do NOT use for text on light backgrounds */
  --c-brand:      #29b6c8;
  /* AA-accessible teal for interactive text and button backgrounds (5.5:1 on bg, 6.2:1 on white) */
  --c-brand-text: #0d6b7a;
  --c-brand-dark: #0a5867;

  --c-text:       #0b1423;
  --c-text-mid:   #3d5166;
  /* Darkened from #6b7f96 — passes 5.6:1 on bg, 6.3:1 on surface */
  --c-muted:      #536174;
  --c-bg:         #eef2f7;
  --c-surface:    #ffffff;
  --c-border:     #d0d9e4;
  --c-ok:         #059669;
  --c-warn:       #d97706;
  --c-danger:     #dc2626;

  /* Module accents — decorative only */
  --c-wcag:  #29b6c8;
  --c-eaa:   #003399;
  --c-gdpr:  #475569;

  --font:    'Barlow', -apple-system, sans-serif;
  --radius:  10px;
  --max-w:   1160px;
  --nav-h:   68px;

  --t-fast:  160ms ease;
  --t-mid:   280ms ease;
}

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-brand-text); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-brand-dark); }

/* ----- Screen reader only utility ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ----- Skip link ----- */
.skip-link {
  position: absolute;
  top: -999px;
  left: -999px;
  z-index: 9999;
  background: var(--c-brand-text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
  left: 0;
  width: auto;
  height: auto;
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { color: var(--c-text-mid); }

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-brand-text);
  margin-bottom: 0.75rem;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--c-brand-text);
  color: #fff;
  border-color: var(--c-brand-text);
}
.btn-primary:hover {
  background: var(--c-brand-dark);
  border-color: var(--c-brand-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--c-brand-text);
  border-color: var(--c-brand-text);
}
.btn-outline:hover {
  background: var(--c-brand-text);
  color: #fff;
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  min-height: 44px;
}

/* ----- Nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  height: var(--nav-h);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.site-logo img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-text-mid);
  text-decoration: none;
}
.nav-links a:hover { color: var(--c-brand-text); }
.nav-links a[aria-current="page"] { color: var(--c-brand-text); font-weight: 600; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

/* ----- Language switcher (Polylang) ----- */
.lang-switcher ul,
.lang-switcher li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lang-switcher ul { display: flex; gap: 0.25rem; }
.lang-switcher .pll-sep { display: none; }
.lang-switcher li a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-text-mid);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
  min-height: 36px;
}
.lang-switcher li a:hover {
  border-color: var(--c-brand-text);
  color: var(--c-brand-text);
  background: rgba(13,107,122,0.05);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.625rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
  border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--c-bg); }

/* ----- Hero ----- */
.hero {
  padding: 6rem 0 5rem;
  background: linear-gradient(160deg, #eef2f7 0%, #e4ecf5 100%);
  border-bottom: 1px solid var(--c-border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 107, 122, 0.08);
  border: 1px solid rgba(13, 107, 122, 0.25);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-brand-text);
  margin-bottom: 1.25rem;
}

.hero h1 { margin-bottom: 1.25rem; }
.hero h1 span { color: var(--c-brand-text); }

.hero-lead {
  font-size: 1.125rem;
  color: var(--c-text-mid);
  margin-bottom: 2rem;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(11, 20, 35, 0.06);
  transition: transform var(--t-mid), box-shadow var(--t-mid);
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(11, 20, 35, 0.1); }

.hero-card-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.hero-card-icon.wcag { background: rgba(41, 182, 200, 0.12); }
.hero-card-icon.eaa  { background: rgba(0, 51, 153, 0.1); }
.hero-card-icon.gdpr { background: rgba(71, 85, 105, 0.1); }

.hero-card-text strong { display: block; font-weight: 700; font-size: 0.9375rem; color: var(--c-text); }
.hero-card-text span   { font-size: 0.8125rem; color: var(--c-muted); }

/* ----- Section defaults ----- */
.section { padding: 5rem 0; }
.section-alt { background: var(--c-surface); }

.section-dark {
  background: #0d1826;
  color: #e8edf4;
}
.section-dark h2, .section-dark h3 { color: #e8edf4; }
/* Lightened from #a8b5c8 — 5.6:1 on #0d1826 */
.section-dark p { color: #c5d0dd; }

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header p {
  font-size: 1.0625rem;
  max-width: 56ch;
  margin: 0.75rem auto 0;
}

/* ----- Module Cards ----- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.module-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: calc(var(--radius) + 2px);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(11, 20, 35, 0.05);
  transition: transform var(--t-mid), box-shadow var(--t-mid);
  position: relative;
  overflow: hidden;
}
.module-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(11, 20, 35, 0.1); }

.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.module-card.wcag::before { background: var(--c-wcag); }
.module-card.eaa::before  { background: var(--c-eaa); }
.module-card.gdpr::before { background: var(--c-gdpr); }

.module-icon {
  font-size: 1.75rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.module-card.wcag .module-icon { background: rgba(41, 182, 200, 0.12); }
.module-card.eaa  .module-icon { background: rgba(0, 51, 153, 0.1); }
.module-card.gdpr .module-icon { background: rgba(71, 85, 105, 0.1); }

.module-card h3 { font-size: 1.125rem; }
.module-card p  { font-size: 0.9375rem; flex: 1; }

.module-card .btn { align-self: flex-start; margin-top: auto; }

/* ----- Trust / Stats bar ----- */
.trust-bar {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: 2.5rem 0;
}

.trust-items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-text-mid);
}
.trust-item .trust-icon {
  color: var(--c-brand-text);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ----- Process Steps ----- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.step {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.step-number {
  width: 36px;
  height: 36px;
  background: var(--c-brand-text);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.step h4 { margin-bottom: 0.5rem; }
.step p   { font-size: 0.9rem; }

/* ----- CTA Band ----- */
.cta-band {
  background: linear-gradient(135deg, #0d1826 0%, #162236 100%);
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(41,182,200,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.cta-band h2 { color: #e8edf4; margin-bottom: 1rem; }
/* Lightened for 5.6:1 on dark bg */
.cta-band p  { color: #c5d0dd; font-size: 1.0625rem; max-width: 52ch; margin: 0 auto 2rem; }
.cta-band .btn-primary { font-size: 1rem; padding: 0.9rem 2rem; }

/* ----- Footer ----- */
.site-footer {
  background: #0b1423;
  color: #a8b5c8;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .site-logo img { height: 32px; margin-bottom: 1rem; filter: brightness(0) invert(1); opacity: 0.85; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; max-width: 32ch; }

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e8edf4;
  margin-bottom: 1rem;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
/* #a8b5c8 on #0b1423 = 8.9:1 — passes AAA */
.footer-links a { font-size: 0.9rem; color: #a8b5c8; transition: color var(--t-fast); }
.footer-links a:hover { color: var(--c-brand); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8375rem;
  color: #8a9bb0;
}
.footer-bottom a { color: #8a9bb0; }
.footer-bottom a:hover { color: var(--c-brand); }

/* ----- Page Hero (inner pages) ----- */
.page-hero {
  background: linear-gradient(160deg, #eef2f7 0%, #e4ecf5 100%);
  border-bottom: 1px solid var(--c-border);
  padding: 4rem 0 3rem;
}
.page-hero h1 { margin: 0.5rem 0 1rem; }
.page-hero-lead {
  font-size: 1.0625rem;
  color: var(--c-text-mid);
  max-width: 54ch;
}

/* ----- Contact / Leads page ----- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.info-block h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.625rem;
  border-bottom: 2px solid var(--c-border);
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.info-list li {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}
.info-list .info-icon {
  font-size: 1.25rem;
  color: var(--c-brand-text);
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.info-list strong {
  display: block;
  font-size: 0.9375rem;
  color: var(--c-text);
  margin-bottom: 0.2rem;
}
.info-list p {
  font-size: 0.875rem;
  margin: 0;
}

.info-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.info-checklist li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9rem;
  color: var(--c-text-mid);
}
.info-checklist span {
  color: var(--c-brand-text);
  font-weight: 700;
  flex-shrink: 0;
}

.info-trust {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.info-trust p {
  font-size: 0.8125rem;
  color: var(--c-muted);
  margin: 0;
}

@media (max-width: 960px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ----- Focus visible ----- */
:focus-visible {
  outline: 3px solid var(--c-brand-text);
  outline-offset: 4px;
  border-radius: 4px;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

/* Ensure dark-background sections have visible focus ring */
.site-footer :focus-visible,
.cta-band :focus-visible,
.section-dark :focus-visible {
  outline-color: var(--c-brand);
}

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { display: none; }
  .modules-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links, .nav-right { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 1.5rem;
    gap: 0.25rem;
    box-shadow: 0 8px 24px rgba(11, 20, 35, 0.1);
  }
  .nav-links.open li a {
    display: block;
    padding: 0.75rem 0.5rem;
    min-height: 44px;
    border-radius: var(--radius);
  }
  .nav-links.open + .nav-cta {
    display: flex;
    position: fixed;
    top: calc(var(--nav-h) + 100%);
  }

  .steps-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .trust-items { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
