/* ============================================================
   TEST VOCACIONAL INTELIGENTE — CSS PREMIUM
   Colegios del Perú 2025
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --tv-bg:       #f0f4f8;
  --tv-surface:  #ffffff;
  --tv-primary:  #0f172a;
  --tv-accent:   #0891b2;
  --tv-accent2:  #06b6d4;
  --tv-grad:     linear-gradient(135deg, #0f172a 0%, #0e7490 55%, #0891b2 100%);
  --tv-border:   #cbd5e1;
  --tv-muted:    #64748b;
  --tv-text:     #1e293b;
  --tv-gold:     #f59e0b;
  --tv-green:    #10b981;
  --tv-shadow:   0 4px 24px rgba(8,145,178,.10);
  --tv-shadow-lg:0 20px 60px rgba(15,23,42,.18);
  --tv-radius:   20px;
  --tv-radius-sm:12px;

  /* Colores áreas */
  --c-ing:  #3b82f6;
  --c-sal:  #ef4444;
  --c-soc:  #8b5cf6;
  --c-edu:  #f59e0b;
  --c-neg:  #10b981;
  --c-art:  #ec4899;
}

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

body.page-test-vocacional {
  background: var(--tv-bg);
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--tv-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── HERO ─────────────────────────────────────────────────── */
.tv-hero {
  background: var(--tv-grad);
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tv-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.06) 0%, transparent 60%);
}

.tv-hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.tv-hero-particles span {
  position: absolute;
  display: block;
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  animation: floatParticle 8s infinite ease-in-out;
}
.tv-hero-particles span:nth-child(1)  { left:10%; top:20%; animation-delay:0s; }
.tv-hero-particles span:nth-child(2)  { left:25%; top:60%; animation-delay:1s; width:5px;height:5px; }
.tv-hero-particles span:nth-child(3)  { left:50%; top:10%; animation-delay:2s; width:12px;height:12px; }
.tv-hero-particles span:nth-child(4)  { left:75%; top:50%; animation-delay:3s; }
.tv-hero-particles span:nth-child(5)  { left:90%; top:25%; animation-delay:4s; width:6px;height:6px; }
.tv-hero-particles span:nth-child(6)  { left:40%; top:80%; animation-delay:1.5s; width:4px;height:4px; }

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) scale(1); opacity: .5; }
  50%       { transform: translateY(-20px) scale(1.2); opacity: 1; }
}

.tv-hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.tv-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #e9d5ff;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.tv-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
}

.tv-hero h1 span {
  background: linear-gradient(90deg, #f0abfc, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tv-hero p {
  color: rgba(255,255,255,.80);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 36px;
}

.tv-hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tv-hero-stat {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 12px 24px;
  text-align: center;
}
.tv-hero-stat .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  display: block;
}
.tv-hero-stat .lbl {
  font-size: 12px;
  color: rgba(255,255,255,.7);
}

/* ── START CARD ──────────────────────────────────────────── */
.tv-start-section {
  max-width: 680px;
  margin: -32px auto 60px;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.tv-start-card {
  background: var(--tv-surface);
  border-radius: var(--tv-radius);
  box-shadow: var(--tv-shadow-lg);
  padding: 40px;
  text-align: center;
  border: 1px solid var(--tv-border);
}

.tv-start-icon {
  width: 80px;
  height: 80px;
  background: var(--tv-grad);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(124,58,237,.3);
}

.tv-start-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tv-primary);
  margin-bottom: 12px;
}

.tv-start-card p {
  color: var(--tv-muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.tv-name-input-wrap {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tv-name-input {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  border: 2px solid var(--tv-border);
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all .2s;
  color: var(--tv-text);
}
.tv-name-input:focus {
  border-color: var(--tv-accent);
  box-shadow: 0 0 0 4px rgba(124,58,237,.12);
}

/* Características del test */
.tv-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.tv-feature {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}

.tv-feature-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 18px;
  color: #fff;
}

.tv-feature-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tv-accent);
}

.tv-feature-sub {
  font-size: 11px;
  color: var(--tv-muted);
  margin-top: 2px;
}

.tv-start-btn {
  width: 100%;
  background: var(--tv-grad);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px 32px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: .3px;
  box-shadow: 0 8px 24px rgba(8,145,178,.35);
}
.tv-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(8,145,178,.50);
}

