/* ================================================================
   InvTech — styles.css
   Estilo: Consultora / firma profesional (McKinsey · Deloitte)
   Tipografía: Inter
   Paleta: Gris neutro · Blanco · Negro · Acento azul grafito
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ----------------------------------------------------------------
   Tokens
   ---------------------------------------------------------------- */
:root {
  /* Superficies */
  --bg:          #f4f4f2;   /* fondo de página — gris cálido neutro   */
  --bg-2:        #ebebea;   /* hover y depresiones */
  --surface:     #ffffff;   /* tarjetas, header, footer */
  --surface-2:   #f9f9f8;   /* fondo alternativo de superficie */

  /* Bordes */
  --border:      #dddcdb;
  --border-2:    #c9c8c7;   /* bordes enfatizados */

  /* Texto */
  --text:        #111110;   /* títulos — casi negro */
  --text-2:      #3c3c3a;   /* párrafos */
  --text-3:      #6e6e6b;   /* etiquetas, muted, placeholders */
  --text-inv:    #ffffff;

  /* Acento único — azul grafito oscuro (sobrio, no eléctrico) */
  --accent:      #1a3a5c;
  --accent-h:    #142d47;
  --accent-bg:   #eaf0f7;   /* fondo de badge / foco light */

  /* Estados */
  --success:     #1a5c3a;
  --success-bg:  #e8f5ee;
  --danger:      #8b1a1a;
  --danger-bg:   #fdeaea;

  /* Tipografía */
  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --wrap:        min(1160px, 92vw);

  /* Radios — contenidos, no redondeados */
  --r:     4px;
  --r-md:  8px;
  --r-lg:  12px;

  /* Sombras — sutiles */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09), 0 2px 4px rgba(0,0,0,.05);

  /* Transición */
  --t: .16s ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ff);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

/* ----------------------------------------------------------------
   Tipografía
   ---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -.018em;
}

h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); }

h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  margin-bottom: .75rem;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--text);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

p {
  color: var(--text-2);
  line-height: 1.72;
  margin-bottom: 1rem;
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--accent-h); text-decoration: underline; }

strong { font-weight: 600; color: var(--text); }
small  { font-size: .875rem; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ----------------------------------------------------------------
   Layout
   ---------------------------------------------------------------- */
.wrap {
  width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main > .wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-block: 2.25rem 4rem;
}

/* ----------------------------------------------------------------
   Header — línea superior de acento + fondo blanco limpio
   ---------------------------------------------------------------- */
header {
  background: var(--surface);
  border-top: 3px solid var(--accent);   /* firma clásica: raya de color arriba */
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-xs);
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: .95rem;
}

/* Marca */
.brand {
  display: flex;
  align-items: center;
  gap: .875rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-logo {
  width: 150px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
}

.brand-text .text-muted,
.brand-text p {
  font-size: .74rem;
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: .01em;
  margin: .15rem 0 0;
  text-transform: none;
}

/* Nav — sin fondos activos llamativos, solo subrayado */
nav {
  display: flex;
  align-items: center;
  gap: 0;
}

nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-3);
  padding: .55rem 1rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
  margin-bottom: -1px; /* sube al borde del header */
}

nav a:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom-color: var(--border-2);
}

nav a.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* Botón hamburger — mobile */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: .4rem .6rem;
  cursor: pointer;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1;
  transition: background var(--t);
}
.nav-toggle:hover { background: var(--bg-2); }

/* ----------------------------------------------------------------
   Cards — blancas, borde sutil, sin sombra llamativa
   ---------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
}

.card:first-child {
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.card h2:first-child {
  margin-top: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ----------------------------------------------------------------
   Utilidades de texto
   ---------------------------------------------------------------- */
