/* ============================================================
   EXTRAS.CSS — Proyectos, proceso, testimonios, diagnóstico,
   FAQ, WhatsApp flotante, páginas legales y 404
   vortexlabs.cl
   ============================================================ */

/* ══ PROYECTOS ═════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Barra tipo navegador */
.project-browser {
  background: #0b1220;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.project-dots { display: flex; gap: 5px; }
.project-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-10);
  border: 1px solid var(--border);
}
.project-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-sub);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.9;
  max-height: 230px;
  width: 100%;
  background: #0b1220;
  border-bottom: 1px solid var(--border);
}
.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .5s ease;
}
.project-card:hover .project-preview img { transform: scale(1.06); }
.project-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(11,18,32,0.55) 100%);
  pointer-events: none;
}

/* ── Mini-dashboards en vivo (reemplazan screenshots estáticos) ── */
.project-preview.live-dash {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
}
.live-dash.theme-ventas     { background: radial-gradient(circle at 85% 0%, rgba(99,102,241,0.28), transparent 60%), #0d1024; }
.live-dash.theme-comercial  { background: radial-gradient(circle at 85% 0%, rgba(245,158,11,0.20), transparent 60%), #1a1408; }
.live-dash.theme-operacion  { background: radial-gradient(circle at 85% 0%, rgba(34,211,238,0.22), transparent 60%), #071a1c; }
.live-dash.theme-marketing  { background: radial-gradient(circle at 85% 0%, rgba(236,72,153,0.22), transparent 60%), #1a0a1c; }
.live-dash.theme-inventario { background: radial-gradient(circle at 85% 0%, rgba(74,222,128,0.20), transparent 60%), #0a160a; }

.live-head { display: flex; align-items: center; justify-content: space-between; }
.live-title { font-size: 0.82rem; font-weight: 700; color: #f8fafc; }
.live-live {
  display: flex; align-items: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: #34d399; animation: liveBlink 1.6s infinite; }
@keyframes liveBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.live-kpis { display: flex; gap: 1.1rem; }
.live-kpi { display: flex; flex-direction: column; gap: 2px; }
.live-kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem; color: #64748b;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.live-kpi-value { font-size: 0.95rem; font-weight: 700; color: #f8fafc; font-variant-numeric: tabular-nums; }

.live-canvas { flex: 1; width: 100%; display: block; min-height: 0; }

/* Barras de progreso (gestión comercial) */
.live-progress-list { display: flex; flex-direction: column; gap: 0.55rem; flex: 1; justify-content: center; }
.live-progress-row { display: flex; flex-direction: column; gap: 4px; }
.live-progress-top {
  display: flex; justify-content: space-between;
  font-size: 0.62rem; color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}
.live-progress-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.live-progress-fill { height: 100%; border-radius: 99px; width: 0%; transition: width 1.1s cubic-bezier(.16,1,.3,1); }

/* Funnel (marketing) */
.live-funnel { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; justify-content: center; }
.live-funnel-row {
  height: 22px; border-radius: 8px; width: 0%;
  display: flex; align-items: center; padding: 0 10px;
  font-size: 0.6rem; font-weight: 700; color: #1a0a1c;
  white-space: nowrap; overflow: hidden;
  transition: width 1s cubic-bezier(.16,1,.3,1);
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

.project-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.project-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-lt);
  background: var(--accent-10);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}
.project-body h3 { font-size: 0.98rem; font-weight: 700; color: var(--text); margin-bottom: 0.6rem; }
.project-line { font-size: 0.78rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0.45rem; }
.project-line strong { color: var(--text); font-weight: 600; }
.project-link {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-lt);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap .2s;
}
.project-link:hover { gap: 0.6rem; }

/* ══ DASHBOARDS SHOWCASE ═══════════════════════════════════ */
.dash-carousel { position: relative; max-width: 1180px; margin: 0 auto; }

.dash-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0;
  scrollbar-width: none;
}
.dash-track::-webkit-scrollbar { display: none; }

.dash-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  padding: 4px;
  box-sizing: border-box;
}

.dash-window {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
}
.dash-window.theme-ventas     { background: radial-gradient(circle at 90% -10%, rgba(99,102,241,0.22), transparent 55%), #0a0d1f; }
.dash-window.theme-finanzas   { background: radial-gradient(circle at 90% -10%, rgba(52,211,153,0.18), transparent 55%), #071a15; }
.dash-window.theme-comercial  { background: radial-gradient(circle at 90% -10%, rgba(129,140,248,0.20), transparent 55%), #0c0f22; }
.dash-window.theme-marketing  { background: radial-gradient(circle at 90% -10%, rgba(236,72,153,0.18), transparent 55%), #180a17; }
.dash-window.theme-inventario { background: radial-gradient(circle at 90% -10%, rgba(74,222,128,0.18), transparent 55%), #08170c; }

.dash-window-bar {
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.dash-dots { display: flex; gap: 6px; }
.dash-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.14); }
.dash-window-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-sub);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.9rem;
}

.dash-window-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.75rem 0.5rem;
  gap: 1rem;
}
.dash-window-title { font-size: 1.3rem; font-weight: 700; color: #f8fafc; }
.dash-window-sub { font-size: 0.82rem; color: #94a3b8; margin-top: 0.2rem; }

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem 1.75rem;
}
.dash-kpi {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dash-kpi-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}
.dash-kpi-value { font-size: 1.4rem; font-weight: 700; color: #f8fafc; font-variant-numeric: tabular-nums; }
.dash-kpi-delta { font-size: 0.72rem; font-weight: 600; }
.dash-kpi-delta.up { color: #34d399; }
.dash-kpi-delta.down { color: #fb7185; }

.dash-charts-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.1rem;
  padding: 0.25rem 1.75rem 1.75rem;
}
.dash-chart-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.dash-chart-title {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.dash-canvas { flex: 1; width: 100%; display: block; min-height: 0; }

/* Progress list (comercial) */
.dash-progress-list { display: flex; flex-direction: column; gap: 0.9rem; flex: 1; justify-content: center; }
.dash-progress-row { display: flex; flex-direction: column; gap: 6px; }
.dash-progress-top { display: flex; justify-content: space-between; font-size: 0.76rem; color: #cbd5e1; font-family: 'JetBrains Mono', monospace; }
.dash-progress-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.dash-progress-fill { height: 100%; border-radius: 99px; width: 0%; transition: width 1.1s cubic-bezier(.16,1,.3,1); }

/* Funnel (marketing) */
.dash-funnel { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; justify-content: center; }
.dash-funnel-row {
  height: 30px; border-radius: 8px; width: 0%;
  display: flex; align-items: center; padding: 0 12px;
  font-size: 0.72rem; font-weight: 700; color: #1a0a1c;
  white-space: nowrap; overflow: hidden;
  transition: width 1.1s cubic-bezier(.16,1,.3,1);
}

.dash-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
}
.dash-nav:hover { border-color: var(--border-hover); background: var(--accent-10); }
.dash-nav-prev { left: -22px; }
.dash-nav-next { right: -22px; }
@media (max-width: 900px) {
  .dash-nav { display: none; }
}

.dash-dots-nav { display: flex; justify-content: center; gap: 8px; margin-top: 1.25rem; }
.dash-dots-nav button {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-10);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.dash-dots-nav button.active { background: var(--accent); transform: scale(1.3); }

@media (max-width: 860px) {
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-charts-row { grid-template-columns: 1fr; }
  .dash-window-title { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .dash-window-head { padding: 1.1rem 1.1rem 0.4rem; }
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; padding: 0.75rem 1.1rem; }
  .dash-kpi { padding: 0.7rem 0.8rem; }
  .dash-kpi-value { font-size: 1.15rem; }
  .dash-charts-row { padding: 0.25rem 1.1rem 1.25rem; gap: 0.8rem; }
  .dash-chart-card { min-height: 200px; padding: 0.85rem; }
  .dash-window-bar { padding: 0.6rem 0.85rem; }
  .dash-window-url { font-size: 0.62rem; padding: 0.25rem 0.6rem; }
}

/* ══ PROCESO ═══════════════════════════════════════════════ */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  counter-reset: paso;
}
.process-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: border-color .3s, transform .3s;
}
.process-step:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.process-step::before {
  counter-increment: paso;
  content: "Paso " counter(paso);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-lt);
  display: block;
  margin-bottom: 0.75rem;
}
.process-step h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.process-step p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; }
.process-step .process-dur {
  margin-top: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-sub);
}

/* ══ TESTIMONIOS ═══════════════════════════════════════════ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 860px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.testimonial-quote { font-size: 0.9rem; color: var(--text); line-height: 1.7; }
.testimonial-quote::before { content: '“'; color: var(--accent); font-size: 1.4rem; }
.testimonial-quote::after  { content: '”'; color: var(--accent); font-size: 1.4rem; }
.testimonial-meta { margin-top: auto; }
.testimonial-name { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.testimonial-role { font-size: 0.72rem; color: var(--text-sub); font-family: 'JetBrains Mono', monospace; }

/* ══ DIAGNÓSTICO INTERACTIVO ═══════════════════════════════ */
.quiz-wrapper {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem;
  position: relative;
  overflow: hidden;
}
.quiz-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-lt));
}