/* ── TEST CONTAINER ──────────────────────────────────────── */
.tv-test-container {
  display: none;
  min-height: 100vh;
  position: relative;
}

.tv-test-container.active { display: flex; flex-direction: column; }

/* Progress bar */
.tv-progress-bar-wrap {
  background: #e0f2fe;
  height: 6px;
  border-radius: 3px;
  margin: 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 100;
}
.tv-progress-bar-fill {
  height: 100%;
  background: var(--tv-grad);
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.tv-progress-info {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tv-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 6px;
  z-index: 99;
}

.tv-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--tv-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-progress-pct {
  font-size: 13px;
  color: var(--tv-muted);
  font-weight: 600;
}

/* ── QUESTION SCREEN ─────────────────────────────────────── */
.tv-question-screen {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 32px 24px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  gap: 40px;
}

/* MENTOR SECTION (izquierda) */
.tv-mentor-section {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: sticky;
  top: 80px;
}

.tv-mentor-img-wrap {
  position: relative;
  width: 200px;
  height: 280px;
  transition: all .4s cubic-bezier(.34, 1.56, .64, 1);
}

.tv-mentor-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  transition: all .4s ease;
  filter: drop-shadow(0 8px 24px rgba(124,58,237,.2));
}

.tv-mentor-img.fade-out {
  opacity: 0;
  transform: scale(.95) translateY(4px);
}

.tv-mentor-img.fade-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Burbuja de mensaje del mentor */
.tv-mentor-bubble {
  background: var(--tv-surface);
  border: 2px solid var(--tv-border);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--tv-primary);
  font-weight: 500;
  line-height: 1.5;
  box-shadow: var(--tv-shadow);
  position: relative;
  margin-top: -8px;
  max-width: 190px;
  text-align: left;
  transition: all .35s ease;
}

.tv-mentor-bubble.entering {
  animation: bubbleIn .4s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tv-mentor-bubble::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--tv-accent);
  border-radius: 50%;
  margin-bottom: 6px;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* CONTENT SECTION (derecha) */
.tv-question-content {
  flex: 1;
  min-width: 0;
}

/* Número de pregunta */
.tv-q-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e0f2fe;
  color: var(--tv-accent);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: .5px;
}

/* Área tag */
.tv-q-area-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 20px;
  margin-left: 8px;
  letter-spacing: .3px;
}

/* Pregunta */
.tv-question-text {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--tv-primary);
  line-height: 1.5;
  margin-bottom: 32px;
  transition: all .35s ease;
}

.tv-question-text.exiting {
  animation: questionExit .25s ease forwards;
}
.tv-question-text.entering {
  animation: questionEnter .35s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes questionExit {
  to { opacity: 0; transform: translateX(-20px); }
}
@keyframes questionEnter {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Opciones de respuesta */
.tv-options-grid {
  display: grid;
  gap: 12px;
}

.tv-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--tv-surface);
  border: 2px solid var(--tv-border);
  border-radius: 14px;
  padding: 18px 22px;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.tv-option-btn:hover {
  border-color: var(--tv-accent);
  background: #f0f9ff;
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(8,145,178,.12);
}

.tv-option-btn.selected {
  border-color: var(--tv-accent);
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  box-shadow: 0 4px 20px rgba(8,145,178,.2);
}

.tv-option-btn.correct-anim {
  animation: correctPulse .4s ease;
}

@keyframes correctPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.tv-option-letter {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--tv-muted);
  flex-shrink: 0;
  transition: all .2s;
}

.tv-option-btn:hover .tv-option-letter,
.tv-option-btn.selected .tv-option-letter {
  background: var(--tv-accent);
  color: #fff;
}

.tv-option-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--tv-text);
  line-height: 1.45;
}

.tv-option-pts {
  margin-left: auto;
  font-size: 11px;
  color: var(--tv-muted);
  flex-shrink: 0;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

/* Navigation */
.tv-nav-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}

.tv-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border: none;
  font-family: 'Inter', sans-serif;
}

.tv-nav-btn.prev {
  background: #f3f4f6;
  color: var(--tv-muted);
}
.tv-nav-btn.prev:hover { background: #e5e7eb; }

.tv-nav-btn.next {
  background: var(--tv-grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(8,145,178,.30);
}
.tv-nav-btn.next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8,145,178,.45);
}
.tv-nav-btn.next:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── RESULTADO ───────────────────────────────────────────── */
#tv-results {
  display: none;
  padding: 40px 24px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.tv-result-hero {
  background: var(--tv-grad);
  border-radius: var(--tv-radius);
  padding: 40px 48px;
  color: #fff;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.tv-result-hero::before {
  content: '🎉';
  position: absolute;
  font-size: 120px;
  top: -20px;
  right: -20px;
  opacity: .1;
}

