/* ============================================================
   Sistema visual — Backtest Audit Landing
   ============================================================ */
:root {
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-accent: #00d4ff;
  --color-accent-green: #00c896;
  --color-red-400: rgba(255, 84, 89, 1);
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: rgba(80, 88, 92, 1);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-border: rgba(94, 82, 64, 0.2);
  --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-64: 64px;
  --radius-base: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02);
  --shadow-lg: 0 18px 45px rgba(19, 52, 59, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(207, 211, 211, 0.72);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-300);
    --color-border: rgba(119, 124, 124, 0.3);
    --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.28);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--color-text);
  background:
    linear-gradient(180deg, rgba(33, 128, 141, 0.05) 0, transparent 520px),
    var(--color-background);
  font-family: var(--font-family-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

/* ============================================================
   Typography
   ============================================================ */
h1,
h2,
h3 {
  color: var(--color-text);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.45rem, 6vw, 5.2rem);
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
}

h3 {
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

p {
  color: var(--color-text-secondary);
}

/* ============================================================
   Layout
   ============================================================ */
section {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: var(--space-64) 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  margin-bottom: var(--space-16);
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.section-header {
  max-width: 760px;
  margin: 0 auto var(--space-48);
  text-align: center;
}

.section-header p:last-child {
  margin-top: var(--space-16);
  font-size: 1.08rem;
}

.section-header.compact {
  margin-bottom: var(--space-32);
}

/* ============================================================
   Buttons / CTAs
   ============================================================ */
.cta-primary,
.cta-secondary,
.text-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-base);
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.cta-primary {
  padding: 0 var(--space-24);
  color: #ffffff;
  background: #007757;
  box-shadow: 0 12px 30px rgba(0, 119, 87, 0.22);
}

.cta-primary:hover {
  transform: translateY(-2px);
  background: #006851;
}

.cta-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cta-primary.muted {
  background: var(--color-primary);
}

.cta-secondary {
  padding: 0 var(--space-20);
  color: var(--color-accent);
  border: 1px solid rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.08);
}

.cta-secondary:hover,
.text-link:hover {
  transform: translateY(-2px);
}

.text-link {
  min-height: auto;
  color: var(--color-primary);
}

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

/* ============================================================
   Hero
   ============================================================ */
.hero {
  width: 100%;
  max-width: none;
  min-height: min(860px, 100vh);
  padding: var(--space-64) 0;
  background:
    linear-gradient(135deg, rgba(19, 52, 59, 0.98), rgba(10, 14, 22, 0.96)),
    radial-gradient(circle at 70% 30%, rgba(0, 212, 255, 0.22), transparent 34%);
  color: #ffffff;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 150px;
  background: linear-gradient(180deg, transparent, rgba(252, 252, 249, 0.08));
  pointer-events: none;
}

.hero-inner {
  width: min(1200px, calc(100% - 40px));
  min-height: calc(min(860px, 100vh) - 128px);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: var(--space-48);
  align-items: center;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1,
.hero h2,
.hero h3 {
  color: #ffffff;
}

.hero .eyebrow {
  color: var(--color-accent);
}

.hero-subtitle {
  max-width: 650px;
  margin-top: var(--space-24);
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.12rem, 2vw, 1.42rem);
  font-weight: 700;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin-top: var(--space-32);
}

.hero-visual {
  min-height: 500px;
  position: relative;
}

/* Upload zone */
.upload-zone {
  margin-top: var(--space-24);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-xl);
  padding: var(--space-24) var(--space-20);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.upload-zone.dragover,
.upload-zone:hover {
  border-color: var(--color-accent);
  background: rgba(0, 212, 255, 0.08);
}

.upload-zone-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
}

.upload-zone-inner p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.94rem;
  font-weight: 700;
}

.upload-zone-inner span {
  color: rgba(255, 255, 255, 0.36);
  font-size: 0.82rem;
}

.upload-icon {
  color: rgba(255, 255, 255, 0.48);
  flex-shrink: 0;
}

.upload-btn {
  min-height: 34px;
  padding: 0 var(--space-16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-base);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-btn:hover {
  border-color: var(--color-accent);
  background: rgba(0, 212, 255, 0.14);
}

.upload-hint {
  margin-top: var(--space-12);
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.78rem;
}

/* Terminal dashboard */
.terminal-card,
.floating-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.terminal-main {
  width: min(520px, 100%);
  margin: 0 0 0 auto;
  padding: var(--space-20);
  border-radius: var(--radius-xl);
  animation: floatPanel 7s ease-in-out infinite;
}

.terminal-topbar {
  display: flex;
  gap: 7px;
  margin-bottom: var(--space-20);
}

.terminal-topbar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.terminal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-12);
}

