@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --green: #268b4b;
  --green-dark: #1c6b3a;
  --green-light: #37cc6e;
  --teal: #3dc8a8;
  --ink: #14231a;
  --muted: #55645b;
  --bg: #f5f8f6;
  --card: #ffffff;
  --line: #e3ebe6;
  --field: #cfdad3;
  --accent-text: #1c6b3a;
  --shadow: 0 10px 30px rgba(20, 35, 26, .10);
  --radius: 18px;
  color-scheme: light;
}

/* Modo oscuro: automático según el sistema, o forzado con el botón */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="claro"]) {
    --ink: #e8f0ea;
    --muted: #a3b5a9;
    --bg: #0e1712;
    --card: #16231b;
    --line: #22362a;
    --field: #34503e;
    --accent-text: #5fdc8f;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="oscuro"] {
  --ink: #e8f0ea;
  --muted: #a3b5a9;
  --bg: #0e1712;
  --card: #16231b;
  --line: #22362a;
  --field: #34503e;
  --accent-text: #5fdc8f;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 800; }
p { margin: 0 0 1em; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.4em; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }
.btn:active { transform: translateY(0); }
.btn--white { background: #fff; color: #1c6b3a; }
.btn--ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.14); }
.btn--solid { background: var(--green); color: #fff; }
.btn--solid:hover { background: var(--green-dark); }
.btn--outline { border-color: var(--green); color: var(--accent-text); background: transparent; }
.btn--outline:hover { background: var(--green); color: #fff; }
.btn--remote { background: #fff; color: #1c6b3a; padding: .6em 1.1em; font-size: .85rem; }

/* Cabecera */
.top { position: fixed; inset: 0 0 auto 0; z-index: 10; background: rgba(28,107,58,.92); backdrop-filter: blur(8px); transition: box-shadow .25s; }
.top--scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.top__in { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.logo img { height: 52px; width: auto; }
.top__actions { display: flex; align-items: center; gap: 12px; }
.theme {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55);
  background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background .15s, transform .25s;
}
.theme:hover { background: rgba(255,255,255,.16); transform: rotate(18deg); }
.theme svg { width: 20px; height: 20px; }
.theme .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="claro"]) .theme .i-moon { display: none; }
  :root:not([data-theme="claro"]) .theme .i-sun { display: block; }
}
:root[data-theme="oscuro"] .theme .i-moon { display: none; }
:root[data-theme="oscuro"] .theme .i-sun { display: block; }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; padding: 160px 0 90px; background: var(--green-dark); }
.hero__bg {
  position: absolute; inset: -10% 0 -10% 0; z-index: 0;
  background: linear-gradient(rgba(38,139,75,.35), rgba(28,107,58,.55)), url("fondo.png") center / cover;
  will-change: transform;
}
.hero__in { position: relative; z-index: 1; }
.hero__in > * { max-width: 820px; }
.kicker { font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 5.5rem); font-weight: 800; margin-bottom: .35em; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); }
.lead a {
  font-weight: 600; text-decoration: none; border-radius: 4px;
  background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,.9)) 0 100% / 100% 2px no-repeat;
  transition: background-size .2s, color .2s;
}
.lead a:hover { background-size: 100% 100%; color: #1c6b3a; }
.lead--sub { font-weight: 600; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }
.js .hero__in > * { animation: subir .7s both; }
.js .hero__in > *:nth-child(2) { animation-delay: .08s; }
.js .hero__in > *:nth-child(3) { animation-delay: .16s; }
.js .hero__in > *:nth-child(4) { animation-delay: .24s; }
.js .hero__in > *:nth-child(5) { animation-delay: .32s; }
@keyframes subir { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Aparición al hacer scroll (solo si hay JS) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Asistencia remota */
.remote { background: var(--card); border-bottom: 1px solid var(--line); padding: 38px 0; }
.remote__in { display: grid; gap: 22px; align-items: center; }
.remote h2 { font-size: 1.4rem; margin-bottom: .4em; }
.remote p { margin: 0; color: var(--muted); max-width: 52ch; }
.remote__btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Servicios */
.services { padding: 70px 0 30px; }
.services .wrap { display: grid; gap: 22px; }
.svc {
  background: var(--card); border-radius: var(--radius); padding: 32px; border-left: 6px solid var(--green);
  box-shadow: 0 2px 0 var(--line);
}
.js .svc.reveal.in { transition: opacity .6s ease, transform .25s ease, box-shadow .25s ease; }
.svc:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.svc:nth-child(even) { border-left-color: var(--teal); }
.svc__tag { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .6em; }
.svc h2 { margin-bottom: .5em; }
.svc p { color: var(--muted); max-width: 62ch; }
.svc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .4em; }
.svc li { padding-left: 1.6em; position: relative; font-weight: 600; font-size: .95rem; }
.svc li::before { content: ""; position: absolute; left: 0; top: .55em; width: .7em; height: .7em; border-radius: 3px 100% 3px 3px; background: var(--green-light); transition: transform .2s; }
.svc li:hover::before { transform: scale(1.4) rotate(12deg); }

/* Cómo trabajamos */
.how { padding: 70px 0 40px; }
.how__intro { color: var(--muted); margin-top: .6em; }
.steps { list-style: none; margin: 32px 0 28px; padding: 0; display: grid; gap: 18px; counter-reset: paso; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; position: relative; transition: transform .25s, box-shadow .25s; }
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.step__n {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 14px 100% 14px 14px;
  background: var(--green); color: #fff; font-weight: 800;
}
.step h3 { margin-bottom: .4em; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }
.how__end { max-width: 62ch; font-size: 1.05rem; }
.how__end strong { color: var(--accent-text); }

/* IA */
.ai { background: linear-gradient(160deg, #0f2a1b, #14412a 60%, #176448); color: #fff; padding: 80px 0; position: relative; overflow: hidden; }
.ai::before {
  content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none;
  background: url("fondo2.png") center / cover; mix-blend-mode: soft-light;
}
.ai .wrap { position: relative; }
.ai__head { max-width: 720px; }
.ai__head h2 { margin: .3em 0 .6em; }
.ai__head p:last-child { opacity: .9; }
.flow { list-style: none; margin: 40px 0 24px; padding: 0; display: grid; gap: 16px; }
.flow__item {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(4px); transition: transform .25s, background .25s; position: relative;
}
.flow__item:hover { transform: translateY(-4px); background: rgba(255,255,255,.12); }
.flow__item svg { width: 44px; height: 44px; color: var(--green-light); margin-bottom: 12px; }
.flow__item p { margin: .4em 0 0; font-size: .92rem; opacity: .85; }
.ai__note { font-size: .9rem; opacity: .8; margin: 0; }

/* Confianza */
.trust { padding: 70px 0 20px; }
.trust h2 { max-width: 640px; }
.clients { list-style: none; margin: 28px 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* Caso real */
.case { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--teal); border-radius: var(--radius); padding: 28px 32px; margin: 0 0 32px; }
.case__tag { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .6em; }
.case h3 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); margin-bottom: 1em; max-width: 36ch; }
.case h4 { margin: 0 0 .3em; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.case__cols { display: grid; gap: 18px; }
.case__cols p { margin: 0; color: var(--muted); }
.case__cols p + p { margin-top: .7em; }
.case__brands { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.case__brands li { border: 1.5px solid var(--green); color: var(--accent-text); border-radius: 999px; padding: .25em .9em; font-size: .8rem; font-weight: 600; }
.clients li {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; height: 96px; padding: 12px 18px;
  display: grid; place-items: center; overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.clients li:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: var(--shadow); }
.clients img { width: 100%; height: 72px; object-fit: contain; mix-blend-mode: multiply; filter: grayscale(1); opacity: .7; transition: filter .25s, opacity .25s; }
.clients button { display: grid; place-items: center; width: 100%; height: 100%; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: inherit; }
.clients button:focus-visible { outline: 3px solid var(--green); outline-offset: 6px; border-radius: 10px; }
.clients li.is-on { border-color: var(--green); box-shadow: var(--shadow); }
.clients li.is-on img { filter: none; opacity: 1; }
.clients li.is-on span { color: var(--accent-text); }
.case[hidden] { display: none; }
.case.case--in { animation: caso-in .35s ease both; }
@keyframes caso-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.clients li:hover img { filter: none; opacity: 1; }
.clients__text span { font-weight: 800; color: #6b7a71; letter-spacing: -.01em; }
.partners { display: grid; gap: 18px; margin-top: 8px; }
.partners__row { display: grid; gap: 8px; }
.partners__label { margin: 0; color: var(--accent-text); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.logos li {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; height: 60px; min-width: 120px; padding: 0 20px;
  display: grid; place-items: center; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.logos li:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: var(--shadow); }
.logos img { height: 30px; width: auto; max-width: 120px; filter: grayscale(1); opacity: .75; transition: filter .25s, opacity .25s; }
.logos li:hover img { filter: none; opacity: 1; }
.logos img.wm { width: 100px; height: auto; }

/* Quiénes somos */
.about { padding: 50px 0 70px; }
.about__in { max-width: 720px; }
.about h2 { margin-bottom: .6em; }
.about p { color: var(--muted); font-size: 1.05rem; }

/* Contacto */
.contact { background: var(--green-dark) url("fondo2.png") center / cover; color: #fff; padding: 80px 0; }
.contact__in { display: grid; gap: 36px; }
.contact h2 { margin-bottom: .5em; }
.contact__data { list-style: none; padding: 0; margin: 1.4em 0 0; display: grid; gap: .5em; }
.contact__data strong { display: inline-block; min-width: 5.5em; opacity: .8; font-weight: 600; }
.contact__data a { font-weight: 600; }
.form { background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 28px; display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; }
.form input[type=text], .form textarea, .form select {
  font: inherit; color: var(--ink); background: var(--bg); padding: .75em .9em; border: 1.5px solid var(--field); border-radius: 10px;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 3px solid rgba(61,200,168,.45); border-color: var(--green); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .btn { justify-self: start; }
.form .btn:disabled { opacity: .6; cursor: wait; transform: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { margin: 0; font-size: .9rem; font-weight: 600; min-height: 1.4em; }
.form__status--ok { color: var(--accent-text); }
.form__status--err { color: #d64545; }

/* Páginas legales */
.top--static { position: static; }
.legal__in { padding: 56px 0 72px; max-width: 780px; }
.legal__in h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-bottom: .2em; }
.legal__upd { color: var(--muted); font-size: .9rem; margin-bottom: 2em; }
.legal__in h2 { font-size: 1.25rem; margin: 2em 0 .6em; }
.legal__in p, .legal__in li { color: var(--muted); }
.legal__in strong { color: var(--ink); }
.legal__in ul { padding-left: 1.2em; }
.legal__in a { color: var(--accent-text); font-weight: 600; }
.legal__table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .9rem; }
.legal__table th, .legal__table td { text-align: left; padding: .7em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal__table th { color: var(--ink); }

/* Pie */
.foot { background: #0b120e; color: #b9c7be; padding: 36px 0; font-size: .85rem; }
.foot__in { display: grid; gap: 10px; }
.foot p { margin: 0; }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; }

@media (max-width: 520px) {
  .top__in { height: 72px; }
  .logo img { height: 40px; }
  .btn--remote { padding: .55em .9em; font-size: .78rem; }
  .btn--remote svg { display: none; }
  .top__actions { gap: 8px; }
  .theme { width: 36px; height: 36px; }
  .hero { padding-top: 130px; }
}
@media (min-width: 760px) {
  .remote__in { grid-template-columns: 1fr auto; gap: 48px; }
  .services .wrap { grid-template-columns: 1fr 1fr; }
  .svc:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; column-gap: 48px; align-items: center; }
  .svc:first-child .svc__tag, .svc:first-child h2, .svc:first-child p { grid-column: 1; }
  .svc:first-child ul { grid-column: 2; grid-row: 1 / span 3; background: var(--bg); border-radius: 14px; padding: 24px; }
  .clients { grid-template-columns: repeat(3, 1fr); }
  .case__cols { grid-template-columns: 1fr 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .flow { grid-template-columns: repeat(4, 1fr); }
  .flow__item:not(:last-child)::after {
    content: ""; position: absolute; top: 46px; right: -17px; width: 18px; height: 2px;
    background: repeating-linear-gradient(90deg, var(--green-light) 0 4px, transparent 4px 8px);
    animation: avance 1s linear infinite;
  }
  .contact__in { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
}
@media (min-width: 1000px) {
  .clients { grid-template-columns: repeat(6, 1fr); }
}
@keyframes avance { to { background-position: 8px 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
