/* ==========================================================================
   Agilez — institutional site
   Design tokens
   ========================================================================== */

:root {
  --ink: #0b1220;
  --ink-soft: #1b2333;
  --paper: #faf9f6;
  --paper-dim: #f0eee8;
  --line: rgba(11, 18, 32, 0.10);
  --line-strong: rgba(11, 18, 32, 0.18);
  --muted: #5b6472;

  --agilez: #1b7fd1;
  --agilez-deep: #0f5ea3;

  --entregui: #d32027;
  --meutreino: #c41230;
  --criala: #141414;
  --contotal: #1b4b5f;

  --surface: var(--paper);
  --surface-alt: var(--paper-dim);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --accent: var(--agilez);
  --accent-deep: var(--agilez-deep);
  --card-bg: #ffffff;
  --header-bg: rgba(250, 249, 246, 0.85);
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 12px 32px -16px rgba(11, 18, 32, 0.16);

  --font-display: "Agilez Display", -apple-system, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --font-body: -apple-system, "Segoe UI", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;

  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0b1220;
    --surface-alt: #10192b;
    --text: #f2f0ea;
    --text-muted: #9aa4b5;
    --border: rgba(242, 240, 234, 0.10);
    --border-strong: rgba(242, 240, 234, 0.18);
    --accent: #4fa3e8;
    --accent-deep: #78bcf3;
    --card-bg: #121b2e;
    --header-bg: rgba(11, 18, 32, 0.80);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    --criala: #e8e6e0;
  }

  :root:not([data-theme="light"]) .product-card--criala .product-icon img { filter: invert(1); }

  :root:not([data-theme="light"]) .brand img { filter: brightness(0) invert(1); }

  :root:not([data-theme="light"]) .btn-primary { background: var(--accent); color: #0b1220; }

  :root:not([data-theme="light"]) .service-cta { background: var(--card-bg); border: 1px solid var(--border-strong); }
  :root:not([data-theme="light"]) .service-cta p { color: var(--text); }
  :root:not([data-theme="light"]) .service-cta .btn-primary { background: var(--accent); color: #0b1220; }

  :root:not([data-theme="light"]) .press-row img { filter: grayscale(1) opacity(0.7) invert(1); }

  :root:not([data-theme="light"]) .site-footer { background: var(--surface-alt); border-top: 1px solid var(--border); }

  :root:not([data-theme="light"]) #back-top a { background: var(--accent); color: #0b1220; }
}

:root[data-theme="dark"] {
  --surface: #0b1220;
  --surface-alt: #10192b;
  --text: #f2f0ea;
  --text-muted: #9aa4b5;
  --border: rgba(242, 240, 234, 0.10);
  --border-strong: rgba(242, 240, 234, 0.18);
  --accent: #4fa3e8;
  --accent-deep: #78bcf3;
  --card-bg: #121b2e;
  --header-bg: rgba(11, 18, 32, 0.80);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --criala: #e8e6e0;
}

:root[data-theme="dark"] .product-card--criala .product-icon img { filter: invert(1); }

:root[data-theme="dark"] .brand img { filter: brightness(0) invert(1); }

:root[data-theme="dark"] .btn-primary { background: var(--accent); color: #0b1220; }

:root[data-theme="dark"] .service-cta { background: var(--card-bg); border: 1px solid var(--border-strong); }
:root[data-theme="dark"] .service-cta p { color: var(--text); }
:root[data-theme="dark"] .service-cta .btn-primary { background: var(--accent); color: #0b1220; }

:root[data-theme="dark"] .press-row img { filter: grayscale(1) opacity(0.7) invert(1); }

:root[data-theme="dark"] .site-footer { background: var(--surface-alt); border-top: 1px solid var(--border); }

:root[data-theme="dark"] #back-top a { background: var(--accent); color: #0b1220; }

/* ==========================================================================
   Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand img { height: 30px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); }

.nav-links .whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 600;
}

.lang-switch {
  order: 3;
  flex-shrink: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-switch::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.lang-switch select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 28px 7px 12px;
  cursor: pointer;
  line-height: 1.2;
}

.lang-switch select:hover { border-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}

.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 32px 20px;
    display: none;
  }

  .nav-links.is-open { display: flex; }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 128px 0 120px;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 640px;
  background:
    radial-gradient(560px 360px at 18% 20%, color-mix(in srgb, var(--entregui) 22%, transparent), transparent 70%),
    radial-gradient(520px 340px at 78% 10%, color-mix(in srgb, var(--criala) 20%, transparent), transparent 70%),
    radial-gradient(600px 420px at 50% 55%, color-mix(in srgb, var(--agilez) 24%, transparent), transparent 70%);
  filter: blur(10px);
  z-index: -1;
  opacity: 0.9;
}

.hero-inner {
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 66px);
  line-height: 1.06;
  margin-top: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  margin-top: 24px;
  max-width: 560px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-strip {
  margin-top: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-chip .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

section { padding: 108px 0; }

.section-head {
  max-width: 620px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  margin-top: 14px;
}

.section-head p {
  margin-top: 16px;
  font-size: 17px;
  color: var(--text-muted);
}

.section-alt { background: var(--surface-alt); }

/* ==========================================================================
   Products — the "doors"
   ========================================================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 760px) {
  .product-grid { grid-template-columns: 1fr; }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 36px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  --brand: var(--agilez);
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
}

.product-card:hover::before,
.product-card:focus-within::before { opacity: 1; }

.product-card--entregui { --brand: var(--entregui); }
.product-card--meutreino { --brand: var(--meutreino); }
.product-card--criala { --brand: var(--criala); }
.product-card--contotal { --brand: var(--contotal); }

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.product-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--brand);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 70%, transparent);
}

.product-icon img { width: 100%; height: 100%; object-fit: cover; }

.product-card--criala .product-icon img { object-fit: contain; padding: 11px; }

.product-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.product-card:hover .product-arrow {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: rotate(45deg);
}

.product-arrow svg { width: 16px; height: 16px; }

.product-card h3 {
  font-size: 22px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.product-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
}

.product-card p.desc {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
  flex-grow: 1;
}

.product-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.product-card a.card-hitarea {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ==========================================================================
   Services
   ========================================================================== */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 860px) {
  .service-grid { grid-template-columns: 1fr; }
}

.service-card {
  padding: 32px 28px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.service-icon {
  width: 46px;
  height: 46px;
  color: var(--accent);
  margin-bottom: 20px;
}

.service-icon svg { width: 100%; height: 100%; }

.service-card h3 {
  font-size: 19px;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
}

.service-cta {
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 30px 34px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--paper);
}

.service-cta p { font-size: 18px; font-weight: 600; color: var(--paper); }

.service-cta .btn-primary {
  background: var(--paper);
  color: var(--ink);
}

/* ==========================================================================
   Customers
   ========================================================================== */

.stat-line {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 56px;
}

.stat-line strong {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  color: var(--accent);
}

.stat-line span { color: var(--text-muted); font-size: 16px; }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

@media (max-width: 860px) {
  .logo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
}

.logo-cell {
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  min-height: 108px;
}

.logo-cell img {
  max-height: 34px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.6);
  transition: filter 0.2s ease;
}

.logo-cell:hover img { filter: grayscale(0) opacity(1); }

/* ==========================================================================
   Press
   ========================================================================== */

.press-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 56px;
}

