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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Cursor personalizado: el nativo solo se oculta cuando cursor.js está
   activo (body.has-cursor). Si el script falla, nadie se queda sin cursor. */
body.has-cursor,
body.has-cursor * { cursor: none !important; }


/* ─── Light sections (white bg, dark text) ─── */
.section-light {
  background: var(--bg-white);
  color: var(--text-dark);
}

.section-light .eyebrow { color: var(--accent); }
.section-light h2, .section-light h3 { color: var(--text-dark); }
.section-light p { color: var(--text-muted-dark); }
.section-light .btn-pill { border-color: var(--accent); color: var(--accent); }
.section-light .btn-pill:hover { background: var(--accent); color: #fff; }
.section-light .btn-pill .btn-dot-circle { background: var(--accent); }
.section-light .btn-pill--solid { background: var(--accent); color: #fff; border-color: var(--accent); }
.section-light .btn-pill--solid:hover { background: var(--accent-light); }

/* ─── Off-white sections ─── */
.section-offwhite {
  background: var(--bg-light);
  color: var(--text-dark);
}
.section-offwhite .eyebrow { color: var(--accent); }
.section-offwhite h2, .section-offwhite h3 { color: var(--text-dark); }
.section-offwhite p { color: var(--text-muted-dark); }

/* ─── Light pages: blog, empleo ─── */
body.page-light {
  background: #fff;
  color: #0a0a0a;
}
body.page-light .site-header { background: rgba(255,255,255,0.95); border-bottom: 1px solid var(--border-light); }
body.page-light .header-nav a { color: var(--text-dark); }
body.page-light .btn-pill { border-color: var(--accent); color: var(--accent); }
body.page-light .btn-pill:hover { background: var(--accent); color: #fff; }
body.page-light .eyebrow { color: var(--accent); }
body.page-light footer { background: var(--accent); color: #fff; }
body.page-light #site-header.scrolled .header-nav a { color: #fff; }
body.page-light #site-header.scrolled .btn-pill--white { color: #fff; border-color: rgba(255,255,255,0.5); }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
main.site-main { display: block; }
[hidden] { display: none !important; }

/* Touch / pointer-coarse devices: restore normal cursor, hide custom cursor div */
@media (hover: none), (pointer: coarse) {
  body    { cursor: auto; }
  button  { cursor: pointer; }
  a       { cursor: pointer; }
  #cursor { display: none !important; }
  .btn-pill,
  .faq-q,
  .play-btn-large { cursor: pointer; }
}

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

/* ─── Typography helpers ─── */
.eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold-light);
}

.eyebrow--accent { color: var(--gold); }
.eyebrow--blue { color: var(--accent-light); }

.section-pad { padding: var(--section-pad) 0; }

/* ─── Reveal animations ───
   Solo con JavaScript activo (html.js): sin él, el contenido es visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
.js.reduced-motion .reveal { opacity: 1; transform: none; transition: none; }
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }

/* ─── Dot side panels (CSS-based, no canvas resize bugs) ─── */
.dot-side-wrap {
  position: relative;
  overflow: hidden;
}

.dot-side-panel {
  position: absolute;
  top: 0;
  width: clamp(80px, 12vw, 200px);
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.dot-side-panel--left  { left: 0; }
.dot-side-panel--right { right: 0; }

/* CSS dot pattern — light blue/gold on dark sections */
.dot-side-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(100,170,255,0.25) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  background-position: 11px 11px;
  transition: opacity 0.4s;
}

/* Navy dots on light sections */
.section-light .dot-side-panel::after,
.section-offwhite .dot-side-panel::after {
  background-image: radial-gradient(circle, rgba(0,50,110,0.2) 1.5px, transparent 1.5px);
}

.dot-side-panel:hover::after { opacity: 0.8; }

/* Canvas hidden by default — CSS ::after handles static dots */
.dot-side-canvas { display: none; }

/* Enable interactive magnetic canvas on about section */
#dots-about-left,
#dots-about-right {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Hide the static ::after when interactive canvas is active */
#nosotros-home .dot-side-panel::after { display: none; }

/* Enable interactive magnetic canvas on testimonios section */
#dots-testi-left,
#dots-testi-right {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#testimonios .dot-side-panel::after, #testimonials .dot-side-panel::after { display: none; }

/* ─── Línea de acento bajo los heros (compartida por todas las páginas) ─── */
.hero-accent-line {
  height: 3px;
  background: var(--coral-500);
  width: 100%;
}

/* ─── Accesibilidad ─── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  background: var(--coral-500);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; outline: 2px solid #fff; outline-offset: 2px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid #6aabff; outline-offset: 3px; }
.sagesa-hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ─── Estados de formulario (comunes a todos) ─── */
.form-error {
  display: block;
  font-size: 13px;
  color: #ffb4a8;
  background: rgba(229,78,56,0.12);
  border-left: 3px solid var(--coral-500);
  padding: 10px 14px;
  margin-top: 14px;
  line-height: 1.5;
}
.section-light .form-error, .page-light .form-error, #faq-form .form-error, .apply-modal .form-error { color: #b3261e; background: rgba(229,78,56,0.08); }
.form-error[hidden] { display: none; }
.form-success { display: none; text-align: center; padding: 40px; border: 1px solid var(--accent); }
.form-success.is-visible { display: block; }
.form-success:focus { outline: 2px solid #6aabff; outline-offset: 3px; }
.form-success p { color: var(--text-muted); margin-top: 8px; }
.form-success h3 { font-family: var(--font-body); font-size: 28px; font-weight: 400; }
.form-consent { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 12px; font-size: 13px; line-height: 1.5; }
.form-consent input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; accent-color: var(--coral-500); cursor: pointer; }
.form-consent label { color: inherit; opacity: 0.85; }
.form-consent a { text-decoration: underline; text-underline-offset: 2px; }
.form-legal { font-size: 11px; line-height: 1.55; opacity: 0.65; margin: 0 0 16px; }
.form-legal strong { font-weight: 600; }
.is-invalid { border-color: #ff4444 !important; }
.is-busy { opacity: 0.6; pointer-events: none; }
form[aria-busy="true"] .btn-pill--submit .btn-dot-circle { animation: sagesa-spin 1s linear infinite; }
@keyframes sagesa-spin { to { transform: rotate(360deg); } }

/* ─── Widgets Elementor: sin margen inferior (antes en elementor-fixes.css) ─── */
[class*="elementor-widget-sagesa-"] { margin-bottom: 0 !important; }

/* ─── Movimiento reducido ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .reveal, .js .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: 100%; justify-content: center; }
  .page-transition, #cursor { display: none !important; }
}
