:root {
  --bg: #f3f8fd;
  --card: #ffffff;
  --ink: #0c1b2e;
  --muted: #5b7189;
  --line: #e2ecf8;
  --blue: #0080ff;
  --sky: #00b4d8;
  --grad: linear-gradient(135deg, #0080ff 0%, #00c8ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(0,128,255,.12), rgba(0,200,255,.12));
  --ok: #16a34a;
  --warn: #d97706;
  --shadow: 0 10px 30px rgba(0, 102, 204, .10);
  --shadow-sm: 0 4px 14px rgba(0, 102, 204, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef5ff; color: var(--blue); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- nav ---------- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.logo {
  font-size: 22px; font-weight: 800; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.logo img { display: block; }
.logo span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.nav-right { display: flex; gap: 16px; align-items: center; }
.nav-right a { color: var(--muted); font-weight: 500; }
.nav-right a.btn { color: #fff; }

/* ---------- botones ---------- */
.btn {
  display: inline-block; padding: 11px 24px; border-radius: 999px;
  border: 1.5px solid transparent; background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s;
  text-decoration: none !important;
}
.btn-primary {
  background: var(--grad); color: #fff !important;
  box-shadow: 0 8px 20px rgba(0,128,255,.30);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--ink); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn.small { padding: 7px 16px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- flashes ---------- */
.flashes { padding: 12px 28px 0; max-width: 1040px; margin: 0 auto; }
.flash {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue);
  padding: 11px 16px; border-radius: 10px; margin-bottom: 8px;
  font-size: 14px; box-shadow: var(--shadow-sm);
}

/* ---------- landing hero ---------- */
.hero {
  text-align: center; padding: 84px 20px 54px; max-width: 900px;
  margin: 0 auto; position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; z-index: -1;
  filter: blur(70px); opacity: .35;
}
.hero::before { width: 380px; height: 380px; background: #7dd3fc; top: -140px; left: -120px; }
.hero::after { width: 420px; height: 420px; background: #93c5fd; bottom: -180px; right: -140px; }
.pill {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--blue);
  background: #fff; border: 1px solid #cfe6ff; padding: 7px 18px;
  border-radius: 999px; box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero h1 {
  font-size: 50px; line-height: 1.12; margin: 0 0 18px; font-weight: 800;
  background: linear-gradient(120deg, #0057ff 10%, #00b4d8 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--muted); font-size: 19px; max-width: 660px; margin: 0 auto 32px; }
.hero .note { color: var(--muted); font-size: 13px; margin-top: 20px; }
.stats { display: flex; justify-content: center; gap: 20px; margin-top: 52px; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 34px; box-shadow: var(--shadow-sm); min-width: 170px;
}
.stat b {
  display: block; font-size: 32px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { color: var(--muted); font-size: 13px; }

/* ---------- funnel de captura de numero ---------- */
.hunt { max-width: 720px; margin: -6px auto 50px; padding: 0 20px; }
.hunt-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 2px solid #bfe3ff;
  border-radius: 20px; padding: 34px 30px 30px;
  box-shadow: 0 20px 45px rgba(0, 128, 255, .18);
  text-align: center;
}
.hunt-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: var(--grad);
}
.hunt-card h2 {
  margin: 0 0 8px; font-size: 27px; font-weight: 800; line-height: 1.2;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hunt-card .muted { font-size: 15px; }
.hunt-card .note { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }
.hunt-form {
  display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap;
  justify-content: center; align-items: stretch;
}
.hunt-form input {
  flex: 1; min-width: 190px; padding: 14px 16px; font-size: 16px;
  border-width: 2px;
}
.hunt-form .btn { padding: 14px 34px; font-size: 16px; font-weight: 700; }
.flag {
  display: inline-flex; align-items: center; gap: 6px; background: #f6faff;
  border: 2px solid #bfe3ff; border-radius: 10px; padding: 12px 16px;
  font-weight: 800; font-size: 16px; color: var(--ink); white-space: nowrap;
}
.pending-banner {
  background: #fff; border: 1px solid #cfe6ff; border-left: 4px solid var(--blue);
  border-radius: 10px; padding: 13px 16px; margin-top: 18px;
  font-size: 14px; box-shadow: var(--shadow-sm);
}
.pending-banner b { color: var(--blue); }

/* ---------- como funciona ---------- */
.how { max-width: 1020px; margin: 30px auto 90px; padding: 0 20px; text-align: center; }
.how h2 { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 24px; text-align: left; box-shadow: var(--shadow-sm);
  transition: .15s;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.step b { display: block; color: var(--blue); font-size: 17px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- paginas simples ---------- */
.page, .dash { max-width: 1040px; margin: 0 auto; padding: 44px 24px 90px; }
.page h1 { font-size: 34px; font-weight: 800; }
.page h2 { font-size: 20px; margin-top: 30px; color: var(--blue); }
.page p, .page li { color: var(--muted); }
.page .btn { margin-top: 18px; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.cred-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.dash-head h1 { margin: 0; font-size: 32px; font-weight: 800; }
.create-form { display: flex; gap: 8px; flex-wrap: wrap; }
input {
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  padding: 11px 15px; border-radius: 10px; font-size: 14px;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,128,255,.12); }

.empty {
  background: #fff; border: 1.5px dashed #bcd8f7; color: var(--muted);
  padding: 28px; border-radius: 14px; text-align: center; margin-top: 24px; font-size: 14px;
}
.empty.small { padding: 14px; }

.link-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px; margin-top: 26px; box-shadow: var(--shadow-sm);
}
.link-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.link-head h2 { margin: 0 0 6px; font-size: 20px; }
.link-url {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px;
  word-break: break-all; color: var(--blue); font-weight: 600;
}
.link-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.btn-wa { border-color: #25D366; color: #0f7a48 !important; font-weight: 700; }
.btn-wa:hover { background: #25D366; border-color: #25D366; color: #fff !important; }
.sms-form { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.capture {
  display: grid; grid-template-columns: 1fr 320px; gap: 18px;
  background: #f8fbff; border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; margin-top: 14px;
}
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.denied, .badge.timeout { background: #fef3c7; color: var(--warn); }
.badge.error { background: #fee2e2; color: #dc2626; }
.badge.esperando { background: #dbeafe; color: #1d4ed8; }
.badge.rechazado { background: #f1f5f9; color: #64748b; }
.cap-fields { list-style: none; padding: 0; margin: 10px 0; font-size: 14px; }
.cap-fields li { padding: 3px 0; color: var(--muted); }
.cap-fields b { color: var(--ink); }
.map { width: 100%; height: 220px; border: 0; border-radius: 10px; }
.map-wrap { display: flex; flex-direction: column; }
.map-note { margin: 6px 0 0; font-size: 12px; }

/* ---------- dashboard: estado, acciones, búsquedas ---------- */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.stat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.stat-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted);
}
.stat-num {
  font-size: 34px; font-weight: 800; line-height: 1.1; margin: 0;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.stat-num.phone { font-size: 21px; letter-spacing: -.02em; }
.stat-tile.is-empty { background: #f8fbff; }
.stat-tile.is-empty .stat-num { background: none; color: #9fb3c8; }
.stat-tile .btn { margin-top: 4px; }

.action-hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px; margin-top: 28px; box-shadow: var(--shadow);
}
.action-hero h2 { margin: 0; font-size: 24px; font-weight: 800; }
.action-hero .sub { margin: 4px 0 18px; color: var(--muted); font-size: 14.5px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.action-card {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  text-align: left; padding: 22px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; font-family: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.action-card:hover:not(:disabled) {
  transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue);
}
.action-card.primary {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 14px 34px rgba(0,128,255,.32);
}
.action-card.primary:hover:not(:disabled) { filter: brightness(1.05); }
.action-card:disabled { opacity: .5; cursor: not-allowed; }
.action-icon { font-size: 34px; line-height: 1; }
.action-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.action-desc { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.action-card.primary .action-desc { color: rgba(255,255,255,.92); }
.action-cta { font-size: 14px; font-weight: 800; color: var(--blue); margin-top: auto; }
.action-card.primary .action-cta { color: #fff; }
.action-warning { margin-top: 14px; }
.action-hero .pending-banner { margin-top: 16px; }

.dash-section-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 36px; margin-bottom: 4px;
}
.dash-section-head h2 { margin: 0; font-size: 24px; font-weight: 800; }
.count-pill {
  background: var(--grad-soft); color: var(--blue); font-weight: 800;
  font-size: 13px; padding: 3px 12px; border-radius: 999px;
}
.link-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.mode-badge {
  display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; padding: 4px 11px; border-radius: 999px;
  background: #dbeafe; color: #1d4ed8;
}
.mode-badge.discreta { background: #f1f5f9; color: #475569; }

/* ---------- popup notificaciones ---------- */
.push-overlay {
  position: fixed; inset: 0; background: rgba(12, 27, 46, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; backdrop-filter: blur(3px);
}
.push-modal {
  background: #fff; border-radius: 22px; padding: 32px 26px 26px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
  animation: pmIn .18s ease-out;
}
@keyframes pmIn {
  from { transform: scale(.93); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.pm-emoji { font-size: 46px; margin-bottom: 8px; }
.push-modal h3 { margin: 0 0 8px; font-size: 21px; color: var(--ink); }
.push-modal p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.push-modal .btn { width: 100%; margin-top: 8px; }
.pm-error { color: #dc2626 !important; font-size: 13px !important; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; }

@media (max-width: 760px) {
  .hero { padding-top: 54px; }
  .hero h1 { font-size: 33px; }
  .stats { gap: 12px; }
  .stat { min-width: 130px; padding: 14px 18px; }
  .steps { grid-template-columns: 1fr; }
  .capture { grid-template-columns: 1fr; }
  .dash-head { flex-direction: column; }
  .dash-stats { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .nav { padding: 12px 16px; }
}
@media (max-width: 560px) {
  .nav { padding: 12px 14px; }
  .nav-right { gap: 10px; }
  .nav-right a { font-size: 14px; }
  .btn.small { padding: 8px 14px; font-size: 13.5px; }
}
