/* ============================================================
   DESPEGA — De 0 a 1.000 usuarios sin ads
   Tokens de diseño + componentes. Sin frameworks, sin build.
   ============================================================ */

:root {
  --bg: #0b0e14;
  --surface: #12161f;
  --surface-2: #1a2030;
  --surface-3: #222a3d;
  --border: #242d42;
  --border-strong: #34405c;
  --text: #e9edf5;
  --muted: #97a0b5;
  --faint: #6b7489;
  --accent: #ff8a2a;
  --accent-2: #ff4d68;
  --accent-soft: rgba(255, 138, 42, 0.12);
  --grad: linear-gradient(135deg, #ff8a2a 0%, #ff4d68 100%);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; max-width: 1080px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--text); white-space: nowrap;
}
.brand .rocket { font-size: 1.3rem; }
.brand-accent {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 0.78rem; font-weight: 700; padding: 4px 9px; border-radius: 999px;
}
.lang-switch button.active { background: var(--surface-3); color: var(--text); }

.plan-badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 5px 11px; border-radius: 999px; text-transform: uppercase;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.plan-badge.pro { background: var(--accent-soft); color: var(--accent); border-color: rgba(255,138,42,0.4); }
.plan-badge.elite { background: var(--grad); color: #fff; border: 0; }

/* ---------- Navegación por tabs ---------- */
.nav-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 16px; max-width: 1080px; margin: 0 auto;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 0.88rem; font-weight: 600; padding: 8px 13px; border-radius: 999px;
  white-space: nowrap; transition: all 0.15s;
}
.nav-tab:hover { color: var(--text); background: var(--surface-2); }
.nav-tab.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(255,138,42,0.35); }

/* ---------- Secciones ---------- */
.view { display: none; padding: 24px 0 96px; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: 20px; }
.view-head .step-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.view-head h2 { font-size: 1.55rem; letter-spacing: -0.02em; }
.view-head p { color: var(--muted); margin-top: 4px; max-width: 640px; }

/* ---------- Hero / landing ---------- */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 {
  font-size: clamp(1.9rem, 5.5vw, 3.1rem); line-height: 1.12;
  letter-spacing: -0.03em; font-weight: 900; max-width: 760px; margin: 0 auto;
}
.hero h1 .hl {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub { color: var(--muted); font-size: 1.08rem; max-width: 620px; margin: 14px auto 0; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

.stats-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin: 34px auto 0; max-width: 720px;
}
@media (min-width: 640px) { .stats-row { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 10px; text-align: center;
}
.stat-tile .num { font-size: 1.45rem; font-weight: 900; letter-spacing: -0.02em; }
.stat-tile .lbl { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.method-grid { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 720px) { .method-grid { grid-template-columns: repeat(5, 1fr); } }
.method-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 14px; text-align: left; position: relative; transition: border-color 0.15s;
}
.method-card:hover { border-color: var(--border-strong); }
.method-card .mnum {
  width: 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 0.85rem; margin-bottom: 10px;
}
.method-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.method-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 0.92rem; font-weight: 700; padding: 11px 18px; border-radius: var(--radius-sm);
  transition: all 0.15s; text-decoration: none;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(255, 92, 80, 0.3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248,113,113,0.3); }
.btn.success { background: var(--success-soft); color: var(--success); border-color: rgba(52,211,153,0.3); }
.btn.sm { font-size: 0.8rem; padding: 7px 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Cards / paneles ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h3 { font-size: 1.08rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.card .hint { color: var(--muted); font-size: 0.86rem; margin-bottom: 14px; }
.card-row { display: grid; gap: 16px; }
@media (min-width: 860px) { .card-row.cols-2 { grid-template-columns: 1fr 1fr; } .card-row.cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Formularios ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 11px 13px; outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 74px; }
.field .subhint { font-size: 0.75rem; color: var(--faint); margin-top: 4px; }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-size: 0.83rem; padding: 6px 12px; border-radius: 999px;
}
.chip button { border: 0; background: none; color: var(--faint); font-size: 0.9rem; line-height: 1; }
.chip button:hover { color: var(--danger); }
.chip.action { cursor: pointer; transition: all 0.15s; }
.chip.action:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Checklist ---------- */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 14px; cursor: pointer; transition: all 0.15s;
}
.check-item:hover { border-color: var(--border-strong); }
.check-item .box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 0.8rem; color: transparent; transition: all 0.15s;
}
.check-item.done { border-color: rgba(52,211,153,0.35); background: var(--success-soft); }
.check-item.done .box { background: var(--success); border-color: var(--success); color: #06281c; }
.check-item.done .check-label { text-decoration: line-through; color: var(--muted); }
.check-label { font-size: 0.9rem; }

/* ---------- Progreso ---------- */
.progress-wrap { background: var(--surface-2); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--grad); border-radius: 999px; transition: width 0.4s ease; }