.tv-result-hero h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.tv-result-hero p {
  font-size: 1.05rem;
  opacity: .85;
  margin: 0;
}

/* KPIs resultado */
.tv-result-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.tv-result-kpi {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-sm);
  padding: 20px;
  text-align: center;
  box-shadow: var(--tv-shadow);
  transition: transform .2s;
}
.tv-result-kpi:hover { transform: translateY(-3px); }

.tv-result-kpi-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 20px;
  color: #fff;
}
.tv-result-kpi-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--tv-primary);
  margin-bottom: 4px;
}
.tv-result-kpi-label {
  font-size: 12px;
  color: var(--tv-muted);
  font-weight: 500;
}

/* IA Analysis card */
.tv-ia-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 2px solid #7dd3fc;
  border-radius: var(--tv-radius);
  padding: 32px;
  margin-bottom: 28px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.tv-ia-avatar {
  width: 64px;
  height: 64px;
  background: var(--tv-grad);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124,58,237,.3);
}

.tv-ia-content h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--tv-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-ia-content p, .tv-ia-text {
  font-size: 14.5px;
  color: #4b5563;
  line-height: 1.72;
  white-space: pre-wrap;
}

.tv-ia-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tv-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 8px;
}

/* Radar chart */
.tv-charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.tv-chart-card {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-sm);
  padding: 28px;
  box-shadow: var(--tv-shadow);
}

.tv-chart-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--tv-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tv-chart-card h3 i { color: var(--tv-accent); }

.tv-chart-wrap {
  position: relative;
  height: 260px;
}

/* Carreras recomendadas */
.tv-carreras-section {
  margin-bottom: 28px;
}

.tv-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--tv-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tv-section-title i { color: var(--tv-accent); }

.tv-carreras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.tv-carrera-card {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--tv-shadow);
  transition: all .25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tv-carrera-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
}

.tv-carrera-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--tv-shadow-lg);
  border-color: var(--tv-accent);
}

.tv-carrera-card.area-ingenieria::before { background: var(--c-ing); }
.tv-carrera-card.area-salud::before      { background: var(--c-sal); }
.tv-carrera-card.area-sociales::before   { background: var(--c-soc); }
.tv-carrera-card.area-educacion::before  { background: var(--c-edu); }
.tv-carrera-card.area-negocios::before   { background: var(--c-neg); }
.tv-carrera-card.area-arte::before       { background: var(--c-art); }

.tv-carrera-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--tv-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tv-carrera-area-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 3px;
}

.area-ingenieria .tv-carrera-area-badge { background: var(--c-ing); }
.area-salud      .tv-carrera-area-badge { background: var(--c-sal); }
.area-sociales   .tv-carrera-area-badge { background: var(--c-soc); }
.area-educacion  .tv-carrera-area-badge { background: var(--c-edu); }
.area-negocios   .tv-carrera-area-badge { background: var(--c-neg); }
.area-arte       .tv-carrera-area-badge { background: var(--c-art); }

.tv-carrera-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tv-carrera-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--tv-muted);
}
.tv-carrera-stat i { font-size: 12px; color: var(--tv-accent); }
.tv-carrera-stat strong { color: var(--tv-text); }

.tv-carrera-ctas {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tv-carrera-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: all .2s;
  border: 1px solid var(--tv-border);
  color: var(--tv-accent);
  background: #f9f5ff;
  cursor: pointer;
}
.tv-carrera-cta:hover {
  background: var(--tv-accent);
  color: #fff;
  border-color: var(--tv-accent);
}

/* ── MAPA ─────────────────────────────────────────────────── */
.tv-map-wrapper {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-sm);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--tv-shadow);
}

.tv-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--tv-border);
  flex-wrap: wrap;
  gap: 12px;
}

.tv-map-select {
  padding: 8px 14px;
  border: 1.5px solid var(--tv-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--tv-text);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  background: #fff;
}
.tv-map-select:focus { border-color: var(--tv-accent); }

#tv-result-map { height: 400px; }

