/* =============================================================
   ERPCauce — landing estática
   Dirección visual: "el cauce del negocio" — cálido, editorial,
   confiado. Serif con carácter (Fraunces) + sans humanista (Karla).
   Índigo dominante + acento ámbar. Nada de tarjetas genéricas
   repetidas: insignias tipográficas, composición asimétrica.
   ============================================================= */

:root {
  --ink: #201c16;
  --ink-soft: #4a4438;
  --muted: #756c5c;
  --cream: #fbf6ee;
  --cream-deep: #f3ead9;
  --paper: #ffffff;
  --border: #e8ddc7;

  --indigo: #4f46e5;
  --indigo-deep: #332e8f;
  --indigo-ink: #24215e;
  --amber: #f5940e;
  --amber-deep: #b45309;
  --success: #0f7a52;
  --danger: #c23b2f;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --shadow-card: 0 1px 2px rgba(32, 28, 22, 0.06), 0 8px 24px -12px rgba(32, 28, 22, 0.18);
  --shadow-pop: 0 20px 45px -20px rgba(51, 46, 143, 0.45);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Karla", "Segoe UI", sans-serif;

  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
}

/* ---------- utilidades ---------- */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--indigo-deep);
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--indigo);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 150ms ease-out;
}

.skip-link:focus {
  top: 16px;
}

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

/* ---------- botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out, background-color 150ms ease-out;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--amber);
  color: #221200;
  box-shadow: 0 10px 24px -10px rgba(245, 148, 14, 0.65);
}

.btn-primary:hover {
  background: #ffa733;
}

.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: var(--indigo-deep);
}

.btn-outline:hover {
  background: rgba(79, 70, 229, 0.08);
}

.btn-ghost-onindigo {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-ghost-onindigo:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-block {
  width: 100%;
}

@media (max-width: 640px) {
  .btn {
    min-height: 52px;
  }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms, border-color 150ms;
}

.main-nav a:hover {
  color: var(--indigo);
  border-color: var(--amber);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions .btn-primary {
  display: none;
}

@media (min-width: 900px) {
  .header-actions .btn-primary {
    display: inline-flex;
  }
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--paper);
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--cream);
  padding: 8px 0 20px;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 14px 24px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}

.mobile-nav .btn {
  margin: 16px 24px 0;
}

@media (min-width: 900px) {
  .main-nav {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
  .mobile-nav {
    display: none !important;
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 96px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 640px;
  background: radial-gradient(ellipse at top left, rgba(79, 70, 229, 0.16), transparent 60%);
  z-index: -1;
}

.hero .wrap {
  display: grid;
  gap: 56px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  margin-top: 18px;
}

.hero-copy .lede {
  margin-top: 22px;
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-note {
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}

.hero-note strong {
  color: var(--ink-soft);
}

/* ---------- ilustración del cauce (CSS/SVG propio, sin fotos/IA) ---------- */

.hero-illustration {
  position: relative;
  min-height: 380px;
}

.cauce-river {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cauce-river path {
  animation: cauce-flow 14s linear infinite;
  stroke-dasharray: 14 10;
}

@keyframes cauce-flow {
  to {
    stroke-dashoffset: -240;
  }
}

.floaters {
  position: relative;
  z-index: 1;
  height: 100%;
}

.float-card {
  position: absolute;
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  width: 220px;
  animation: float-bob 6s ease-in-out infinite;
}

.float-card.card-a {
  top: 0;
  left: 4%;
  transform: rotate(-4deg);
}

.float-card.card-b {
  top: 46%;
  right: 0;
  width: 200px;
  transform: rotate(3deg);
  animation-delay: 1.2s;
}

.float-card.card-c {
  bottom: -4%;
  left: 18%;
  width: 190px;
  transform: rotate(-2deg);
  animation-delay: 2.4s;
}

@keyframes float-bob {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-10px) rotate(var(--rot, 0deg));
  }
}

.float-card .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.float-card .value {
  font-family: var(--font-display);
  font-size: 22px;
  margin-top: 4px;
  color: var(--ink);
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 44px;
  margin-top: 10px;
}

.mini-bars span {
  flex: 1;
  background: var(--indigo);
  border-radius: 3px 3px 0 0;
  opacity: 0.85;
}

.mini-bars span:nth-child(2) {
  background: var(--amber);
}

.pill-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
}

.pill-ok .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.hero-illustration-caption {
  position: absolute;
  bottom: -34px;
  left: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .hero-illustration {
    min-height: 300px;
  }
  .float-card {
    width: 46vw;
    padding: 12px 14px;
  }
}

/* ---------- secciones genéricas ---------- */

section {
  padding: 88px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-top: 14px;
}

.section-head .lede {
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-soft);
}

.section-alt {
  background: var(--indigo-ink);
  color: #f4f1ff;
}

.section-alt .eyebrow {
  color: #c9c3ff;
}

.section-alt .section-head .lede {
  color: #d6d2f7;
}

/* ---------- problema → solución ---------- */

.pain-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.pain-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.pain-row .num {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--amber-deep);
}

.pain-row h3 {
  font-size: 19px;
  font-weight: 700;
  font-family: var(--font-body);
}

.pain-row p {
  margin-top: 6px;
  color: var(--ink-soft);
}

