/* ==========================================================
   RadarDigital — hoja de estilos general
   Paleta: azul marino serio + acento celeste/verde para puntajes
   ========================================================== */

:root {
  --navy-950: #060b16;
  --navy-900: #0b1526;
  --navy-800: #101d34;
  --navy-700: #16294a;
  --navy-600: #1e3660;
  --ink-100: #f4f7fb;
  --ink-300: #c7d2e3;
  --ink-500: #8fa0bd;
  --accent: #2dd4bf;
  --accent-dark: #14b8a6;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-lg: 0 20px 60px rgba(3, 8, 20, 0.45);
  --shadow-md: 0 10px 30px rgba(3, 8, 20, 0.3);
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-heading);
  background: var(--navy-950);
  color: var(--ink-100);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

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

/* ---------- NAV ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 11, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgba(45, 212, 191, 0.7);
}
.nav-cta {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--navy-950);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 84px 0 56px;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 480px;
  background: radial-gradient(60% 60% at 50% 30%, rgba(45, 212, 191, 0.18), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-weight: 800;
}
.hero h1 span { color: var(--accent); }
.hero p.lead {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--ink-300);
  max-width: 620px;
  margin: 0 auto 40px;
}

/* ---------- FORM ---------- */
.analizar-form {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  background: var(--navy-800);
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--navy-600);
  box-shadow: var(--shadow-lg);
}
.analizar-form input[type="text"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink-100);
  font-size: 1rem;
  padding: 14px 16px;
  outline: none;
  font-family: inherit;
}
.analizar-form input::placeholder { color: var(--ink-500); }
.btn-analizar {
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--navy-950);
  font-weight: 800;
  font-size: 0.98rem;
  padding: 14px 26px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-analizar:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(45, 212, 191, 0.35); }
.btn-analizar:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-hint {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--ink-500);
}
.form-error {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--red);
  font-weight: 600;
}

.trust-row {
  margin-top: 34px;
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--ink-500);
  font-size: 0.82rem;
}
.trust-row span { display: flex; align-items: center; gap: 6px; }

/* ---------- FEATURES ---------- */
.section { padding: 64px 0; }
.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.section-sub {
  text-align: center;
  color: var(--ink-500);
  max-width: 560px;
  margin: 0 auto 44px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 1rem; margin: 0 0 8px; font-weight: 700; }
.feature-card p { font-size: 0.88rem; color: var(--ink-500); margin: 0; }

/* ---------- PREVIEW BORROSO ---------- */
.preview-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--navy-600);
  box-shadow: var(--shadow-lg);
}
.preview-blur {
  filter: blur(6px);
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
  padding: 32px;
  background: var(--navy-800);
}
.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(180deg, rgba(6,11,22,0.2), rgba(6,11,22,0.85));
  text-align: center;
  padding: 20px;
}
.preview-overlay .lock {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(45, 212, 191, 0.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  border: 1px solid rgba(45, 212, 191, 0.3);
}
.preview-overlay strong { font-size: 1.05rem; }
.preview-overlay span { color: var(--ink-300); font-size: 0.88rem; max-width: 380px; }

.mock-score-row { display: flex; gap: 24px; align-items: center; }
.mock-circle {
  width: 120px; height: 120px; border-radius: 50%;
  border: 10px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800;
}
.mock-bars { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.mock-bar { height: 10px; border-radius: 6px; background: var(--navy-600); overflow: hidden; }
.mock-bar > div { height: 100%; background: var(--accent); }

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--navy-700);
  padding: 32px 0;
  text-align: center;
  color: var(--ink-500);
  font-size: 0.82rem;
}

/* ==========================================================
   PANTALLA "ANALIZANDO"
   ========================================================== */
.scan-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.scan-card {
  width: 100%;
  max-width: 520px;
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.scan-target {
  color: var(--accent);
  font-weight: 700;
  word-break: break-word;
}
.radar-anim {
  width: 110px;
  height: 110px;
  margin: 22px auto 30px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(var(--accent) 0deg, transparent 90deg, transparent 360deg);
  animation: radar-spin 1.4s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar-anim::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
}
.radar-anim .radar-dot {
  position: relative;
  z-index: 2;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 4px rgba(45, 212, 191, 0.6);
}
@keyframes radar-spin { to { transform: rotate(360deg); } }

.scan-steps { list-style: none; margin: 0 0 26px; padding: 0; text-align: left; }
.scan-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  color: var(--ink-500);
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}
.scan-steps li.visible { opacity: 1; transform: translateY(0); }
.scan-steps li.done { color: var(--ink-100); }
.scan-steps li .chip {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--navy-600);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
}
.scan-steps li.done .chip {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--navy-950);
}
.scan-steps li.active .chip { border-color: var(--accent); }

.scan-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--navy-600);
  overflow: hidden;
  margin-bottom: 10px;
}
.scan-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  width: 0%;
  transition: width 0.5s ease;
}
.scan-pct { font-size: 0.78rem; color: var(--ink-500); }

/* ==========================================================
   RESULTADO
   ========================================================== */
.resultado-header {
  padding: 48px 0 12px;
  text-align: center;
}
.resultado-header .negocio-nombre {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
}
.resultado-header .negocio-url { color: var(--ink-500); font-size: 0.9rem; margin-top: 6px; }

