/* ============================================================
   FLEX CONSULTORA — estilos del sitio (identidad clara/corporativa)
   Tokens y componentes portados del design system y del mockup de Home.
   Fuente de tokens: docs/_ds_flex/colors_and_type.css
   ============================================================ */

:root {
  --green: #5B9E74; --teal: #2D7A8C; --blue: #1B5580; --navy: #163668;
  --grad: linear-gradient(135deg, #5B9E74 0%, #2D7A8C 40%, #1B5580 70%, #163668 100%);
  --grad-h: linear-gradient(90deg, #5B9E74, #163668);
  --orange: #D96E38;
  --n0: #FFFFFF; --n50: #F6F7F8; --n100: #ECEEF1; --n200: #D4D8DE; --n300: #B0B8C3;
  --n400: #8791A0; --n500: #5E6B7A; --n600: #404D5C; --n700: #2C3742; --n800: #1C252E; --n900: #0F161C;
  --radius-sm: 2px; --radius-md: 4px; --radius-lg: 8px; --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(15,22,28,.08), 0 1px 2px rgba(15,22,28,.04);
  --shadow-md: 0 4px 12px rgba(15,22,28,.10), 0 2px 4px rgba(15,22,28,.06);
  --shadow-lg: 0 8px 24px rgba(15,22,28,.12), 0 4px 8px rgba(15,22,28,.08);
  --shadow-brand: 0 4px 20px rgba(27,85,128,.25);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  color: #1C252E;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

/* Accesibilidad: salto al contenido (visible solo al recibir foco con Tab) */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 200; background: var(--navy); color: #fff; padding: 10px 18px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; transition: top .15s; }
.skip-link:focus { top: 8px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 40px; }
section { padding: 96px 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.overline { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 18px; }
.overline::before { content: ''; width: 24px; height: 2px; background: var(--grad-h); border-radius: 1px; }

/* BOTONES */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: 'Poppins', sans-serif; font-weight: 600; cursor: pointer; border: none; transition: .15s; }
.btn-grad { background: var(--grad); color: #fff; padding: 10px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-brand); font-size: 14px; }
.btn-grad:hover { filter: brightness(1.08); box-shadow: 0 6px 24px rgba(27,85,128,.35); }
.btn-grad.lg { padding: 14px 30px; font-size: 15px; }
.btn-outline { background: transparent; color: var(--blue); padding: 12px 24px; border-radius: var(--radius-md); border: 1.5px solid var(--blue); font-size: 15px; }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-white { background: #fff; color: var(--navy); padding: 15px 32px; border-radius: var(--radius-md); font-size: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.btn-white:hover { filter: brightness(.97); }
.btn-wa svg { width: 18px; height: 18px; }

/* NAV */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--n100); transition: box-shadow .2s; }
nav.scrolled { box-shadow: var(--shadow-md); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 40px; display: block; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--n600); padding: 8px 14px; border-radius: var(--radius-md); transition: .15s; }
.nav-link:hover { color: var(--blue); background: var(--n50); }

/* HERO */
#hero { min-height: 100vh; display: flex; align-items: center; background: var(--n50); padding-top: 68px; position: relative; overflow: hidden; }
.hero-shape { position: absolute; right: -80px; top: 50%; transform: translateY(-50%); width: 560px; height: 560px; opacity: .06; background: var(--grad); clip-path: polygon(20% 0,80% 0,100% 20%,100% 80%,80% 100%,20% 100%,0 80%,0 20%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 70px; align-items: center; position: relative; }
.hero-title { font-weight: 800; font-size: 60px; line-height: 1.06; letter-spacing: -.02em; color: var(--n900); margin-bottom: 22px; }
.hero-body { font-size: 18px; line-height: 1.65; color: var(--n500); margin-bottom: 34px; max-width: 500px; }
.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 46px; padding-top: 30px; border-top: 1px solid var(--n200); }
.stat-v { font-weight: 800; font-size: 34px; line-height: 1; color: var(--n900); }
.stat-l { font-size: 13px; color: var(--n400); margin-top: 6px; }
.hero-card { background: #fff; border: 1px solid var(--n200); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 30px; }
.hero-card-top { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--n100); margin-bottom: 18px; }
.hero-card-dot { width: 34px; height: 34px; border-radius: var(--radius-md); background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
.hero-card-dot svg { width: 18px; height: 18px; }
.hero-card-title { font-weight: 600; font-size: 14px; color: var(--n800); }
.hero-card-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; font-size: 14px; }
.hero-card-row + .hero-card-row { border-top: 1px dashed var(--n100); }
.hero-card-row .k { color: var(--n600); }
.hero-card-row .v { font-weight: 600; color: var(--navy); }
.tag-ok { font-size: 11px; font-weight: 600; color: var(--green); background: rgba(91,158,116,.12); padding: 3px 9px; border-radius: var(--radius-pill); }

/* SECTION HEADERS */
.sec-head { max-width: 680px; margin-bottom: 54px; }
.sec-title { font-weight: 700; font-size: 38px; line-height: 1.15; letter-spacing: -.015em; color: var(--n900); margin-bottom: 14px; }
.sec-sub { font-size: 18px; color: var(--n500); }

/* QUÉ HACEMOS */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #fff; border: 1px solid var(--n200); border-radius: var(--radius-lg); padding: 30px; transition: .2s; box-shadow: var(--shadow-sm); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-ic { width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--n50); border: 1px solid var(--n100); display: flex; align-items: center; justify-content: center; color: var(--blue); margin-bottom: 20px; }
.card-ic svg { width: 22px; height: 22px; }
.card h3 { font-weight: 600; font-size: 20px; color: var(--n900); margin-bottom: 10px; }
.card p { font-size: 15px; color: var(--n500); line-height: 1.6; }

/* MESH (sección destacada, navy) */
#mesh { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.mesh-shape { position: absolute; left: -120px; bottom: -120px; width: 420px; height: 420px; opacity: .16; background: var(--grad); border-radius: 50%; }
.mesh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; position: relative; }
.mesh-grid .overline { color: #8FC9A6; }
.mesh-title { font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -.015em; margin-bottom: 18px; }
.mesh-body { font-size: 17px; line-height: 1.7; color: #C6D2E0; margin-bottom: 28px; }
.mesh-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #fff; border-bottom: 2px solid var(--green); padding-bottom: 3px; }
.mesh-link svg { width: 18px; height: 18px; }
.mesh-threads { display: flex; flex-direction: column; gap: 14px; }
.thread { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10); border-radius: var(--radius-lg); padding: 16px 18px; }
.thread-ic { width: 38px; height: 38px; flex: none; border-radius: var(--radius-md); background: var(--grad); display: flex; align-items: center; justify-content: center; color: #fff; }
.thread-ic svg { width: 19px; height: 19px; }
.thread-t { font-weight: 600; font-size: 15px; }
.thread-d { font-size: 13px; color: #9FB0C4; margin-top: 2px; }

/* POR QUÉ */
#porque { background: var(--n50); }
.porque-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: center; }
.porque-body { font-size: 19px; line-height: 1.7; color: var(--n600); }
.porque-body strong { color: var(--navy); font-weight: 600; }

/* SECTORES */
.sectores { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.sector { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; color: var(--n700); background: #fff; border: 1px solid var(--n200); border-radius: var(--radius-pill); padding: 11px 20px; }
.sector svg { width: 17px; height: 17px; color: var(--teal); }

/* CTA */
#cta { background: var(--grad); color: #fff; text-align: center; }
.cta-title { font-weight: 700; font-size: 40px; line-height: 1.15; letter-spacing: -.015em; margin-bottom: 16px; max-width: 760px; margin-left: auto; margin-right: auto; }
.cta-sub { font-size: 18px; color: rgba(255,255,255,.9); margin-bottom: 32px; }

/* FORMULARIO (lead / contacto) */
.form { display: grid; gap: 18px; max-width: 620px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--n600); margin-bottom: 7px; }
.field input, .field textarea { width: 100%; background: var(--n50); border: 1px solid var(--n200); border-radius: var(--radius-md); color: var(--n900); font-family: 'Poppins', sans-serif; font-size: 15px; padding: 11px 13px; outline: none; transition: .15s; }
.field input:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,85,128,.15); }
.field textarea { resize: vertical; min-height: 110px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--color-danger, #D94F45); box-shadow: 0 0 0 3px rgba(217,79,69,.15); }
.field-error { display: block; font-size: 13px; color: #C13B32; margin-top: 6px; }

/* Indicador "Enviando…" mientras HTMX procesa */
.htmx-indicator { opacity: 0; transition: opacity .15s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Mensaje de éxito tras enviar el lead */
.lead-ok { display: flex; gap: 16px; align-items: flex-start; padding: 24px; background: rgba(91,158,116,.08); border: 1px solid rgba(91,158,116,.35); border-radius: var(--radius-lg); }
.lead-ok-ic { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.lead-ok-ic svg { width: 22px; height: 22px; }
.lead-ok-t { font-weight: 600; font-size: 18px; color: var(--n900); margin-bottom: 6px; }
.lead-ok-p { font-size: 15px; color: var(--n600); line-height: 1.6; }
.lead-ok-p a { color: var(--blue); font-weight: 600; }

/* PÁGINAS LEGALES / CONTENIDO SIMPLE */
.page-head { background: var(--n50); padding: 132px 0 56px; border-bottom: 1px solid var(--n100); }
.page-title { font-weight: 800; font-size: 44px; letter-spacing: -.02em; color: var(--n900); }
.page-lead { font-size: 18px; color: var(--n500); margin-top: 14px; max-width: 640px; }
.prose { max-width: 760px; }
.prose h2 { font-weight: 700; font-size: 24px; color: var(--n900); margin: 36px 0 12px; }
.prose p { font-size: 16px; color: var(--n600); margin-bottom: 14px; }

/* FOOTER */
footer { background: var(--n900); color: var(--n400); padding: 56px 0 36px; }
.foot-grid { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 30px; padding-bottom: 32px; border-bottom: 1px solid var(--n800); }
.foot-logo { height: 36px; display: block; margin-bottom: 4px; }
.foot-tag { font-size: 14px; margin-top: 8px; max-width: 280px; color: var(--n500); }
.foot-cols { display: flex; gap: 56px; }
.foot-col h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--n500); margin-bottom: 14px; }
.foot-col a { display: block; font-size: 14px; color: var(--n300); margin-bottom: 9px; }
.foot-col a:hover { color: #fff; }
.foot-bottom { padding-top: 24px; font-size: 13px; color: var(--n600); }

/* RESPONSIVE */
@media (max-width: 880px) {
  .container { padding: 0 22px; }
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .hero-grid, .mesh-grid, .porque-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-title { font-size: 42px; }
  .hero-card { order: 2; }
  .cards { grid-template-columns: 1fr; }
  .sec-title, .mesh-title, .cta-title { font-size: 30px; }
  .hero-stats { gap: 24px; }
  .frow { grid-template-columns: 1fr; }
  .page-title { font-size: 32px; }
}
