/* ==========================================================================
   Integrum ERP — Landing page
   Tokens alineados con la app (Integrum/style.md, Main.scss)
   ========================================================================== */

:root {
  --primary: #1565c0;
  --primary-hover: #0d4f9e;
  --accent: #35baf6;
  --on-primary: #ffffff;

  --canvas: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --text: #131c26;
  --text-muted: #4f5d6c;
  --border: #dbe2ea;
  --success: #2e7d32;
  --warn: #ef8f00;
  --danger: #c62828;

  --nav-dark: #32404e;
  --band-dark: #1e1e2f;

  /* Colores del logo */
  --g-magenta: #e6007e;
  --g-orange: #f39200;
  --g-green: #5cb531;
  --g-blue: #0096d6;
  --brand-gradient: linear-gradient(120deg, var(--g-magenta), var(--g-orange) 35%, var(--g-green) 65%, var(--g-blue));

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(19, 28, 38, .06), 0 8px 24px rgba(19, 28, 38, .08);
  --shadow-lg: 0 24px 60px rgba(19, 28, 38, .18);
  --header-h: 68px;

  color-scheme: light;
}

[data-theme="dark"] {
  --primary: #64b5f6;
  --primary-hover: #90caf9;
  --on-primary: #0d1219;
  --canvas: #0d1219;
  --surface: #171f27;
  --surface-2: #121920;
  --text: #e6edf3;
  --text-muted: #9fb0c0;
  --border: #26323e;
  --success: #66bb6a;
  --band-dark: #0a0f15;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ----- Base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(820px, 100% - 40px); }

.material-symbols-rounded { font-size: 24px; line-height: 1; user-select: none; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary);
  padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.grad-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; border-radius: 999px;
  padding: 10px 22px;
  transition: background-color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px rgba(21, 101, 192, .3); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 7px 16px; font-size: .92rem; }
.btn.full { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 1.2rem; }
.brand strong { font-weight: 900; }
.main-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.main-nav a:not(.btn) { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.main-nav a:not(.btn):hover { color: var(--primary); }
.header-tools { display: flex; gap: 8px; }
.nav-toggle { display: none; }

[data-theme="dark"] .icon-dark,
:root:not([data-theme="dark"]) .icon-light { display: none; }

/* ----- Hero ----- */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero-glow {
  position: absolute; inset: -30% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: var(--brand-gradient); filter: blur(120px); opacity: .18; border-radius: 50%; pointer-events: none;
}
[data-theme="dark"] .hero-glow { opacity: .22; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 900; letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--text-muted); }
.lead strong { color: var(--text); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.hero-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hero-checks li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); }
.hero-checks .material-symbols-rounded { color: var(--success); font-size: 22px; margin-top: 2px; }

/* Mockup */
.hero-visual { position: relative; }
.mock-window {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
}
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-bar i:nth-child(1) { background: #ff5f57; } .mock-bar i:nth-child(2) { background: #febc2e; } .mock-bar i:nth-child(3) { background: #28c840; }
.mock-bar span { margin-left: 12px; font-size: .72rem; color: var(--text-muted); background: var(--surface); padding: 2px 12px; border-radius: 999px; border: 1px solid var(--border); }
.mock-body { display: grid; grid-template-columns: 52px 1fr; min-height: 340px; }
.mock-side { background: var(--nav-dark); display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 14px 0; color: #9fb0c0; }
[data-theme="dark"] .mock-side { background: #1e1e2f; }
.mock-side .material-symbols-rounded { font-size: 20px; }
.mock-side .active { color: #fff; background: rgba(53, 186, 246, .25); border-radius: 8px; padding: 5px; }
.mock-main { padding: 16px; display: grid; gap: 14px; align-content: start; }
.mock-title { font-weight: 700; font-size: .95rem; }
.mock-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; display: grid; gap: 2px; }
.kpi small { font-size: .62rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { font-size: 1rem; }
.kpi em { font-style: normal; font-size: .62rem; font-weight: 700; }
.kpi .up, .kpi .down-good { color: var(--success); }
.kpi .up-bad { color: var(--warn); }
.mock-chart { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.mock-chart svg { width: 100%; height: 110px; display: block; }
.mock-chart .bars rect { fill: var(--primary); opacity: .25; }
.mock-chart .line { fill: none; stroke: var(--g-magenta); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mock-rows { display: grid; gap: 6px; }
.mock-rows div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; font-size: .7rem; color: var(--text-muted); }
.mock-rows span { height: 7px; border-radius: 4px; background: var(--border); }
.mock-rows em { font-style: normal; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.ok { background: var(--success); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); }
.mock-toast {
  position: absolute; left: -28px; bottom: -26px;
  display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--g-orange);
  border-radius: var(--radius-sm); padding: 10px 14px; box-shadow: var(--shadow);
  max-width: 300px; animation: float 5s ease-in-out infinite;
}
.mock-toast .material-symbols-rounded { color: var(--g-orange); }
.mock-toast b { display: block; font-size: .85rem; }
.mock-toast small { font-size: .74rem; color: var(--text-muted); }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ----- Sections ----- */
.section { padding: 96px 0; }
.section.alt { background: var(--surface-2); border-block: 1px solid var(--border); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 10px;
}
.section-title { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 900; letter-spacing: -.01em; margin-bottom: 40px; max-width: 760px; }

/* Problema */
.problem .section-title { text-align: center; margin-inline: auto; }
.pain-list { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 14px; }
.pain-list li {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
}
.pain-list .material-symbols-rounded { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); padding: 8px; border-radius: 10px; }
.pain-list p { margin: 0; align-self: center; }
.problem-answer { text-align: center; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 900; margin: 0; }

/* Cards de módulos */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--text-muted); font-size: .97rem; }
.card ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: .94rem; display: grid; gap: 6px; }
.card ul strong, .card p strong { color: var(--text); }
.card-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; margin-bottom: 16px;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.card-featured { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--brand-gradient) border-box; }