.quiz-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 1.75rem;
}
.quiz-progress span {
  flex: 1; height: 4px; border-radius: 999px;
  background: var(--accent-10);
  transition: background .3s;
}
.quiz-progress span.done { background: var(--accent); }

.quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.quiz-options { display: flex; flex-direction: column; gap: 0.65rem; }
.quiz-option {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: border-color .2s, background .2s, color .2s;
}
.quiz-option:hover, .quiz-option:focus-visible {
  border-color: var(--accent);
  background: var(--accent-10);
  color: var(--text);
  outline: none;
}

.quiz-result { text-align: center; }
.quiz-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--accent-lt);
  line-height: 1;
}
.quiz-score small { font-size: 1rem; color: var(--text-sub); }
.quiz-tier {
  display: inline-block;
  margin: 0.9rem 0 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-lt);
  background: var(--accent-10);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
}
.quiz-result h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 0.6rem; }
.quiz-result p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; max-width: 480px; margin: 0 auto 1.5rem; }

.quiz-lead-form { max-width: 440px; margin: 0 auto 0.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-lead-row { display: flex; gap: 0.6rem; }
.quiz-lead-row input,
.quiz-email-row input {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  min-width: 0;
}
.quiz-lead-row input:focus,
.quiz-email-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-20); }
.quiz-email-row {
  display: flex;
  gap: 0.6rem;
}
.quiz-note { font-size: 0.72rem; color: var(--text-sub); }
.quiz-restart {
  background: none; border: none; cursor: pointer;
  color: var(--text-sub); font-size: 0.75rem;
  text-decoration: underline; margin-top: 1rem;
  font-family: inherit;
}
.quiz-restart:hover { color: var(--accent-lt); }