.metric-tile,
.chart-panel,
.signal-list {
  border-radius: var(--radius-base);
  background: rgba(10, 14, 22, 0.52);
}

.metric-tile {
  padding: var(--space-16);
}

.metric-tile span,
.floating-card span {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-tile strong,
.floating-card strong {
  display: block;
  margin-top: var(--space-8);
  color: #ffffff;
  font-size: 1.1rem;
}

.chart-panel {
  grid-column: span 2;
  height: 178px;
  display: flex;
  align-items: end;
  gap: var(--space-12);
  padding: var(--space-20);
}

.chart-panel i {
  width: 100%;
  min-height: 36px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-green));
  animation: equalize 3.8s ease-in-out infinite;
}

.chart-panel i:nth-child(2) { animation-delay: 0.2s; }
.chart-panel i:nth-child(3) { animation-delay: 0.35s; }
.chart-panel i:nth-child(4) { animation-delay: 0.55s; }
.chart-panel i:nth-child(5) { animation-delay: 0.75s; }
.chart-panel i:nth-child(6) { animation-delay: 0.95s; }

.signal-list {
  grid-column: span 2;
  padding: var(--space-16);
}

.signal-list p {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
}

.signal-list p + p {
  margin-top: var(--space-8);
}

.signal-list span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-green);
  box-shadow: 0 0 18px rgba(0, 200, 150, 0.8);
}

.signal-list span.warn {
  background: rgba(255, 180, 50, 1);
  box-shadow: 0 0 18px rgba(255, 180, 50, 0.7);
}

.floating-card {
  position: absolute;
  width: 180px;
  padding: var(--space-16);
  border-radius: var(--radius-lg);
}

.floating-card-one {
  left: 0;
  top: 70px;
  animation: floatCardOne 6s ease-in-out infinite;
}

.floating-card-two {
  right: 16px;
  bottom: 34px;
  animation: floatCardTwo 6.8s ease-in-out infinite;
}

/* ============================================================
   Preview mock
   ============================================================ */
.ejemplo-informe {
  padding-top: 86px;
}

.preview-mock-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-20);
}

.preview-mock-card {
  padding: var(--space-24);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.preview-mock-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.preview-mock-label {
  display: block;
  color: var(--color-text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: var(--space-12);
}

.preview-mock-value {
  display: block;
  color: var(--color-primary);
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-12);
}

.preview-mock-value.warn {
  color: rgba(180, 120, 20, 1);
}

.preview-mock-card p {
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ============================================================
   Qué detecta
   ============================================================ */
.detecta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
}

.detecta-card {
  padding: var(--space-28);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.detecta-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.detecta-card h3 {
  margin-bottom: var(--space-12);
}

.detecta-card p {
  font-size: 0.94rem;
  line-height: 1.55;
}

/* ============================================================
   Cómo funciona
   ============================================================ */
.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-24);
}

.ops-grid article {
  padding: var(--space-28);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.ops-grid h3 {
  margin-bottom: var(--space-12);
}

.ops-grid p {
  font-size: 0.94rem;
}

.ops-grid span {
  display: block;
  margin-bottom: var(--space-24);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 800;
}

/* ============================================================
   Compatibilidad
   ============================================================ */
.compat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
}

.compat-card {
  padding: var(--space-28);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.compat-card strong {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-8);
}

.compat-card p {
  font-size: 0.9rem;
}

.compat-nota {
  margin-top: var(--space-32);
  text-align: center;
  font-size: 0.88rem;
}

/* ============================================================
   Limitaciones
   ============================================================ */
.limitaciones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
}