@media (min-width: 720px) {
  .pain-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
  }
  .pain-row:nth-child(odd) {
    border-right: 1px solid var(--border);
    padding-right: 20px;
  }
  .pain-row:nth-child(even) {
    padding-left: 20px;
  }
}

/* ---------- badges tipográficos (módulos / agentes) ---------- */

.badge-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

@media (min-width: 720px) {
  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .badge-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.badge-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 24px;
  background: var(--paper);
}

.badge-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
}

.badge-cell h3 {
  margin-top: 16px;
  font-size: 17px;
  font-family: var(--font-body);
  font-weight: 700;
}

.badge-cell p {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

/* paleta rotativa para las insignias (índigo/ámbar/tinta), sin depender de íconos */
.badge-mark.tone-0 {
  background: var(--indigo);
}
.badge-mark.tone-1 {
  background: var(--amber-deep);
}
.badge-mark.tone-2 {
  background: var(--indigo-ink);
}

/* ---------- agentes de IA (sobre fondo índigo) ---------- */

.agent-list {
  display: grid;
  gap: 22px;
}

@media (min-width: 720px) {
  .agent-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .agent-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.agent-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 26px;
}

.agent-card .badge-mark {
  background: var(--amber);
  color: #221200;
}

.agent-card h3 {
  margin-top: 18px;
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 700;
  color: #fff;
}

.agent-card .modulo {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c9c3ff;
}

.agent-card p {
  margin-top: 10px;
  color: #d6d2f7;
  font-size: 14.5px;
}

.confirm-note {
  margin-top: 40px;
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 14.5px;
  color: #f4f1ff;
  max-width: 62ch;
}

/* ---------- diferenciadores ---------- */

.diff-strip {
  display: grid;
  gap: 28px;
}

@media (min-width: 720px) {
  .diff-strip {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .diff-strip {
    grid-template-columns: repeat(5, 1fr);
  }
}

.diff-item h3 {
  margin-top: 14px;
  font-size: 16px;
  font-family: var(--font-body);
  font-weight: 700;
}

.diff-item p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.diff-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cream-deep);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.diff-mark svg {
  width: 20px;
  height: 20px;
  color: var(--indigo);
}

/* ---------- precios ---------- */

.pricing-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 860px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.plan {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.plan.is-featured {
  border-color: var(--indigo);
  box-shadow: var(--shadow-pop);
  background: linear-gradient(180deg, #fff 0%, #f6f5ff 100%);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 28px;
  background: var(--indigo);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
}

.plan h3 {
  font-size: 20px;
  font-family: var(--font-body);
  font-weight: 800;
}

.plan .price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 14px;
}

.plan .price .amount {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 40px);
  white-space: nowrap;
}

.plan .price .period {
  font-size: 13px;
  color: var(--muted);
}

.plan ul {
  margin-top: 22px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.plan li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
}

.plan li svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--success);
}

.plan .btn {
  margin-top: 26px;
}

/* ---------- FAQ ---------- */

.faq-list {
  max-width: 760px;
  border-top: 1px solid var(--border);
}

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

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  cursor: pointer;
}

.faq-question svg {
  flex: none;
  width: 20px;
  height: 20px;
  transition: transform 200ms ease-out;
  color: var(--indigo);
}

.faq-question[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease-out;
}

.faq-answer[data-open="true"] {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-answer p {
  padding: 0 4px 22px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- CTA final / formulario ---------- */

.demo-section {
  background: var(--cream-deep);
}

.demo-panel {
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
}

.demo-panel h2 {
  font-size: 1.8rem;
  text-align: center;
}

.demo-panel > p {
  text-align: center;
  margin-top: 12px;
  color: var(--ink-soft);
}

.field {
  margin-top: 20px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--cream);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ink);
}

.field input:focus-visible {
  border-color: var(--indigo);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--danger);
  font-weight: 600;
}

.demo-panel .btn {
  margin-top: 26px;
}

.demo-success {
  text-align: center;
}

.demo-success .check-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: rgba(15, 122, 82, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-success svg {
  width: 28px;
  height: 28px;
  color: var(--success);
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--indigo-ink);
  color: #d6d2f7;
  padding: 56px 0 32px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .brand {
  color: #fff;
}

.footer-brand p {
  margin-top: 12px;
  font-size: 14px;
  color: #b9b3ea;
}

.footer-cols {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}

.footer-col ul {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.footer-col a {
  text-decoration: none;
  font-size: 14.5px;
  color: #cfc9f4;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 13px;
  color: #a79ee0;
}

/* ---------- páginas legales ---------- */

.legal-page main {
  padding: 64px 0 96px;
}

.legal-page .wrap {
  max-width: 760px;
}

.legal-page h1 {
  font-size: 2.2rem;
}

.legal-page .updated {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.legal-draft-notice {
  margin-top: 28px;
  padding: 16px 20px;
  background: #fff7e6;
  border: 1px solid #f3d99a;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: #7a4a06;
}

.legal-page h2 {
  font-size: 1.3rem;
  margin-top: 40px;
}

.legal-page p,
.legal-page li {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.legal-page ul {
  margin-top: 12px;
  padding-left: 20px;
  list-style: disc;
}

.legal-page a.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-weight: 700;
  color: var(--indigo-deep);
  text-decoration: none;
}
