/* ==========================================================================
   GEOlens — Estilos base compartidos
   ========================================================================== */

:root {
  --bg: #f6f8fb;
  --bg-2: #eef2f8;
  --surface: #ffffff;
  --ink: #0a1a2f;
  --ink-2: #44546b;
  --ink-3: #8593a6;
  --line: #e3e8ef;
  --line-2: #d3dbe6;

  --brand: #2b59ff;
  --brand-600: #1f45d6;
  --brand-2: #7b61ff;
  --brand-soft: #eaf0ff;
  --cyan: #12b5cb;

  --ok: #0e9f6e;
  --ok-soft: #e6f6ef;
  --warn: #d48806;
  --warn-soft: #fff4dc;
  --bad: #e5484d;
  --bad-soft: #fdeced;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(10, 26, 47, .05), 0 1px 1px rgba(10, 26, 47, .03);
  --shadow: 0 10px 30px -12px rgba(10, 26, 47, .14), 0 2px 6px rgba(10, 26, 47, .04);
  --shadow-lg: 0 30px 60px -20px rgba(20, 44, 110, .25), 0 8px 20px -8px rgba(10, 26, 47, .08);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.gradient-text {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 12px;
  font-weight: 600; font-size: 15px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(43, 89, 255, .6), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(43, 89, 255, .6); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--line-2); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #142a48; transform: translateY(-1px); }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }

/* ---------- Badges / chips ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.eyebrow .pill {
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 700;
}
.section-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 14px;
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 248, 251, .72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, .85); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.logo-mark { width: 32px; height: 32px; }
.logo span em { font-style: normal; color: var(--brand); }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: var(--ink-2);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(10, 26, 47, .04); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 900px) {
  .nav-links, .nav-actions .btn-ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open .nav-links {
    display: flex; flex-direction: column;
    position: absolute; top: 72px; left: 16px; right: 16px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-lg);
  }
  .nav.is-open .nav-links a { padding: 12px 14px; }
}
@media (max-width: 480px) {
  .nav-actions .btn-primary { display: none; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer p { color: var(--ink-2); font-size: 14px; max-width: 300px; margin-top: 14px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 14px; font-weight: 600; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer ul a { font-size: 14px; color: var(--ink-2); }
.footer ul a:hover { color: var(--brand); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.footer-trust { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-trust span { display: inline-flex; align-items: center; gap: 6px; }
.footer-trust svg { width: 14px; height: 14px; color: var(--ok); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Overlay de escaneo ---------- */
.scan-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(246, 248, 251, .82);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.scan-overlay.is-visible { display: flex; }
.scan-panel {
  width: 100%; max-width: 520px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 28px; box-shadow: var(--shadow-lg);
  padding: 36px; text-align: center;
}
.radar { position: relative; width: 148px; height: 148px; margin: 0 auto 24px; }
.radar-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line-2); }
.radar-ring:nth-child(2) { inset: 22px; }
.radar-ring:nth-child(3) { inset: 44px; }
.radar-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(43, 89, 255, 0) 0deg, rgba(43, 89, 255, .28) 70deg, rgba(43, 89, 255, 0) 72deg);
}
.radar-core { position: absolute; inset: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; box-shadow: 0 8px 24px -6px rgba(43, 89, 255, .6); }
.radar-core svg { width: 16px; height: 16px; color: #fff; }
.radar-blip { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: 0; }
.scan-panel h3 { font-size: 22px; }
.scan-domain { display: inline-block; margin-top: 8px; font-family: var(--mono); font-size: 14px; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-progress { margin: 28px 0 8px; height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.scan-progress span { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--cyan)); transform-origin: left; transform: scaleX(0); }
.scan-pct { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); font-family: var(--mono); }
.scan-steps { list-style: none; padding: 0; margin: 24px 0 0; text-align: left; display: grid; gap: 12px; }
.scan-step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-3); transition: color .3s; }
.scan-step .st { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; transition: all .3s; }
.scan-step .st svg { width: 12px; height: 12px; opacity: 0; color: #fff; }
.scan-step.is-active { color: var(--ink); font-weight: 600; }
.scan-step.is-active .st { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.scan-step.is-done { color: var(--ink-2); }
.scan-step.is-done .st { background: var(--ok); border-color: var(--ok); animation: none; }
.scan-step.is-done .st svg { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .scan-panel { padding: 28px 20px; } }

.scan-note { margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.scan-fail { display: none; margin-top: 20px; padding: 16px; border-radius: 14px; background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 500; text-align: left; }
.scan-panel.has-error .scan-fail { display: block; }
.scan-panel.has-error .scan-steps, .scan-panel.has-error .scan-progress, .scan-panel.has-error .scan-pct { display: none; }
.scan-fail-actions { display: flex; gap: 8px; margin-top: 14px; }
.scan-fail-actions .btn { height: 38px; font-size: 14px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 26, 47, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal.is-visible { display: flex; }
.modal-panel { position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); }
.modal-close:hover { background: var(--bg-2); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }
.modal-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; margin-bottom: 18px; }
.modal-icon svg { width: 24px; height: 24px; }
.modal h3 { font-size: 22px; }
.modal p { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.modal .field { margin-top: 20px; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.modal .field:focus-within { border-color: rgba(43, 89, 255, .45); box-shadow: 0 0 0 4px rgba(43, 89, 255, .12); }
.modal .field svg { width: 18px; height: 18px; color: var(--ink-3); }
.modal .field input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; min-width: 0; }
.modal .btn { width: 100%; margin-top: 12px; }
.modal .modal-error { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--bad); font-weight: 500; }
.modal .modal-alt { margin-top: 14px; text-align: center; font-size: 14px; color: var(--ink-2); }
.modal .modal-alt a { color: var(--brand); font-weight: 600; }

/* ---------- Utilidades de animación ---------- */
.reveal { opacity: 0; transform: translateY(24px); }
.no-js .reveal, .reduced-motion .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