.text-muted    { color: var(--text-3) !important; }
.text-center   { text-align: center; }
.text-primary  { color: var(--accent); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-uppercase {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .75em;
  font-weight: 600;
  color: var(--text-3);
}

/* ----------------------------------------------------------------
   Espaciado
   ---------------------------------------------------------------- */
.mt-2 { margin-top: .5rem; }   .mb-2 { margin-bottom: .5rem; }
.mt-4 { margin-top: 1rem; }    .mb-4 { margin-bottom: 1rem; }
.mt-6 { margin-top: 1.5rem; }  .mb-6 { margin-bottom: 1.5rem; }
.mt-8 { margin-top: 2rem; }    .mb-8 { margin-bottom: 2rem; }
.p-4  { padding: 1rem; }
.p-6  { padding: 1.5rem; }
.w-100 { width: 100%; }

/* ----------------------------------------------------------------
   Botones CTA — directo, sin gradientes
   ---------------------------------------------------------------- */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.2rem;
  border-radius: var(--r);
  font-family: var(--ff);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t), border-color var(--t), color var(--t);
  white-space: nowrap;
  letter-spacing: 0;
}

/* Primario — azul oscuro sólido */
.cta:not(.secondary) {
  background: var(--accent);
  color: var(--text-inv);
  border-color: var(--accent);
}
.cta:not(.secondary):hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
  color: var(--text-inv);
  text-decoration: none;
}

/* Secundario — gris contornado */
.cta.secondary {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border-2);
}
.cta.secondary:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--text-3);
  text-decoration: none;
}

/* ----------------------------------------------------------------
   Stack y Grid
   ---------------------------------------------------------------- */
.stack    { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

/* ----------------------------------------------------------------
   Service items — tarjeta gris sin adorno
   ---------------------------------------------------------------- */
.service-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 1.35rem 1.5rem;
  transition: border-top-color var(--t), box-shadow var(--t);
}

.service-item:hover {
  border-top-color: var(--accent);
  box-shadow: var(--shadow);
}

.service-item strong {
  display: block;
  font-size: .975rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
  letter-spacing: -.01em;
}

.service-item p,
.service-item .text-muted {
  color: var(--text-3) !important;
  font-size: .875rem;
  line-height: 1.55;
  margin: 0;
}

/* ----------------------------------------------------------------
   Casos
   ---------------------------------------------------------------- */
.case-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.1rem;
  transition: box-shadow var(--t);
}

.case-article:hover { box-shadow: var(--shadow-sm); }

.case-article h3 {
  color: var(--text);
  margin: 0 0 .5rem;
  font-size: 1rem;
}

.case-article p {
  color: var(--text-2);
  font-size: .925rem;
  margin-bottom: .5rem;
  line-height: 1.7;
}

.case-article .text-muted {
  color: var(--text-3) !important;
  font-size: .85rem;
}

/* ----------------------------------------------------------------
   Formularios
   ---------------------------------------------------------------- */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  margin-bottom: .375rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: .625rem .875rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-family: var(--ff);
  font-size: .95rem;
  color: var(--text);
  line-height: 1.5;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: var(--text-3);
}

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,58,92,.1);
}

textarea { min-height: 130px; resize: vertical; line-height: 1.65; }

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .625rem 1.5rem;
  background: var(--accent);
  color: var(--text-inv);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  font-family: var(--ff);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t);
}

button[type="submit"]:hover { background: var(--accent-h); border-color: var(--accent-h); }

input:disabled, textarea:disabled, button:disabled { opacity: .5; cursor: not-allowed; }

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

/* ----------------------------------------------------------------
   Alertas
   ---------------------------------------------------------------- */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--r);
  margin-bottom: 1rem;
  font-size: .9rem;
  border: 1px solid;
}

.alert-success {
  background: var(--success-bg);
  border-color: #a3cfb8;
  color: var(--success);
}

.alert-error {
  background: var(--danger-bg);
  border-color: #f5aaaa;
  color: var(--danger);
}

/* ----------------------------------------------------------------
   Listas
   ---------------------------------------------------------------- */
ul.clean { list-style: none; padding-left: 0; }

ul.clean li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: .4rem;
  color: var(--text-2);
  font-size: .95rem;
}

ul.clean li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1rem;
  margin-top: auto;
}

