/* ═══════════════════════════════════════════════════════════
   TIPO ESTUDIANTE — Colegios del Perú
   Herramienta IA · Perfil del Estudiante
   ══════════════════════════════════════════════════════════ */

:root {
  --te-disciplinado:    #10b981;
  --te-disciplinado-bg: #d1fae5;
  --te-procrastinador:    #f97316;
  --te-procrastinador-bg: #ffedd5;
  --te-estratega:    #6366f1;
  --te-estratega-bg: #e0e7ff;
  --te-creativo:    #ec4899;
  --te-creativo-bg: #fce7f3;
}

/* ─── HERO ─────────────────────────────────────────────── */
.te-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  padding: 120px 1.5rem 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.te-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,.25), transparent);
  pointer-events: none;
}
.te-particles { position: absolute; inset: 0; pointer-events: none; }
.te-particles span {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(139,92,246,.6);
  animation: teFloat 8s infinite ease-in-out;
}
.te-particles span:nth-child(1)  { left:8%;   top:25%; animation-delay:0s;   }
.te-particles span:nth-child(2)  { left:22%;  top:60%; animation-delay:1.2s; }
.te-particles span:nth-child(3)  { left:40%;  top:15%; animation-delay:0.5s; }
.te-particles span:nth-child(4)  { left:65%;  top:50%; animation-delay:2s;   }
.te-particles span:nth-child(5)  { left:80%;  top:20%; animation-delay:1.5s; }
.te-particles span:nth-child(6)  { left:92%;  top:70%; animation-delay:0.8s; }
.te-particles span:nth-child(7)  { left:50%;  top:80%; animation-delay:3s;   }