.press-row img {
  max-height: 26px;
  width: auto;
  filter: grayscale(1) opacity(0.55);
}

/* ==========================================================================
   Map / location
   ========================================================================== */

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}

@media (max-width: 860px) {
  .location-grid { grid-template-columns: 1fr; }
}

.location-info {
  background: var(--card-bg);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: center;
}

.location-block h4 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

.location-block p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

.location-map iframe {
  width: 100%;
  height: 100%;
  min-height: 340px;
  border: 0;
  display: block;
  filter: grayscale(0.3);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 72px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
}

.footer-brand img { height: 26px; margin-bottom: 18px; }

.footer-brand p {
  color: rgba(250, 249, 246, 0.62);
  font-size: 15px;
  line-height: 1.65;
  max-width: 340px;
}

.footer-col h5 {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(250, 249, 246, 0.5);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: rgba(250, 249, 246, 0.85);
  font-size: 15px;
  transition: color 0.15s ease;
}

.footer-col a:hover { color: #fff; }

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(250, 249, 246, 0.2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.footer-social a:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.footer-social svg { width: 17px; height: 17px; }

.footer-bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(250, 249, 246, 0.12);
  font-size: 13.5px;
  color: rgba(250, 249, 246, 0.5);
}

/* ==========================================================================
   Back to top
   ========================================================================== */

#back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateY(8px);
}

#back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#back-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}

#back-top svg { width: 18px; height: 18px; }

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */

@media (max-width: 600px) {
  section { padding: 76px 0; }
  .hero { padding: 96px 0 72px; }
  .container { padding: 0 20px; }
  .product-card { padding: 28px; }
}

/* ==========================================================================
   Legal pages
   ========================================================================== */

.legal-hero {
  padding: 92px 0 48px;
  border-bottom: 1px solid var(--border);
}

.legal-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  margin-top: 14px;
}

.legal-hero .updated {
  margin-top: 14px;
  font-size: 14.5px;
  color: var(--text-muted);
}

.legal-body {
  padding: 64px 0 108px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; gap: 32px; }
}

.legal-toc {
  position: sticky;
  top: 108px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-toc a {
  padding: 8px 0;
  font-size: 14.5px;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 16px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-toc a:hover { color: var(--text); border-color: var(--accent); }

.legal-content { max-width: 680px; }

.legal-content h2 {
  font-size: 22px;
  margin-top: 48px;
  margin-bottom: 14px;
  scroll-margin-top: 96px;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 14px;
}

.legal-content ul {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal-content li { margin-bottom: 6px; }

.legal-content strong { color: var(--text); }

.legal-content a.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
