:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --text: #111412;
  --muted: #5e665f;
  --border: #d9dcd7;
  --accent: #0d1830;
  --accent-soft: #e4eadf;
  --green: #2f6b3b;
  --danger: #b42318;
  --focus: #2257f5;
  --brand: #2447e5;
  --ink: #08090a;
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

.page-shell { min-height: calc(100vh - 52px); }


.public-nav {
  min-height: 78px;
  width: min(100% - 40px, 1240px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-size: .9rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-decoration: none;
  text-transform: uppercase;
}

.public-links {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 2.2vw, 30px);
}

.public-links a,
.nav-link,
.text-link {
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.public-links a:hover,
.nav-link:hover,
.text-link:hover { text-decoration: underline; text-underline-offset: 5px; }

.public-actions,
.home-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.button.button-primary { background: var(--brand); color: #fff; }
.button.button-quiet { background: transparent; color: var(--text); border: 1px solid var(--border); }

.home-hero {
  width: min(100% - 40px, 1240px);
  min-height: min(820px, calc(100vh - 78px));
  margin-inline: auto;
  padding: clamp(72px, 9vw, 132px) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .72fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
}

.home-hero-copy { display: grid; justify-items: start; gap: 24px; }

.home-hero h1 {
  max-width: 920px;
  font-size: clamp(3.4rem, 7.7vw, 7.4rem);
  letter-spacing: -.065em;
  line-height: .92;
}

.home-lead {
  max-width: 720px;
  margin: 0;
  color: #424742;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
}

.home-note { max-width: 690px; margin: 0; color: var(--muted); font-size: .94rem; }

.home-system {
  padding: 10px 26px 20px;
  border: 1px solid #d5d9d4;
  border-radius: 28px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 34px 90px rgba(8,9,10,.08);
}

.system-kicker {
  display: block;
  padding: 20px 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.system-node {
  padding: 20px 0;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--border);
  font-weight: 800;
}

.system-node small { color: var(--muted); font-size: .78rem; font-weight: 600; }

.home-band,
.workflow-section,
.split-section,
.global-section,
.trust-section,
.modular-section,
.demo-section {
  padding: clamp(76px, 10vw, 136px) max(20px, calc((100vw - 1240px) / 2));
}

.home-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .7fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: end;
  background: var(--ink);
  color: #f5f5f2;
}

.home-band h2,
.section-intro h2,
.split-section h2,
.global-section h2,
.modular-section h2,
.demo-section h2,
.detail-grid h2 {
  margin: 18px 0 0;
  font-size: clamp(2.35rem, 5vw, 5.2rem);
  letter-spacing: -.055em;
  line-height: .98;
}

.home-band .eyebrow { color: #a1a1aa; }

.silo-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  list-style: none;
  border-top: 1px solid #353638;
}

.silo-list li { padding: 16px 0; border-bottom: 1px solid #353638; color: #d4d4d0; }

.home-section {
  padding: clamp(76px, 10vw, 136px) max(20px, calc((100vw - 1240px) / 2));
  background: #f5f5f2;
  color: var(--text);
}

.section-intro { max-width: 900px; margin-bottom: clamp(44px, 7vw, 82px); }
.section-intro p { max-width: 710px; color: var(--muted); font-size: 1.08rem; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border-top: 1px solid #cfd2ce;
}

.module-grid article {
  grid-column: span 4;
  min-height: 250px;
  padding: 28px 28px 34px 0;
  border-bottom: 1px solid #cfd2ce;
}

.module-grid article:nth-child(3n+2),
.module-grid article:nth-child(3n+3) { padding-left: 28px; border-left: 1px solid #cfd2ce; }
.module-grid article:last-child { grid-column: span 8; }

.module-grid article > span { color: var(--brand); font-size: .75rem; font-weight: 850; }
.module-grid h3 { margin: 74px 0 12px; font-size: 1.55rem; letter-spacing: -.025em; }
.module-grid p { margin: 0; color: var(--muted); }

.workflow-section { background: #fff; }
.workflow { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); list-style: none; }
.workflow li {
  min-height: 170px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-weight: 750;
}
.workflow li:last-child { border-right: 0; }
.workflow span { color: var(--brand); font-size: .75rem; }

.split-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr);
  gap: clamp(48px, 9vw, 130px);
  background: var(--ink);
  color: #f5f5f2;
}
.split-section p { max-width: 620px; color: #b9bbc0; }
.company-flow { display: grid; align-items: center; grid-template-columns: 1fr auto 1fr; gap: 18px; }
.company-flow article { min-height: 220px; padding: 24px; display: grid; align-content: space-between; border: 1px solid #303235; border-radius: 20px; background: #101113; }
.company-flow small,.company-flow span { color: #a1a1aa; }
.company-flow strong { font-size: 1.2rem; }
.flow-arrow { color: #73757a; font-size: 1.5rem; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #fff;
}
.detail-grid article { min-height: 470px; padding: clamp(46px, 7vw, 96px) max(20px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--border); }
.detail-grid article:nth-child(odd) { padding-right: clamp(36px, 6vw, 80px); }
.detail-grid article:nth-child(even) { padding-left: clamp(36px, 6vw, 80px); border-left: 1px solid var(--border); }
.detail-grid h2 { max-width: 620px; font-size: clamp(2rem, 3.7vw, 3.8rem); }
.detail-grid p { max-width: 620px; color: var(--muted); }

.global-section {
  display: grid;
  grid-template-columns: 1fr .8fr;
  gap: clamp(44px, 8vw, 120px);
  align-items: end;
  background: var(--brand);
  color: #fff;
}
.global-section p { max-width: 600px; color: #e1e7ff; font-size: 1.05rem; }

.trust-section { background: #f5f5f2; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #d7dad6; border: 1px solid #d7dad6; }
.trust-grid article { min-height: 260px; padding: 28px; background: #f5f5f2; }
.trust-grid h3 { margin: 88px 0 12px; }
.trust-grid p { margin: 0; color: var(--muted); }

.modular-section { background: #fff; }
.modular-section h2,.modular-section p { max-width: 900px; }
.modular-section p { color: var(--muted); font-size: 1.08rem; }

.demo-section { background: var(--ink); color: #f5f5f2; }
.demo-section h2 { max-width: 900px; }
.demo-section p { max-width: 720px; color: #b9bbc0; font-size: 1.08rem; }
.demo-section .button-quiet { color: #fff; border-color: #484a4e; }

.hero,
.auth-layout {
  min-height: calc(100vh - 52px);
  display: grid;
  place-items: center;
  padding: var(--space-6);
}

.hero {
  text-align: center;
  align-content: center;
  gap: var(--space-4);
}

.hero > * { max-width: 720px; margin-inline: auto; }

h1 { margin: 0; font-size: clamp(2rem, 6vw, 4rem); line-height: 1.02; }

p { line-height: 1.5; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.auth-card {
  width: min(100%, 420px);
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.auth-card h1 { font-size: 2rem; margin-top: var(--space-2); }

.stack { display: grid; gap: var(--space-4); margin-top: var(--space-6); }

label { display: grid; gap: var(--space-2); font-weight: 600; }

input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
}

.alert { padding: var(--space-3); border-radius: var(--radius); margin-top: var(--space-4); }
.alert-error { background: #fff1f0; color: var(--danger); }
.version-line { color: var(--muted); font-size: .8rem; margin: var(--space-6) 0 0; }

.site-footer {
  min-height: 52px;
  padding: 0 var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: .8rem;
  background: var(--accent);
  color: #c8cec8;
  border-color: #333735;
}

.admin-shell { min-height: calc(100vh - 52px); display: grid; grid-template-columns: 240px 1fr; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--space-6);
  display: grid;
  align-content: start;
  gap: var(--space-6);
}

.sidebar nav { display: grid; gap: var(--space-2); }
.sidebar a { min-height: 44px; display: flex; align-items: center; padding: 0 var(--space-3); border-radius: var(--radius); text-decoration: none; }
.sidebar a[aria-current="page"] { background: var(--bg); font-weight: 650; }

.workspace { padding: clamp(24px, 5vw, 64px); }
.workspace h1 { margin-top: var(--space-2); font-size: clamp(2rem, 4vw, 3rem); }

@media (max-width: 860px) {
  .public-nav { grid-template-columns: 1fr auto; gap: 16px; padding: 12px 0; }
  .public-links { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
  .public-actions .button { display: none; }
  .home-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 64px; }
  .home-hero h1 { font-size: clamp(3rem, 12vw, 5.7rem); }
  .home-system { max-width: 560px; }
  .home-band,.split-section,.global-section { grid-template-columns: 1fr; }
  .module-grid article { grid-column: span 6; border-left: 0; padding-left: 0; padding-right: 24px; }
  .module-grid article:nth-child(even) { padding-left: 24px; border-left: 1px solid #cfd2ce; }
  .module-grid article:last-child { grid-column: span 12; }
  .workflow { grid-template-columns: repeat(4, 1fr); }
  .workflow li:nth-child(4n) { border-right: 0; }
  .company-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 560px) {
  .public-nav { width: min(100% - 28px, 1240px); }
  .public-actions { gap: 10px; }
  .home-hero { width: min(100% - 28px, 1240px); }
  .home-hero h1 { font-size: clamp(2.75rem, 14vw, 4.7rem); }
  .home-actions { width: 100%; }
  .home-actions .button { width: 100%; }
  .home-band,.home-section,.workflow-section,.split-section,.global-section,.trust-section,.modular-section,.demo-section { padding-inline: 20px; }
  .module-grid { display: block; }
  .module-grid article,.module-grid article:nth-child(even),.module-grid article:last-child { min-height: 0; padding: 26px 0; border-left: 0; }
  .module-grid h3 { margin-top: 48px; }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .workflow li:nth-child(2n) { border-right: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid article,.detail-grid article:nth-child(odd),.detail-grid article:nth-child(even) { min-height: 0; padding: 64px 20px; border-left: 0; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article { min-height: 220px; }
}


.pricing-page {
  width: min(100% - 40px, 1180px);
  margin-inline: auto;
  padding: clamp(64px, 9vw, 112px) 0;
}

.pricing-heading {
  max-width: 760px;
  display: grid;
  gap: var(--space-4);
  margin-bottom: clamp(40px, 6vw, 72px);
}

.pricing-heading h1 { font-size: clamp(2.8rem, 7vw, 6rem); }
.pricing-heading p { margin: 0; color: var(--muted); font-size: 1.08rem; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

.pricing-card {
  min-height: 330px;
  padding: clamp(24px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.pricing-card h2 { margin: 0; font-size: 1.55rem; }
.pricing-card dl { display: grid; gap: var(--space-3); margin: 0; }
.pricing-card dl div { display: flex; justify-content: space-between; gap: var(--space-4); }
.pricing-card dt { color: var(--muted); }
.pricing-card dd { margin: 0; font-weight: 750; }
.pricing-card .button { margin-top: auto; align-self: start; }

/* Backoffice con la identidad de impacto (etapa 5b): menú navy, titulares a escala, tarjetas con filete y contraste AA. */
.eyebrow { color: var(--muted); }
.admin-shell .sidebar {
  background: var(--accent);
  color: #eef1f8;
  border-right: 0;
}
.admin-shell .sidebar a { color: #c3cbe0; font-weight: 600; transition: background-color .15s ease, color .15s ease; }
.admin-shell .sidebar a:hover { background: rgba(255, 255, 255, .08); color: #ffffff; }
.admin-shell .sidebar a[aria-current="page"] { background: var(--brand); color: #ffffff; font-weight: 700; }
.admin-shell .sidebar a:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.admin-shell .workspace h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: .98; letter-spacing: -.035em; }
.admin-shell .catalog-panel, .admin-shell .catalog-card { border-radius: 10px; border-top: 3px solid var(--brand); }
.admin-shell .button { transition: transform .15s ease, background-color .15s ease; }
.admin-shell .button:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .admin-shell .sidebar a, .admin-shell .button { transition: none; }
}
.admin-shell .sidebar .button { color: #eef1f8; background: transparent; border-color: rgba(238, 241, 248, .55); }
.admin-shell .sidebar .button:hover { background: rgba(255, 255, 255, .12); }
.admin-shell .brand-block strong { color: #ffffff; font-size: 1.05rem; letter-spacing: .02em; }
.admin-shell .brand-block span { color: #a3adc6; }
.admin-shell .foundation-grid article { border-top: 3px solid var(--brand); border-radius: 10px; }
.admin-shell .overview-value { display: block; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.admin-shell .overview-detail { color: var(--muted); }
@media (max-width: 860px) {
  .admin-shell .sidebar { padding: var(--space-4); gap: var(--space-3); }
  .admin-shell .sidebar nav { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); scrollbar-width: thin; }
  .admin-shell .sidebar a { flex: 0 0 auto; white-space: nowrap; }
}

/* Pulido de interfaz (auditoría de diseño, #1428) */
html { -webkit-font-smoothing: antialiased; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
td, th { font-variant-numeric: tabular-nums; }

.button,
input {
  transition-property: background-color, border-color, box-shadow, color, scale;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.button:active { scale: 0.96; }

@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;
  }
}

/* Menú lateral del administrador: acordeón con iconos, filas de 40 px y pie fijo. */
:root {
  --acc-expand: 250ms; --acc-collapse: 250ms; --acc-chevron: 250ms; --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.admin-shell { grid-template-columns: 272px 1fr; -webkit-font-smoothing: antialiased; }
.admin-shell .sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; gap: 0; padding: 0;
  background: var(--accent); color: #eef1f8;
}
.admin-shell .sidebar .brand-block { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-shell .sidebar nav {
  display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; padding: 12px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.admin-shell .sidebar nav > a,
.admin-shell .sidebar .nav-group-head {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 8px;
  border: 0; background: transparent; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.25; letter-spacing: .005em;
  color: #c9d1e6; text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.admin-shell .sidebar .nav-icon { flex: 0 0 auto; opacity: .88; }
.admin-shell .sidebar nav > a:hover,
.admin-shell .sidebar .nav-group-head:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-shell .sidebar .nav-group[data-open="true"] > .nav-group-head { color: #fff; }
.admin-shell .sidebar .t-acc-chevron { margin-left: auto; opacity: .65; }
.admin-shell .sidebar .nav-group-head:hover .t-acc-chevron { opacity: .95; }
.admin-shell .sidebar .t-acc-panel-inner { padding: 2px 0 6px; }
.admin-shell .sidebar a.nav-sub {
  position: relative; display: flex; align-items: center; min-height: 40px; margin: 0 0 1px 21px; padding: 0 12px 0 20px;
  border-radius: 8px; font-size: .86rem; font-weight: 500; color: #aab4cf; text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.admin-shell .sidebar a.nav-sub::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .12);
}
.admin-shell .sidebar a.nav-sub:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-shell .sidebar nav a[aria-current="page"] { background: var(--brand); color: #fff; font-weight: 650; }
.admin-shell .sidebar nav a[aria-current="page"]::before { background: transparent; }
.admin-shell .sidebar nav a:focus-visible,
.admin-shell .sidebar .nav-group-head:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.admin-shell .sidebar form { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }

/* Acordeón (transitions.dev · accordion): altura con grid-template-rows 0fr → 1fr, sin medir. */
.t-acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--acc-collapse) var(--acc-ease); }
.t-acc[data-open="true"] .t-acc-panel { grid-template-rows: 1fr; transition: grid-template-rows var(--acc-expand) var(--acc-ease); }
.t-acc-panel-inner { overflow: hidden; opacity: 0; filter: blur(2px);
  transition: opacity var(--acc-collapse) var(--acc-ease), filter var(--acc-collapse) var(--acc-ease); }
.t-acc[data-open="true"] .t-acc-panel-inner { opacity: 1; filter: blur(0);
  transition: opacity var(--acc-expand) var(--acc-ease), filter var(--acc-expand) var(--acc-ease); }
.t-acc-chevron { display: inline-flex; transform: scaleY(1); transform-origin: center; transition: transform var(--acc-chevron) var(--acc-ease); }
.t-acc-chevron path { vector-effect: non-scaling-stroke; }
.t-acc[data-open="true"] .t-acc-chevron { transform: scaleY(-1); }
@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron { transition: none !important; }
  .admin-shell .sidebar nav > a, .admin-shell .sidebar .nav-group-head, .admin-shell .sidebar a.nav-sub { transition: none; }
}
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-shell .sidebar { position: static; height: auto; }
  .admin-shell .sidebar nav { overflow: visible; padding: 8px 12px 12px; }
}