@keyframes teFloat {
  0%, 100% { transform: translateY(0) scale(1);    opacity: 0.4; }
  50%       { transform: translateY(-28px) scale(1.3); opacity: 0.9; }
}
.te-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(139,92,246,.15); border: 1px solid rgba(139,92,246,.4);
  color: #c4b5fd; padding: 6px 18px; border-radius: 99px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 24px;
}
.te-hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; color: #fff;
  line-height: 1.12; margin: 0 0 16px;
}
.te-hero h1 span {
  background: linear-gradient(90deg, #a78bfa, #ec4899);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.te-hero p { color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 580px; margin: 0 auto 36px; }
.te-hero-stats { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; margin-bottom: 40px; }
.te-hero-stat { text-align: center; }
.te-hero-stat .num { display: block; font-size: 1.6rem; font-weight: 900; color: #fff; }
.te-hero-stat .lbl { font-size: .72rem; color: #a5b4fc; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ─── START CARD ────────────────────────────────────────── */
.te-start-section {
  display: flex; justify-content: center; padding: 0 1.5rem 80px;
  margin-top: -50px; position: relative; z-index: 2;
}
.te-start-card {
  background: #fff; border-radius: 28px;
  box-shadow: 0 20px 60px rgba(99,102,241,.18);
  padding: 48px 48px 40px; max-width: 620px; width: 100%;
  text-align: center; border: 1px solid rgba(99,102,241,.12);
}
.te-start-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; font-size: 2rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}
.te-start-card h2 { font-size: 1.6rem; font-weight: 900; color: #1e1b4b; margin: 0 0 12px; }
.te-start-card p  { color: #64748b; font-size: .95rem; margin: 0 0 28px; line-height: 1.6; }
.te-name-input {
  width: 100%; padding: 14px 18px; border: 2px solid #e2e8f0; border-radius: 14px;
  font-size: .95rem; font-family: inherit; outline: none; margin-bottom: 24px;
  transition: border-color .2s;
}
.te-name-input:focus { border-color: #6366f1; }
.te-profiles-preview { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.te-profile-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px;
  border-radius: 99px; font-size: .78rem; font-weight: 700;
}
.te-profile-chip.d { background: var(--te-disciplinado-bg); color: #065f46; }
.te-profile-chip.p { background: var(--te-procrastinador-bg); color: #9a3412; }
.te-profile-chip.e { background: var(--te-estratega-bg); color: #312e81; }
.te-profile-chip.c { background: var(--te-creativo-bg); color: #831843; }

.te-start-btn {
  width: 100%; padding: 16px 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border: none; border-radius: 16px;
  font-size: 1rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}
.te-start-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(99,102,241,.45); }

/* ─── TEST CONTAINER ────────────────────────────────────── */
.te-test-container { display: none; max-width: 1000px; margin: 0 auto; padding: 0 1.5rem 80px; }
.te-test-container.active { display: block; }

.te-progress-wrap { background: #e2e8f0; border-radius: 99px; height: 6px; margin-bottom: 8px; overflow: hidden; }
.te-progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #ec4899); border-radius: 99px; transition: width .5s ease; }
.te-progress-info { display: flex; justify-content: space-between; font-size: .8rem; color: #64748b; font-weight: 600; margin-bottom: 28px; }

.te-question-screen { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }

/* Mentor */
.te-mentor-section { text-align: center; }
.te-mentor-img-wrap {
  width: 160px; height: 160px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px;
  border: 3px solid #e0e7ff; box-shadow: 0 8px 24px rgba(99,102,241,.2);
  animation: teMentorFloat 4s ease-in-out infinite;
}
@keyframes teMentorFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.te-mentor-img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.te-mentor-img.fading { opacity: 0; }
.te-mentor-bubble {
  background: #fff; border: 2px solid #e0e7ff; border-radius: 16px 16px 16px 4px;
  padding: 12px 16px; font-size: .82rem; color: #4338ca; font-weight: 600;
  box-shadow: 0 4px 12px rgba(99,102,241,.12); line-height: 1.4;
  animation: teBubbleIn .4s ease;
}
@keyframes teBubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Question card */
.te-question-card {
  background: #fff; border-radius: 24px; padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,.08); border: 1px solid #f1f5f9;
}
.te-q-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.te-q-num  { background: #e0e7ff; color: #4338ca; font-size: .75rem; font-weight: 800;
             padding: 4px 12px; border-radius: 99px; }
.te-q-cat  { font-size: .75rem; color: #94a3b8; font-weight: 600; }
.te-q-icon { font-size: 1.2rem; }
.te-question-text { font-size: 1.15rem; font-weight: 800; color: #1e293b; margin-bottom: 20px; line-height: 1.4; }
.te-options-grid { display: grid; gap: 12px; }
.te-option-btn {
  width: 100%; text-align: left; padding: 14px 18px;
  background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 14px;
  cursor: pointer; display: flex; align-items: center; gap: 12px;
  font-size: .9rem; font-weight: 600; color: #374151;
  transition: all .2s; font-family: inherit;
}
.te-option-btn:hover { border-color: #6366f1; background: #eef2ff; color: #4338ca; transform: translateX(4px); }
.te-option-btn.selected { border-color: #6366f1; background: linear-gradient(135deg, #eef2ff, #f0fdf4); color: #1e1b4b; }
.te-option-btn.selected .te-opt-letter { background: #6366f1; color: #fff; }
.te-opt-letter {
  width: 28px; height: 28px; border-radius: 50%; background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800; flex-shrink: 0; transition: all .2s;
}
.te-nav-btns { display: flex; justify-content: space-between; margin-top: 20px; }
.te-nav-btn {
  padding: 10px 24px; border: 2px solid #e2e8f0; border-radius: 12px;
  background: #fff; color: #4b5563; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
  display: flex; align-items: center; gap: 8px;
}
.te-nav-btn.next { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-color: transparent; }
.te-nav-btn:hover:not(:disabled) { transform: translateY(-1px); }
.te-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── LOADING OVERLAY ───────────────────────────────────── */
.te-loading {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.82); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; flex-direction: column; gap: 20px;
}
.te-loading.visible { display: flex; }
.te-loading-spinner {
  width: 56px; height: 56px; border: 5px solid rgba(139,92,246,.2);
  border-top-color: #8b5cf6; border-radius: 50%;
  animation: teSpinner 0.9s linear infinite;
}
@keyframes teSpinner { to { transform: rotate(360deg); } }
.te-loading-msg { color: #e2e8f0; font-size: 1rem; font-weight: 600; text-align: center; animation: teMsgFade 0.5s ease; }
.te-loading-sub  { color: #94a3b8; font-size: .82rem; font-weight: 500; }
@keyframes teMsgFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─── RESULTS ───────────────────────────────────────────── */
.te-results { display: none; padding: 0 1.5rem 80px; }
.te-results.visible { display: block; padding-top: 60px; }
.te-results-wrap { max-width: 1000px; margin: 0 auto; }

.te-result-hero { text-align: center; margin-bottom: 36px; }
.te-result-hero h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; color: #1e1b4b; margin: 0 0 8px; }
.te-result-hero p  { color: #64748b; font-size: .95rem; }

/* Profile card */
.te-profile-card {
  border-radius: 28px; padding: 40px 36px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 32px;
  box-shadow: 0 16px 48px rgba(0,0,0,.12);
  color: #fff; position: relative; overflow: hidden;
}
.te-profile-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.te-profile-emoji { font-size: 4rem; flex-shrink: 0; animation: teEmojiPop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes teEmojiPop { from { transform: scale(0); } to { transform: scale(1); } }
.te-profile-info { flex: 1; }
.te-profile-type  { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.te-profile-name  { font-size: 2rem; font-weight: 900; margin: 4px 0 8px; line-height: 1.1; }
.te-profile-desc  { font-size: .95rem; opacity: .9; line-height: 1.5; }
.te-profile-score { font-size: .82rem; opacity: .75; margin-top: 8px; }

/* Profile-specific gradients */
.te-profile-card.disciplinado   { background: linear-gradient(135deg, #064e3b, #065f46, #059669); }
.te-profile-card.procrastinador { background: linear-gradient(135deg, #7c2d12, #9a3412, #c2410c); }
.te-profile-card.estratega      { background: linear-gradient(135deg, #312e81, #3730a3, #4f46e5); }
.te-profile-card.creativo       { background: linear-gradient(135deg, #831843, #9d174d, #be185d); }

/* Scores grid */
.te-scores-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.te-score-box {
  background: #fff; border-radius: 16px; padding: 18px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.06); text-align: center;
  border-top: 4px solid currentColor;
}
.te-score-box.disciplinado   { color: var(--te-disciplinado); }
.te-score-box.procrastinador { color: var(--te-procrastinador); }
.te-score-box.estratega      { color: var(--te-estratega); }
.te-score-box.creativo       { color: var(--te-creativo); }
.te-score-val  { font-size: 1.8rem; font-weight: 900; }
.te-score-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #64748b; margin-top: 4px; }
.te-score-bar-wrap { height: 6px; background: #e2e8f0; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.te-score-bar { height: 100%; border-radius: 99px; background: currentColor; transition: width 1s ease; }

/* Charts */
.te-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.te-chart-card { background: #fff; border-radius: 20px; padding: 24px; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.te-chart-card h3 { font-size: .9rem; font-weight: 800; color: #374151; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.te-chart-card h3 i { color: #6366f1; }
.te-chart-wrap { height: 220px; position: relative; }

/* AI Analysis card */
.te-ai-card {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border-radius: 24px; padding: 32px; margin-bottom: 28px;
  color: #f1f5f9; border: 1px solid rgba(139,92,246,.25);
  box-shadow: 0 8px 32px rgba(99,102,241,.15);
}
.te-ai-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.te-ai-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
}
.te-ai-title { font-size: 1.1rem; font-weight: 800; }
.te-ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(99,102,241,.25); border: 1px solid rgba(139,92,246,.4);
  color: #c4b5fd; padding: 3px 10px; border-radius: 99px; font-size: .7rem; font-weight: 700;
}
.te-ai-analisis { font-size: .9rem; line-height: 1.7; color: #cbd5e1; margin-bottom: 24px; }
.te-ai-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.te-ai-section h4 { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin: 0 0 12px; }
.te-ai-section.fortalezas h4 { color: #34d399; }
.te-ai-section.debilidades h4 { color: #fbbf24; }
.te-ai-section.recomendaciones { grid-column: 1 / -1; }
.te-ai-section.recomendaciones h4 { color: #67e8f9; }
.te-tag {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  font-size: .78rem; font-weight: 700; margin: 3px 3px 3px 0;
}
.te-tag.green { background: rgba(16,185,129,.18); color: #34d399; border: 1px solid rgba(52,211,153,.25); }
.te-tag.orange { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.25); }
.te-rec-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .88rem; color: #cbd5e1; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.te-rec-item:last-child { border-bottom: none; }
.te-rec-icon { color: #67e8f9; font-size: .75rem; margin-top: 3px; flex-shrink: 0; }

/* Mentor in results */
.te-result-mentor { display: flex; align-items: center; gap: 20px; background: #fff; border-radius: 20px; padding: 20px 24px; margin-bottom: 28px; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.te-result-mentor-img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 3px solid #e0e7ff; flex-shrink: 0; animation: teMentorFloat 4s ease-in-out infinite; }
.te-result-mentor-msg { font-size: .9rem; color: #4338ca; font-weight: 600; line-height: 1.5; }

/* CTA buttons */
.te-cta-section { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 32px; }
.te-cta-btn {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  background: #fff; border-radius: 16px; text-decoration: none; color: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,.07); border: 1px solid #f1f5f9;
  transition: transform .2s, box-shadow .2s;
}
.te-cta-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.te-cta-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; flex-shrink: 0; }
.te-cta-title { font-weight: 800; font-size: .9rem; color: #1e293b; }
.te-cta-sub   { font-size: .73rem; color: #94a3b8; margin-top: 2px; }

.te-retry-btn {
  display: block; margin: 0 auto; padding: 12px 32px;
  background: transparent; border: 2px solid #e2e8f0;
  border-radius: 12px; font-size: .9rem; font-weight: 700; color: #64748b;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.te-retry-btn:hover { border-color: #6366f1; color: #6366f1; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .te-question-screen { grid-template-columns: 1fr; }
  .te-mentor-section { display: flex; gap: 14px; align-items: center; text-align: left; }
  .te-mentor-img-wrap { width: 80px; height: 80px; margin: 0; flex-shrink: 0; }
  .te-mentor-bubble { border-radius: 4px 16px 16px 16px; }
  .te-ai-sections { grid-template-columns: 1fr; }
  .te-ai-section.recomendaciones { grid-column: auto; }
  .te-charts-grid { grid-template-columns: 1fr; }
  .te-start-card { padding: 32px 24px; }
  .te-profile-card { flex-direction: column; text-align: center; }
}
/* ─── OVERFLOW MOBILE FIX ───────────────────────────────── */
.te-results,
.te-results-wrap,
.te-test-container,
.te-start-section {
  max-width: 100%;
  overflow-x: hidden;
}
.te-charts-grid {
  overflow: hidden;
}
.te-chart-card {
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.te-chart-wrap canvas {
  max-width: 100%;
}
.te-ai-card,
.te-scores-grid,
.te-cta-section,
.te-result-mentor {
  min-width: 0;
  box-sizing: border-box;
}