.limitacion-card {
  padding: var(--space-28);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.limitacion-card h3 {
  margin-bottom: var(--space-16);
  padding-left: var(--space-20);
  position: relative;
  font-size: 0.98rem;
}

.limitacion-card h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.limitacion-card.check h3::before {
  background: var(--color-accent-green);
  box-shadow: 0 0 8px rgba(0, 200, 150, 0.5);
}

.limitacion-card.warn h3::before {
  background: rgba(255, 180, 50, 1);
  box-shadow: 0 0 8px rgba(255, 180, 50, 0.5);
}

.limitacion-card.cross h3::before {
  background: var(--color-red-400);
  box-shadow: 0 0 8px rgba(255, 84, 89, 0.5);
}

.limitacion-card ul {
  list-style: none;
  padding: 0;
}

.limitacion-card li {
  padding: var(--space-8) 0 var(--space-8) var(--space-20);
  position: relative;
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.limitacion-card li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  top: var(--space-8);
  color: var(--color-text-secondary);
  font-weight: 800;
}

.limitaciones-disclaimer {
  max-width: 760px;
  margin: var(--space-32) auto 0;
  padding: var(--space-20);
  border: 1px solid rgba(33, 128, 141, 0.25);
  border-radius: var(--radius-base);
  background: rgba(33, 128, 141, 0.04);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ============================================================
   Esto no es
   ============================================================ */
.que-no-es {
  width: min(760px, calc(100% - 40px));
  text-align: center;
}

.no-es-list {
  display: grid;
  gap: var(--space-12);
  list-style: none;
  text-align: left;
}

.no-es-list li {
  display: flex;
  gap: var(--space-12);
  align-items: flex-start;
  padding: var(--space-16) var(--space-20);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  background: var(--color-surface);
  color: var(--color-text);
}

.no-es-list li::before {
  content: '\00D7';
  flex: 0 0 auto;
  color: var(--color-red-400);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}

.no-es-resumen {
  margin-top: var(--space-32);
  font-size: 1.04rem;
  line-height: 1.55;
}

/* ============================================================
   Lead form
   ============================================================ */
.lead-form {
  max-width: 640px;
  margin: 0 auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-20);
  margin-bottom: var(--space-20);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.form-group label {
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.form-group input,
.form-group select {
  min-height: 44px;
  padding: 0 var(--space-12);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.94rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.form-submit {
  display: flex;
  justify-content: center;
  margin-top: var(--space-32);
}

.form-submit .cta-primary {
  min-width: 220px;
}

.form-microcopy {
  margin-top: var(--space-16);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-24);
  padding: var(--space-48) var(--space-24);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  text-align: center;
}

.footer-links,
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-20);
}

.footer-links a {
  color: var(--color-primary);
  font-weight: 800;
}

.footer-legal a,
.copyright {
  color: var(--color-text-secondary);
  font-size: 0.86rem;
}

.disclaimer-regulatorio {
  max-width: 840px;
  padding: var(--space-16) var(--space-20);
  border: 1px solid rgba(255, 84, 89, 0.22);
  border-left: 4px solid var(--color-red-400);
  border-radius: var(--radius-base);
  background: rgba(255, 84, 89, 0.06);
}

.disclaimer-regulatorio p {
  text-align: left;
  font-size: 0.85rem;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes floatPanel {
  0%, 100% { transform: translateY(0) rotate(0.4deg); }
  50% { transform: translateY(-14px) rotate(-0.4deg); }
}

@keyframes floatCardOne {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(12px, -12px, 0); }
}

@keyframes floatCardTwo {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-10px, 12px, 0); }
}

@keyframes equalize {
  0%, 100% { height: 44px; opacity: 0.72; }
  35% { height: 116px; opacity: 1; }
  70% { height: 78px; opacity: 0.86; }
}

/* ============================================================
   Scroll animations
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  main > section.pre-anim {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
  }

  main > section.pre-anim.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .hero-visual {
    min-height: 390px;
  }

  .terminal-main {
    margin: 0 auto;
  }

  .preview-mock-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .detecta-grid,
  .compat-grid,
  .limitaciones-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ops-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  section,
  .hero-inner,
  .que-no-es {
    width: min(100% - 32px, 1200px);
  }

  .hero {
    min-height: auto;
    padding: var(--space-48) 0;
  }

  .hero-inner {
    min-height: 0;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cta-primary,
  .cta-secondary {
    width: 100%;
  }

  .hero-visual {
    min-height: 330px;
  }

  .floating-card {
    display: none;
  }

  .preview-mock-cards,
  .detecta-grid,
  .compat-grid,
  .limitaciones-grid,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .upload-zone-inner {
    flex-direction: column;
  }

  .lead-form {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.18rem;
  }

  section {
    padding: var(--space-48) 0;
  }

  .terminal-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .signal-list {
    grid-column: auto;
  }

  .chart-panel {
    height: 130px;
  }

  .ops-grid article,
  .detecta-card,
  .limitacion-card,
  .compat-card,
  .preview-mock-card {
    padding: var(--space-20);
  }

  .footer-links,
  .footer-legal {
    flex-direction: column;
    gap: var(--space-12);
  }
}
