:root {
  --bg: #0a0a0c;
  --bg-card: #131316;
  --bg-card-hover: #18181c;
  --border: rgba(255, 255, 255, 0.08);
  --red: #e31c3d;
  --red-dark: #8b0e1f;
  --white: #f5f5f7;
  --gray: #9ca3af;
  --gray-dim: #6b7280;
  --font-display: "Lora", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1180px;

  /* Estado (diagnóstico) — paleta fija, nunca usada para branding */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-anchor: none;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* Decorative gradient blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--red) 0%, var(--red-dark) 45%, transparent 70%);
  filter: blur(2px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Header / Nav */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 34px;
  height: auto;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.1;
}

.brand-wordmark {
  height: 14px;
  width: auto;
}

.brand-tag {
  font-size: 0.68rem;
  color: var(--gray);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.92rem;
  color: var(--gray);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active { color: var(--white); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  box-shadow: 0 4px 20px rgba(227, 28, 61, 0.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(227, 28, 61, 0.45); }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--red); }

/* Hero */
.hero {
  position: relative;
  padding: 100px 24px 80px;
  overflow: hidden;
}

.eyebrow {
  color: var(--red);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.08;
  max-width: 780px;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.hero p {
  color: var(--gray);
  font-size: 1.1rem;
  max-width: 560px;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Sections */
section { position: relative; padding: 80px 24px; z-index: 1; }

.section-head { max-width: 640px; margin-bottom: 48px; }

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 14px;
}

.section-head p { color: var(--gray); font-size: 1.05rem; }

hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Stat callout (like the reference image) */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  max-width: 620px;
}

.stat-label {
  color: var(--red);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  margin-bottom: 20px;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.05;
  margin-bottom: 20px;
}

.stat-desc { color: var(--gray); font-size: 1.02rem; margin-bottom: 26px; max-width: 460px; }

.stat-source {
  border-left: 3px solid var(--red);
  padding-left: 16px;
}

.stat-source strong { display: block; font-size: 0.95rem; }
.stat-source span { color: var(--gray-dim); font-size: 0.85rem; }

.stat-fade { transition: opacity 0.25s ease; min-height: 300px; }
.stat-fade.fade-out { opacity: 0; }

.stat-dots {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.stat-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.stat-dots button.active {
  background: var(--red);
  transform: scale(1.2);
}

/* CTA banner */
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 36px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.cta-left { display: flex; align-items: center; gap: 20px; }

.cta-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cta-left h3 { font-size: 1.15rem; margin-bottom: 4px; }
.cta-left p { color: var(--gray); font-size: 0.95rem; }

/* Card grid (services) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(227, 28, 61, 0.4);
  background: var(--bg-card-hover);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(227, 28, 61, 0.12);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.card p { color: var(--gray); font-size: 0.94rem; }

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: center;
}

.two-col.reverse .col-img { order: 2; }

.stack { display: flex; flex-direction: column; gap: 22px; }

.stack-item { display: flex; gap: 16px; }

.stack-num {
  font-family: var(--font-display);
  color: var(--red);
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 36px;
}

.stack-item h4 { font-size: 1.02rem; margin-bottom: 4px; }
.stack-item p { color: var(--gray); font-size: 0.92rem; }

.img-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Values grid (nosotros) */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.contact-info-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.contact-info-item:first-child { padding-top: 0; }

.contact-info-item .card-icon { margin-bottom: 0; }

.contact-info-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.contact-info-item p, .contact-info-item a { color: var(--gray); font-size: 0.92rem; }

form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

label { font-size: 0.85rem; color: var(--gray); margin-bottom: 6px; display: block; }

input, textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.94rem;
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--red);
}

textarea { resize: vertical; min-height: 110px; }

.form-note { font-size: 0.82rem; color: var(--gray-dim); }

#form-status {
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: 10px;
  display: none;
}

#form-status.show { display: block; background: rgba(227, 28, 61, 0.12); color: #ff8d8d; }
#form-status.ok { background: rgba(34, 197, 94, 0.12); color: #4ade80; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 28px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto 32px;
}

.footer-brand p { color: var(--gray); font-size: 0.9rem; max-width: 280px; margin-top: 12px; }

.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }

.footer-col h5 {
  font-size: 0.8rem;
  color: var(--gray-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.footer-col a, .footer-col p {
  display: block;
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--white); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--gray-dim);
  font-size: 0.82rem;
}

/* Page hero (subpages) */
.page-hero { padding: 64px 24px 40px; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  max-width: 700px;
}
.page-hero p { color: var(--gray); max-width: 560px; margin-top: 16px; font-size: 1.05rem; }

/* Responsive */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .two-col, .contact-layout { grid-template-columns: 1fr; }
  .two-col.reverse .col-img { order: 0; }
  .form-row { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 860px) {
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 18px;
  }
}

