/* ============================================================
   Codestelar Software — Landing page
   Brand tokens, light + dark mode. IBM Plex Sans + JetBrains Mono.
   Logo wordmark: Chakra Petch (matches the provided logo).
   ============================================================ */

:root {
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-soft: #f1f5f9;

  --color-text: #111827;
  --color-text-muted: #64748b;

  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-accent: #22d3ee;

  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-ink: #0b1020;
  --color-dark-surface: #101522;

  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-display: "Chakra Petch", var(--font-sans);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);

  --container: 1120px;
  --grid-line: rgba(15, 23, 42, 0.045);
}

[data-theme="dark"] {
  --color-background: #070a12;
  --color-surface: #101522;
  --color-surface-soft: #151b2e;

  --color-text: #f8fafc;
  --color-text-muted: #a7b0c0;

  --color-primary: #7c5cff;
  --color-primary-hover: #9b7cff;
  --color-accent: #22d3ee;

  --color-border: #263044;
  --color-border-strong: #38445e;

  --color-ink: #f8fafc;

  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);

  --grid-line: rgba(255, 255, 255, 0.035);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
  /* faint technical grid */
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 16px 28px; font-size: 16px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 6px 18px color-mix(in oklab, var(--color-primary) 35%, transparent);
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover { border-color: var(--color-text-muted); background: var(--color-surface-soft); }

.btn-light {
  background: #ffffff;
  color: #0b1020;
}
.btn-light:hover { background: #e8edf5; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-background) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--color-ink);
  flex: 0 0 auto;
}
.logo-mark { width: 30px; height: 30px; display: block; }
.logo-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--color-text);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 12px;
}
.nav-links a {
  font-size: 14.5px;
  color: var(--color-text-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--color-text); }
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.theme-toggle {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { border-color: var(--color-border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 12vw, 140px) 0 clamp(64px, 9vw, 110px);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-arcs {
  position: absolute;
  right: -8%;
  top: -6%;
  width: 80%;
  height: 130%;
  opacity: 0.9;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  margin-bottom: 28px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 25%, transparent);
}
.hero-title {
  font-size: clamp(34px, 5.4vw, 60px);
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 24px;
}
.hero-sub {
  font-size: clamp(17px, 2.1vw, 21px);
  color: var(--color-text-muted);
  max-width: 620px;
  text-wrap: pretty;
  margin-bottom: 36px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.hero-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-muted);
  max-width: 520px;
  line-height: 1.7;
  padding-left: 16px;
  border-left: 2px solid var(--color-accent);
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; position: relative; }
.section-alt { background: var(--color-surface-soft); border-block: 1px solid var(--color-border); }
.section-head { max-width: 760px; margin-bottom: 52px; }
.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 18px;
}
[data-theme="dark"] .kicker { color: var(--color-accent); }
.section-title {
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.section-lead {
  font-size: clamp(16px, 1.8vw, 18.5px);
  color: var(--color-text-muted);
  margin-top: 18px;
  max-width: 640px;
  text-wrap: pretty;
}

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

/* Pain cards */
.pain-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.pain-card .pain-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  padding-top: 2px;
  flex: 0 0 auto;
}
.pain-card .pain-text { font-size: 16.5px; font-weight: 500; color: var(--color-text); line-height: 1.45; }

/* Solution cards */
.sol-card { display: flex; flex-direction: column; gap: 16px; }
.sol-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sol-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--color-primary) 10%, var(--color-surface));
  border: 1px solid color-mix(in oklab, var(--color-primary) 22%, var(--color-border));
  color: var(--color-primary);
}
[data-theme="dark"] .sol-icon { color: var(--color-accent); background: color-mix(in oklab, var(--color-accent) 12%, var(--color-surface)); border-color: color-mix(in oklab, var(--color-accent) 25%, var(--color-border)); }
.sol-icon svg { width: 24px; height: 24px; }
.sol-title { font-size: 20px; font-weight: 600; }
.sol-desc { color: var(--color-text-muted); font-size: 15.5px; line-height: 1.55; }
.sol-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 6px;
}

/* ---------- Steps (método) ---------- */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step {
  counter-increment: step;
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  display: block;
  margin-bottom: 14px;
}
[data-theme="dark"] .step::before { color: var(--color-accent); }
.step-text { font-size: 16.5px; font-weight: 500; line-height: 1.45; }
.step-line {
  width: 28px; height: 1px;
  background: var(--color-border-strong);
  margin-top: 16px;
}

/* ---------- Diagnóstico ---------- */
.section-diagnostic { background: var(--color-surface-soft); border-block: 1px solid var(--color-border); }
.diagnostic {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 56px;
  align-items: start;
}
.diagnostic-copy { padding-top: 8px; }
.diagnostic-list { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.diagnostic-list li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  color: var(--color-text);
}
.diagnostic-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
}

.diagnostic-form { display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-md); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--color-text); }
.field .opt { font-weight: 400; color: var(--color-text-muted); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 18%, transparent);
}
.form-note { font-size: 12.5px; color: var(--color-text-muted); text-align: center; line-height: 1.5; }

/* ---------- Badges (tech) ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 10px 18px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.badge:hover { border-color: var(--color-accent); color: var(--color-primary); }
[data-theme="dark"] .badge:hover { color: var(--color-accent); }

/* ---------- CTA final ---------- */
.cta-final-section { padding: clamp(56px, 8vw, 96px) 0; }
.cta-final {
  position: relative;
  overflow: hidden;
  background: var(--color-ink);
  color: #f8fafc;
  border-radius: var(--radius-xl);
  padding: clamp(48px, 7vw, 84px) clamp(32px, 6vw, 80px);
  text-align: center;
}
[data-theme="dark"] .cta-final { border: 1px solid var(--color-border); background: #0b1020; }
.cta-final-arcs { position: absolute; right: -60px; top: -40px; width: 460px; opacity: 0.9; pointer-events: none; }
.cta-final-title {
  position: relative;
  font-size: clamp(26px, 3.8vw, 42px);
  letter-spacing: -0.025em;
  color: #ffffff;
  text-wrap: balance;
  margin: 0 auto 18px;
  max-width: 680px;
}
.cta-final-text {
  position: relative;
  font-size: clamp(16px, 1.9vw, 18.5px);
  color: #a7b0c0;
  max-width: 560px;
  margin: 0 auto 32px;
  text-wrap: pretty;
}
.cta-final .btn { position: relative; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--color-border); padding: 64px 0 36px; background: var(--color-background); }
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-brand .logo { margin-bottom: 18px; }
.footer-tagline { color: var(--color-text-muted); font-size: 15px; max-width: 280px; }
.footer-mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text-muted); letter-spacing: 0.08em; margin-top: 12px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col-title { font-size: 13px; font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.footer-col a { font-size: 14.5px; color: var(--color-text-muted); transition: color 0.15s ease; }
.footer-col a:hover { color: var(--color-text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- Sticky WhatsApp ---------- */
.wa-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #06351a;
  font-weight: 600;
  font-size: 14.5px;
  padding: 13px 18px 13px 15px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.wa-fab svg { width: 22px; height: 22px; }
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(37, 211, 102, 0.5); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .grid-3, .grid-2, .steps { grid-template-columns: 1fr 1fr; }
  .diagnostic { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .grid-3, .grid-2, .steps { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .wa-fab span { display: none; }
  .wa-fab { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
