:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --primary: #1d4ed8;
  --primary-hover: #1e3a8a;
  --accent: #059669;
  --warn: #f97316;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --max: 1080px;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-md { gap: 16px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header > .container { padding-top: 14px; padding-bottom: 14px; }
.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--primary); color: white;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.site-header nav a { color: var(--text); font-weight: 500; font-size: 15px; }
.site-header nav a:hover { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, transform .06s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-primary {
  background: var(--primary); color: white;
}
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--text); }

/* Hero */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 16px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.05;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.accent { color: var(--primary); }
.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 32px;
}
.lead-small { color: var(--muted); margin: 0 0 32px; }
.lead small { display: block; font-size: 14px; margin-top: 8px; color: var(--muted); }
.cta-row {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap;
}
.micro {
  font-size: 13px;
  color: var(--muted);
  margin-top: 18px;
}

/* Sections */
section { padding: 56px 0; }
section h2 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 36px);
  margin: 0 0 32px;
  text-align: center;
  letter-spacing: -0.01em;
}

/* Grids */
.grid-3, .grid-4 {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
}
.step {
  width: 36px; height: 36px;
  background: var(--primary); color: white;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin-bottom: 14px;
}
.card h3 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
  font-size: 20px;
}
.card p { color: var(--muted); margin: 0; font-size: 15px; }

/* Pricing */
.price-card { text-align: center; padding: 32px 22px; }
.price-card h3 { margin-bottom: 8px; }
.price { font-size: 32px; font-weight: 700; margin: 4px 0 2px; }
.price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.highlighted {
  border-color: var(--primary);
  box-shadow: 0 8px 24px -12px rgba(29, 78, 216, 0.35);
}
.badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white;
  padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Check list */
.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 24px;
  list-style: none;
  padding: 0; margin: 0;
}
.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--text);
  font-size: 15px;
}
.check-list li::before {
  content: "";
  position: absolute; left: 0; top: 4px;
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

/* FAQ */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.faq details[open] { border-color: var(--primary); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq summary::after {
  content: "+";
  position: absolute; right: 4px; top: -4px;
  font-size: 22px; color: var(--primary);
}
.faq details[open] summary::after { content: "−"; }
.faq p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* CTA final */
.cta-final {
  background: var(--text);
  color: var(--surface);
  text-align: center;
}
.cta-final h2 { color: var(--surface); }
.cta-final p { color: rgba(255,255,255,0.7); margin: 0 0 24px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 32px 0 48px;
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.disclaimer { margin-top: 18px; font-size: 12px; line-height: 1.5; opacity: 0.7; }

/* "Un producto de Mitosis" — branding del ecosistema en footer */
.by-mitosis-bar {
  border-top: 1px solid var(--line);
  background: #fafaf8;
}
.by-mitosis-bar .container { padding-top: 14px; padding-bottom: 14px; text-align: center; }
.by-mitosis {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  text-decoration: none;
}
.by-mitosis:hover { color: var(--primary); text-decoration: none; }
.by-mitosis strong { color: var(--text); font-weight: 600; }
.by-mitosis svg { width: 14px; height: 14px; }

/* App page */
.app-shell { padding: 48px 0; }
.app-shell h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  text-align: center; margin: 0 0 8px;
}
.app-shell .sub { text-align: center; color: var(--muted); margin: 0 0 32px; }

.email-bar {
  display: flex; gap: 8px; max-width: 520px; margin: 0 auto 24px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 6px 6px 18px;
}
.email-bar input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 15px; color: var(--text);
}
.email-bar button { padding: 8px 18px; border-radius: 999px; border: 0; background: var(--text); color: white; font-weight: 600; cursor: pointer; }

.dropzone {
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 64px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--primary);
  background: rgba(29, 78, 216, 0.04);
}
.dropzone p { margin: 8px 0; color: var(--muted); }
.dropzone strong { color: var(--text); font-size: 17px; }

.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 18px;
  margin: 16px 0 24px;
  font-size: 14px;
}
.status-bar .credits { color: var(--text); font-weight: 600; }
.status-bar .credits .num { color: var(--primary); font-size: 18px; margin: 0 4px; }

.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}
.result h2 {
  font-family: var(--font-serif);
  margin: 0 0 6px; font-size: 24px; text-align: left;
}
.result .meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin: 16px 0 24px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.result .meta div b { display: block; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.result pre {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  white-space: pre-wrap;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  max-height: 480px;
  overflow: auto;
}
.result .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  margin: 16px 0;
}
.alert-warn { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-ok { background: #dcfce7; border: 1px solid #86efac; color: #166534; }

.spin {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  section { padding: 40px 0; }
}