/* ---------- Timeline de hitos ---------- */
.milestones { display: flex; flex-direction: column; gap: 0; }
.milestone { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.milestone:last-child { padding-bottom: 0; }
.milestone::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 0;
  width: 2px; background: var(--border);
}
.milestone:last-child::before { display: none; }
.milestone .dot {
  width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 2px solid var(--border-strong); font-size: 0.85rem; z-index: 1;
}
.milestone.done .dot { background: var(--success); border-color: var(--success); }
.milestone .m-body h4 { font-size: 0.95rem; }
.milestone .m-body p { font-size: 0.8rem; color: var(--muted); }
.milestone .m-week {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent);
}
.milestone.done .m-week { color: var(--success); }

/* ---------- Tablas ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.data th {
  text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 800; padding: 3px 9px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.badge.gray { background: var(--surface-3); color: var(--muted); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.fire { background: var(--accent-soft); color: var(--accent); }

/* ---------- Guion generado ---------- */
.script-output {
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 18px; margin-top: 16px;
}
.script-output .s-hook {
  font-size: 1.12rem; font-weight: 800; line-height: 1.4;
  padding: 12px 14px; background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 8px; margin-bottom: 14px;
}
.beat { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.beat:last-child { border-bottom: 0; }
.beat .b-time { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); white-space: nowrap; padding-top: 2px; min-width: 64px; }
.beat .b-text { font-size: 0.88rem; }
.script-rules { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.script-rules .rule { font-size: 0.8rem; color: var(--muted); display: flex; gap: 8px; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; gap: 16px; }
@media (min-width: 820px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 20px; position: relative; display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.price-card .pop-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 4px 14px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.price-card h3 { font-size: 1.05rem; }
.price-card .price { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; margin: 8px 0 2px; }
.price-card .per { color: var(--muted); font-size: 0.8rem; margin-bottom: 16px; }
.price-card ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; flex: 1; }
.price-card li { font-size: 0.86rem; display: flex; gap: 8px; align-items: flex-start; }
.price-card li .tick { color: var(--success); font-weight: 800; }
.price-card li.off { color: var(--faint); }
.price-card li.off .tick { color: var(--faint); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  padding: 11px 18px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 200; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--success); }
#toast.error { border-color: var(--danger); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5, 7, 12, 0.75); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 460px; box-shadow: var(--shadow);
  max-height: 88vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 6px; }
.modal .hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Acordeón (legal / FAQ) ---------- */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; background: var(--surface); }
.accordion summary {
  padding: 14px 18px; cursor: pointer; font-weight: 700; font-size: 0.92rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; font-weight: 400; }
.accordion[open] summary::after { content: "–"; }
.accordion .acc-body { padding: 0 18px 16px; color: var(--muted); font-size: 0.86rem; }
.accordion .acc-body p { margin-bottom: 8px; }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .dash-grid { grid-template-columns: repeat(4, 1fr); } }
.next-action {
  display: flex; align-items: center; gap: 14px; background: var(--accent-soft);
  border: 1px solid rgba(255,138,42,0.35); border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 16px; cursor: pointer; transition: all 0.15s;
}
.next-action:hover { filter: brightness(1.1); }
.next-action .na-icon { font-size: 1.6rem; }
.next-action .na-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: var(--accent); }
.next-action .na-text { font-weight: 700; font-size: 0.95rem; }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 34px 20px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius); font-size: 0.9rem;
}
.empty .e-icon { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 32px 0 120px; margin-top: 40px; }
footer .foot-brand { font-weight: 800; margin-bottom: 6px; }
footer .foot-copy { color: var(--faint); font-size: 0.8rem; margin-top: 18px; }

/* ---------- Nav inferior móvil ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; justify-content: space-around;
  background: rgba(13, 17, 26, 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  border: 0; background: none; color: var(--faint); font-size: 0.62rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 8px;
  min-width: 52px;
}
.bottom-nav button .bn-icon { font-size: 1.25rem; }
.bottom-nav button.active { color: var(--accent); }
@media (min-width: 900px) { .bottom-nav { display: none; } .view { padding-bottom: 40px; } #toast { bottom: 30px; } }

/* ---------- Selector de formato (generador) ---------- */
.fmt-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .fmt-cards { grid-template-columns: repeat(3, 1fr); } }
.fmt-card { position: relative; }
.fmt-card input { position: absolute; opacity: 0; }
.fmt-card label {
  display: block; height: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; cursor: pointer; transition: all 0.15s;
}
.fmt-card label:hover { border-color: var(--border-strong); }
.fmt-card input:checked + label { border-color: var(--accent); background: var(--accent-soft); }
.fmt-card .f-title { font-weight: 800; font-size: 0.92rem; margin-bottom: 4px; }
.fmt-card .f-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

@media (max-width: 899px) { .nav-tabs { display: none; } }

/* ---------- Utilidades ---------- */
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.section-title { font-size: 1.25rem; letter-spacing: -0.01em; margin: 30px 0 6px; }
.section-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