@media (max-width: 540px) {
  .quiz-wrapper { padding: 1.5rem; }
  .quiz-lead-row { flex-direction: column; }
  .quiz-email-row { flex-direction: column; }
  .quiz-question { font-size: 1.05rem; }
  .quiz-option { padding: 1rem 1.1rem; }
}

/* ══ FAQ ═══════════════════════════════════════════════════ */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .3s;
}
.faq-item[open] { border-color: var(--border-hover); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-lt);
  font-size: 1.1rem;
  transition: transform .2s;
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 1.4rem 1.2rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ══ WHATSAPP FLOTANTE ═════════════════════════════════════ */
.wa-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  transition: transform .2s, box-shadow .2s;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 12px 30px rgba(37,211,102,0.35); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* ══ PÁGINAS LEGALES / 404 ═════════════════════════════════ */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 120px 5vw 80px;
}
@media (max-width: 480px) {
  .legal-page { padding: 100px 6vw 60px; }
  .legal-page h1 { font-size: 1.4rem; }
}
.legal-page h1 { font-size: 1.8rem; color: var(--text); margin-bottom: 0.5rem; }
.legal-page .legal-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; color: var(--text-sub);
  margin-bottom: 2.5rem;
}
.legal-page h2 { font-size: 1.05rem; color: var(--text); margin: 2rem 0 0.6rem; }
.legal-page p, .legal-page li { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }
.legal-page ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.legal-page a { color: var(--accent-lt); }

.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.page-404 .code-404 {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(4rem, 15vw, 7rem);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.25;
  line-height: 1;
}
.page-404 h1 { font-size: 1.5rem; color: var(--text); margin: 1rem 0 0.5rem; }
.page-404 p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* ══ ACCESIBILIDAD / MOTION ════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