footer .wrap { text-align: center; }
footer small, footer .muted { color: var(--text-3); font-size: .875rem; }

/* ----------------------------------------------------------------
   Tablas
   ---------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1rem 0; }

th, td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }

th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
  font-size: .775rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

td { color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ----------------------------------------------------------------
   Badges
   ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-blue    { background: var(--accent-bg);  color: var(--accent); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }

/* ----------------------------------------------------------------
   Código
   ---------------------------------------------------------------- */
code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: .85em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .12rem .38rem;
  color: var(--text);
}

pre {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: .875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   Helpers
   ---------------------------------------------------------------- */
.d-flex                  { display: flex; }
.flex-column             { flex-direction: column; }
.align-items-center      { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }

.border        { border: 1px solid var(--border); }
.border-top    { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }

.bg-white  { background: var(--surface); }
.bg-subtle { background: var(--surface-2); }
.bg-muted  { background: var(--bg); }
.bg-primary{ background: var(--accent); color: var(--text-inv); }

.font-weight-bold   { font-weight: 600; }
.font-weight-normal { font-weight: 400; }

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  nav a { padding: .55rem .75rem; font-size: .85rem; }
  .card { padding: 1.75rem 1.5rem; }
}

@media (max-width: 640px) {
  /* Header apilado */
  header .wrap {
    flex-wrap: wrap;
    align-items: center;
    padding-block: .75rem;
    gap: .5rem;
  }

  .brand { flex: 1 1 auto; }

  .brand-logo { width: 110px; height: 38px; }

  .brand-text h1 { font-size: 1rem; }

  /* Mostrar hamburger */
  .nav-toggle { display: flex; }

  /* Nav colapsada */
  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid var(--border);
    padding: .25rem 0;
    gap: 0;
    margin-bottom: -.95rem; /* compensa padding-block del wrap */
  }

  nav.open { display: flex; }

  nav a {
    width: 100%;
    padding: .75rem .25rem;
    border-bottom: 1px solid var(--border);
    border-left: none;
    border-right: none;
    font-size: .95rem;
    border-bottom-width: 1px;  /* elimina el underline de hover */
  }

  nav a:last-child { border-bottom: none; }

  nav a.active {
    border-bottom-color: var(--border);
    border-left: 3px solid var(--accent);
    padding-left: calc(.25rem - 3px);
  }

  /* Cards */
  .card {
    padding: 1.35rem 1.1rem;
    border-radius: var(--r-md);
  }

  .card:first-child {
    border-left: none;
    border-top: 2px solid var(--accent);
    border-radius: var(--r-md);
  }

  /* Grid a 1 col */
  .grid { grid-template-columns: 1fr; }

  /* Botones full-width */
  .cta { width: 100%; }

  /* Tipografía */
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }

  /* Espaciado de página */
  main > .wrap {
    padding-block: 1.25rem 3rem;
    gap: 1rem;
  }

  /* Formularios */
  input[type="text"],
  input[type="email"],
  textarea { font-size: 16px; } /* evita zoom en iOS */
}

/* ----------------------------------------------------------------
   Print y motion
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}

@media print {
  body { background: white; }
  header, footer, .cta, .nav-toggle { display: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}



/* Añade estas mejoras al final de tu archivo CSS existente */

/* Mejoras de accesibilidad */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Scroll suave para toda la página */
html {
    scroll-behavior: smooth;
}

/* Mejor contraste para enlaces */
a:focus-visible {
    text-decoration: underline;
    outline: none;
}

/* Animaciones para feedback visual */
.card, .service-item, .case-article {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Mejor responsive para tablas */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: var(--r-md);
    }
    
    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        text-align: left;
        color: var(--text);
    }
}

/* Optimizaciones de rendimiento */
img {
    content-visibility: auto;
}

/* Mejor experiencia en móvil para inputs */
@media (max-width: 640px) {
    input, select, textarea {
        font-size: 16px !important; /* Previene zoom en iOS */
    }
}

/* Animación de carga suave */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}