/* Pasos */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; counter-reset: step; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 32px; left: 8%; right: 8%; height: 3px;
  background: var(--brand-gradient); opacity: .5; border-radius: 3px;
}
.steps li { position: relative; text-align: center; counter-increment: step; }
.step-icon {
  position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--primary); color: var(--primary); margin-bottom: 14px; font-size: 28px;
}
.steps li::after {
  content: counter(step); position: absolute; top: -4px; left: calc(50% + 18px);
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
  font-size: .75rem; font-weight: 700; display: grid; place-items: center;
}
.steps h3 { font-size: 1.05rem; margin-bottom: 6px; }
.steps p { font-size: .9rem; color: var(--text-muted); margin: 0; }

/* Seguridad (banda oscura) */
.dark-band { background: var(--band-dark); color: #e6edf3; }
.dark-band .eyebrow { color: var(--accent); }
.dark-band .lead { color: #9fb0c0; }
.security-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: start; }
.security-grid > div:first-child { position: sticky; top: calc(var(--header-h) + 32px); }
.sec-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sec-list li { display: flex; gap: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 18px; }
.sec-list .material-symbols-rounded { color: var(--accent); }
.sec-list b { display: block; margin-bottom: 4px; }
.sec-list p { margin: 0; color: #9fb0c0; font-size: .92rem; }

/* Por qué */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.why { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.why .material-symbols-rounded { font-size: 32px; margin-bottom: 10px; }
.why:nth-child(6n+1) .material-symbols-rounded { color: var(--g-blue); }
.why:nth-child(6n+2) .material-symbols-rounded { color: var(--g-magenta); }
.why:nth-child(6n+3) .material-symbols-rounded { color: var(--g-orange); }
.why:nth-child(6n+4) .material-symbols-rounded { color: var(--g-green); }
.why:nth-child(6n+5) .material-symbols-rounded { color: var(--primary); }
.why:nth-child(6n+6) .material-symbols-rounded { color: var(--accent); }
.why h3 { font-size: 1.1rem; }
.why p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* Para quién */
.who-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.who { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.who .material-symbols-rounded { color: var(--primary); font-size: 30px; margin-bottom: 10px; }
.who h3 { font-size: 1.08rem; }
.who p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.industries { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.industries > span { font-weight: 700; }
.industries ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.industries li { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }

/* Integraciones */
.int-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.int {
  display: grid; justify-items: center; text-align: center; gap: 6px;
  padding: 26px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.int .material-symbols-rounded { font-size: 34px; color: var(--primary); margin-bottom: 4px; }
.int small { color: var(--text-muted); }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 22px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-weight: 500; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); padding-bottom: 18px; margin: 0; }

/* CTA final */
.cta-band { position: relative; overflow: hidden; background: var(--band-dark); color: #e6edf3; }
.cta-band::before {
  content: ""; position: absolute; inset: 0; background: var(--brand-gradient); opacity: .14; pointer-events: none;
}
.cta-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.cta-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 900; }
.cta-copy .lead { color: #b5c3d1; }
.demo-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-lg);
}
.field { display: grid; gap: 6px; }
.field.full, .demo-form .btn.full, .form-status { grid-column: 1 / -1; }
.field label { font-size: .88rem; font-weight: 500; }
.field input, .field select, .field textarea {
  font: inherit; font-size: .97rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.4em; font-size: .92rem; }
.form-status.ok { color: var(--success); }
.form-status.err { color: var(--danger); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: center; }
.footer-brand p { margin: 8px 0 0; color: var(--text-muted); font-size: .92rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: var(--primary); }
.copyright { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border); padding-top: 20px; }

/* Animación de entrada */
/* Solo se oculta si hay JS (boot.js agrega .js); sin JS el contenido es visible */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ----- Responsive ----- */
@media (max-width: 1080px) {
  .cards, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .who-grid { grid-template-columns: repeat(2, 1fr); }
  .int-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .steps::before { display: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    padding: 8px 20px 20px; margin: 0;
    transform: translateY(-120%); visibility: hidden; transition: transform .25s, visibility .25s;
  }
  .main-nav.open { transform: none; visibility: visible; }
  .main-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .main-nav .nav-cta { margin-top: 14px; }
  .header-tools { margin-left: auto; }

  .hero { padding: 48px 0 80px; }
  .hero-inner, .security-grid, .cta-grid { grid-template-columns: 1fr; gap: 48px; }
  .security-grid > div:first-child { position: static; }
  .mock-window { transform: none; }
  .mock-toast { left: 12px; }
  .section { padding: 72px 0; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .cards, .why-grid, .who-grid, .sec-list, .demo-form { grid-template-columns: 1fr; }
  .int-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr 1fr; }
  .mock-kpis { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .brand span { font-size: 1.05rem; }
}

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

@media (forced-colors: active) {
  .grad-text { color: CanvasText; background: none; }
  .btn-primary { border-color: ButtonText; }
  .card-featured { border-color: CanvasText; }
}

/* Página 404 */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.notfound img { margin: 0 auto 24px; }
.notfound .section-title { margin-inline: auto; }

/* Evita que el contenido mínimo de los hijos de grid ensanche la página en móvil */
.hero-inner > *, .security-grid > *, .cta-grid > *, .cards > *, .steps > * { min-width: 0; }