/* ── CHAT IA ─────────────────────────────────────────────── */
.tv-chat-section {
  margin-bottom: 40px;
}

.tv-chat-toggle-btn {
  width: 100%;
  background: var(--tv-grad);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 20px 28px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(124,58,237,.3);
  margin-bottom: 16px;
}
.tv-chat-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(124,58,237,.4);
}

.tv-chat-box {
  display: none;
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-sm);
  box-shadow: var(--tv-shadow);
  overflow: hidden;
}

.tv-chat-box.open { display: flex; flex-direction: column; }

.tv-chat-messages {
  height: 360px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.tv-chat-msg {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  animation: msgIn .25s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tv-chat-msg.ai {
  background: linear-gradient(135deg, #f9f5ff, #ede9fe);
  border: 1px solid #d8b4fe;
  color: var(--tv-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.tv-chat-msg.user {
  background: var(--tv-grad);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.tv-chat-msg-sender {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: .7;
}

.tv-chat-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: #f9f5ff;
  border-radius: 12px;
  align-self: flex-start;
  width: fit-content;
}
.tv-typing-dot {
  width: 7px;
  height: 7px;
  background: var(--tv-accent);
  border-radius: 50%;
  animation: typingBounce .8s infinite;
}
.tv-typing-dot:nth-child(2) { animation-delay: .15s; }
.tv-typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes typingBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.tv-chat-input-wrap {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--tv-border);
  background: #fafafa;
}

.tv-chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--tv-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.tv-chat-input:focus { border-color: var(--tv-accent); }

.tv-chat-send {
  background: var(--tv-grad);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
  transition: all .2s;
}
.tv-chat-send:hover { transform: scale(1.05); }
.tv-chat-send:disabled { opacity: .5; cursor: not-allowed; }

/* ── CTAs finales ────────────────────────────────────────── */
.tv-final-ctas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.tv-final-cta {
  background: var(--tv-surface);
  border: 1px solid var(--tv-border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all .22s;
  box-shadow: var(--tv-shadow);
}
.tv-final-cta:hover {
  transform: translateY(-3px);
  box-shadow: var(--tv-shadow-lg);
  border-color: var(--tv-accent);
}

.tv-final-cta-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.tv-final-cta-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tv-primary);
  margin-bottom: 4px;
}
.tv-final-cta-sub {
  font-size: 12px;
  color: var(--tv-muted);
}

/* ── RETRY BTN ───────────────────────────────────────────── */
.tv-retry-section {
  text-align: center;
  margin-bottom: 24px;
}

.tv-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #f3f4f6;
  border: 2px solid var(--tv-border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--tv-muted);
  cursor: pointer;
  transition: all .2s;
  font-family: 'Inter', sans-serif;
}
.tv-retry-btn:hover {
  background: var(--tv-bg);
  border-color: var(--tv-accent);
  color: var(--tv-accent);
}

/* ── LOADING OVERLAY ─────────────────────────────────────── */
.tv-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}
.tv-loading-overlay.visible { display: flex; }

.tv-loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tv-loading-text {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.tv-loading-sub {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  margin-top: 4px;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .tv-question-screen {
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 40px;
    gap: 20px;
  }

  .tv-mentor-section {
    position: static;
    width: 140px;
    flex-direction: row;
    gap: 12px;
    align-items: flex-end;
    width: 100%;
  }

  .tv-mentor-img-wrap {
    width: 110px;
    height: 160px;
    flex-shrink: 0;
  }

  .tv-mentor-bubble {
    max-width: 100%;
    flex: 1;
    margin-top: 0;
    border-radius: 16px 16px 16px 4px;
  }

  .tv-tv-features {
    grid-template-columns: 1fr;
  }

  .tv-charts-section {
    grid-template-columns: 1fr;
  }

  .tv-ia-card {
    flex-direction: column;
  }

  .tv-start-card { padding: 28px 20px; }
  .tv-features { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .tv-nav-btns { flex-wrap: wrap; gap: 10px; }
  .tv-nav-btn { flex: 1; justify-content: center; }
}

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .tv-chat-section, .tv-final-ctas, .tv-retry-section,
  .tv-hero, .tv-start-section, .tv-test-container { display: none !important; }
  body { background: #fff; }
  #tv-results { display: block !important; padding: 0; }
}

/* Tooltip */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 7px;
  white-space: nowrap;
  z-index: 99;
  margin-bottom: 6px;
  pointer-events: none;
}