/* ==========================================================================
   Diagnóstico — cuestionario, chequeos técnicos, resultado
   ========================================================================== */

.diag-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 100px;
  min-height: 60vh;
}

.diag-phase { display: none; }
.diag-phase.active { display: block; }

/* Progreso */
.diag-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}
.diag-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.diag-progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.diag-progress-label {
  font-size: 0.8rem;
  color: var(--gray-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Intro */
.diag-intro { text-align: left; }
.diag-intro .eyebrow { color: var(--red); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 18px; }
.diag-intro h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 18px;
}
.diag-intro p { color: var(--gray); font-size: 1.02rem; margin-bottom: 28px; max-width: 52ch; }
.diag-intro .diag-meta-row { display: flex; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.diag-meta-item { display: flex; align-items: center; gap: 8px; color: var(--gray-dim); font-size: 0.88rem; }

/* Quiz card */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
}
.quiz-category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.quiz-question {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 28px;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.96rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover { border-color: rgba(227, 28, 61, 0.5); background: rgba(227, 28, 61, 0.06); }
.quiz-option .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--gray-dim);
  flex-shrink: 0;
}
.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.quiz-back {
  background: none; border: none; color: var(--gray-dim);
  font-size: 0.88rem; cursor: pointer; padding: 8px 0;
}
.quiz-back:hover { color: var(--white); }

/* Chequeos técnicos */
.check-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 20px;
}
.check-block h3 { font-size: 1.02rem; margin-bottom: 6px; }
.check-block .check-desc { color: var(--gray); font-size: 0.88rem; margin-bottom: 18px; }
.check-loading { display: flex; align-items: center; gap: 10px; color: var(--gray-dim); font-size: 0.9rem; }
.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.port-chip {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--gray-dim);
}
.port-chip.risky { border-color: rgba(208, 59, 59, 0.4); background: rgba(208, 59, 59, 0.1); color: #ff8d8d; }

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.check-row:first-child { border-top: none; padding-top: 0; }
.check-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; border-radius: 50%; }
.check-icon.ok { background: rgba(12, 163, 12, 0.15); color: var(--status-good); }
.check-icon.missing { background: rgba(208, 59, 59, 0.15); color: var(--status-critical); }
.check-row-label { color: var(--white); }
.check-row-tip { color: var(--gray-dim); font-size: 0.82rem; margin-left: auto; text-align: right; max-width: 46%; }

.domain-form { display: flex; gap: 10px; margin-top: 4px; }
.domain-form input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--white); font-size: 0.94rem;
}
.domain-form input:focus { outline: none; border-color: var(--red); }
.skip-link { display: inline-block; margin-top: 16px; color: var(--gray-dim); font-size: 0.86rem; cursor: pointer; text-decoration: underline; }
.skip-link:hover { color: var(--white); }

/* Meter */
.meter-wrap { margin: 28px 0 8px; }
.meter-tier { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.meter-tier-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 700; flex-shrink: 0; }
.meter-tier-label { font-size: 1.05rem; font-weight: 700; }
.meter-score {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 18px;
}
.meter-score span { font-size: 1.2rem; font-weight: 600; color: var(--gray-dim); }
.meter-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.result-section { margin-top: 36px; }
.result-section h3 { font-size: 1.05rem; margin-bottom: 14px; }
.tip-list { display: flex; flex-direction: column; gap: 12px; }
.tip-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}
.tip-item .tip-icon { color: var(--status-warning); flex-shrink: 0; }
.tip-item strong { display: block; color: var(--white); margin-bottom: 2px; }
.tip-item span.desc { color: var(--gray-dim); font-size: 0.85rem; }

.result-cta {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .quiz-card { padding: 26px 20px; }
  .domain-form { flex-direction: column; }
  .check-row { flex-wrap: wrap; }
  .check-row-tip { max-width: 100%; text-align: left; margin-left: 30px; }
}

/* ==========================================================================
   Banner de emergencia — ataques / caídas de sistema
   ========================================================================== */

.emergency-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(227, 28, 61, 0.16), rgba(139, 14, 31, 0.1));
  border: 1px solid rgba(227, 28, 61, 0.35);
  border-radius: 18px;
  padding: 28px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.emergency-left { display: flex; align-items: center; gap: 18px; }

.emergency-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(227, 28, 61, 0.18);
  border: 1px solid rgba(227, 28, 61, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.emergency-eyebrow {
  color: var(--red);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.emergency-left h3 { font-size: 1.15rem; margin-bottom: 4px; }
.emergency-left p { color: var(--gray); font-size: 0.92rem; }

.emergency-phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 14px 24px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(227, 28, 61, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.emergency-phone:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(227, 28, 61, 0.45); }

@media (max-width: 640px) {
  .emergency-banner { flex-direction: column; align-items: flex-start; }
  .emergency-phone { width: 100%; justify-content: center; }
}