.score-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 34px;
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-lg);
  padding: 34px;
  margin: 30px 0;
  box-shadow: var(--shadow-md);
}
@media (max-width: 720px) {
  .score-panel { grid-template-columns: 1fr; text-align: center; }
}
.gauge-wrap { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-wrap canvas { max-width: 240px; max-height: 160px; }
.gauge-number { margin-top: -70px; text-align: center; }
.gauge-number .num { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.gauge-number .cat {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.score-summary h2 { margin: 0 0 10px; font-size: 1.25rem; }
.score-summary p { color: var(--ink-300); margin: 0 0 18px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list .chip-ok {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 30px 0;
}
.cat-card {
  background: var(--navy-800);
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-md);
  padding: 20px;
}
.cat-card .cat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cat-card .cat-top strong { font-size: 0.92rem; }
.cat-card .cat-top .cat-pts { font-weight: 800; font-size: 0.95rem; }
.cat-bar { height: 8px; border-radius: 999px; background: var(--navy-600); overflow: hidden; margin-bottom: 10px; }
.cat-bar > div { height: 100%; border-radius: 999px; }
.cat-card p { font-size: 0.82rem; color: var(--ink-500); margin: 0; }

.estado-bien { color: var(--green); }
.estado-alerta { color: var(--amber); }
.estado-critico { color: var(--red); }
.bar-bien { background: var(--green); }
.bar-alerta { background: var(--amber); }
.bar-critico { background: var(--red); }

.debiles-section h2, .positivos-section h2 { font-size: 1.2rem; margin: 40px 0 16px; }
.debil-card {
  border-left: 3px solid var(--red);
  background: var(--navy-800);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.debil-card h4 { margin: 0 0 6px; font-size: 0.96rem; }
.debil-card p { margin: 0; color: var(--ink-300); font-size: 0.88rem; }

.positivos-lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.positivos-lista li {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-300); font-size: 0.9rem;
}
.positivos-lista li .ok-dot { color: var(--green); }

.cta-final {
  margin: 56px 0 40px;
  text-align: center;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-lg);
  padding: 48px 30px;
}
.cta-final h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 12px; }
.cta-final p { color: var(--ink-300); max-width: 520px; margin: 0 auto 26px; }
.cta-botones { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-whatsapp {
  background: #25d366; color: #06210f; font-weight: 800;
  padding: 14px 24px; border-radius: var(--radius-md);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-pdf {
  background: transparent; color: var(--ink-100); font-weight: 700;
  padding: 14px 24px; border-radius: var(--radius-md);
  border: 1px solid var(--navy-600);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-pdf:hover { border-color: var(--accent); color: var(--accent); }

.email-capture {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.email-capture input[type="email"] {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--navy-600);
  background: var(--navy-900);
  color: var(--ink-100);
  min-width: 260px;
  font-family: inherit;
}
.email-capture button {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: var(--navy-950);
  font-weight: 700;
  cursor: pointer;
}
.email-capture .ok-msg { color: var(--green); font-size: 0.85rem; margin-top: 8px; width: 100%; text-align: center; }

/* ==========================================================
   ADMIN
   ========================================================== */
.admin-body { background: var(--navy-950); }
.admin-shell { max-width: 1180px; margin: 0 auto; padding: 30px 24px 60px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.admin-topbar h1 { font-size: 1.4rem; margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--navy-800); border: 1px solid var(--navy-600);
  border-radius: var(--radius-md); padding: 18px 20px;
}
.stat-card .stat-num { font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-label { color: var(--ink-500); font-size: 0.82rem; margin-top: 4px; }

.admin-table-wrap {
  background: var(--navy-800); border: 1px solid var(--navy-600);
  border-radius: var(--radius-md); overflow-x: auto;
}
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 720px; }
table.admin-table th, table.admin-table td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--navy-700);
  white-space: nowrap;
}
table.admin-table th { color: var(--ink-500); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.admin-table tr:last-child td { border-bottom: none; }
.badge-score { padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 0.78rem; }

.admin-actions { display: flex; gap: 10px; align-items: center; }
.btn-secundario {
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--navy-600); color: var(--ink-100);
  font-size: 0.85rem; font-weight: 600;
}
.btn-secundario:hover { border-color: var(--accent); color: var(--accent); }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--navy-800);
  border: 1px solid var(--navy-600); border-radius: var(--radius-lg);
  padding: 34px; box-shadow: var(--shadow-lg);
}
.login-card h1 { font-size: 1.2rem; margin: 0 0 4px; }
.login-card p.sub { color: var(--ink-500); font-size: 0.85rem; margin: 0 0 24px; }
.login-card label { display: block; font-size: 0.82rem; color: var(--ink-300); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--navy-600); background: var(--navy-900); color: var(--ink-100);
  font-family: inherit;
}
.login-card button {
  margin-top: 22px; width: 100%; padding: 12px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--navy-950); font-weight: 800; cursor: pointer;
}
.login-error {
  margin-top: 14px; color: var(--red); font-size: 0.85rem; text-align: center;
}

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.pagination a {
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--navy-600); font-size: 0.85rem;
}
.pagination a.active { background: var(--accent); color: var(--navy-950); border-color: var(--accent); }

@media (max-width: 640px) {
  .analizar-form { flex-direction: column; }
  .btn-analizar { width: 100%; }
}
