/* =============================================
   ¿Qué tan constructor(a) de paz eres?
   RECAPAZITANDO — Estilos
   ============================================= */

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

:root {
  --blanco: #FFFFFF;
  --azul: #1F2A44;
  --azul-claro: #2d3d61;
  --oro: #F2B705;
  --oro-claro: rgba(242, 183, 5, 0.12);
  --gris-suave: #f7f7f5;
  --gris-borde: #e8e8e4;
  --gris-texto: #888880;
  --verde: #27ae60;
  --rojo: #e74c3c;

  --fuente: 'Poppins', sans-serif;
  --sombra: 0 4px 24px rgba(31, 42, 68, 0.08);
  --sombra-hover: 0 8px 40px rgba(31, 42, 68, 0.14);
  --radio: 16px;
  --radio-btn: 12px;
  --trans: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--fuente);
  background: var(--gris-suave);
  color: var(--azul);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

/* ======= APP WRAPPER ======= */
#app {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ======= PANTALLAS ======= */
.pantalla {
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pantalla.activa {
  display: flex;
  animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ======= PANTALLA INICIO ======= */

.inicio-header {
  text-align: center;
  margin-bottom: 40px;
}

.logo-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--oro);
  background: var(--azul);
  padding: 6px 14px;
  border-radius: 4px;
  margin-bottom: 28px;
}

.inicio-titulo {
  font-size: clamp(32px, 8vw, 52px);
  font-weight: 900;
  color: var(--azul);
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.inicio-titulo em {
  font-style: normal;
  color: var(--oro);
}

.inicio-frase {
  font-size: clamp(15px, 3.5vw, 18px);
  font-weight: 500;
  color: var(--azul);
  line-height: 1.55;
  margin-bottom: 12px;
  max-width: 400px;
}

.inicio-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--gris-texto);
  line-height: 1.6;
  max-width: 380px;
}

.inicio-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 40px 36px;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.inicio-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--oro);
}

.inicio-meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--gris-borde);
}

.meta-item {
  text-align: center;
}

.meta-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--azul);
  line-height: 1;
}

.meta-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--gris-texto);
  letter-spacing: 0.5px;
  margin-top: 4px;
  display: block;
}

/* ======= BOTONES ======= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--fuente);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  transition: var(--trans);
  text-decoration: none;
  padding: 16px 32px;
  border-radius: var(--radio-btn);
  width: 100%;
  max-width: 360px;
}

.btn-primario {
  background: var(--azul);
  color: var(--blanco);
}

.btn-primario:hover {
  background: var(--azul-claro);
  transform: translateY(-2px);
  box-shadow: var(--sombra-hover);
}

.btn-oro {
  background: var(--oro);
  color: var(--azul);
}

.btn-oro:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(242,183,5,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--azul);
  border: 2px solid var(--gris-borde);
}

.btn-outline:hover {
  border-color: var(--azul);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 12px 24px;
  font-size: 13px;
  max-width: 280px;
}

.btns-grupo {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin-top: 8px;
}

/* ======= PANTALLA QUIZ ======= */

.quiz-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 36px 32px;
  width: 100%;
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Progress */
.progress-zona {
  width: 100%;
  margin-bottom: 28px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-frase {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--oro);
}

.progress-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--gris-texto);
}

.progress-barra {
  width: 100%;
  height: 4px;
  background: var(--gris-borde);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--oro), #e6a800);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* Pregunta */
.pregunta-tipo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--azul);
  background: var(--oro-claro);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 16px;
}

.pregunta-texto {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 700;
  color: var(--azul);
  line-height: 1.4;
  margin-bottom: 28px;
  letter-spacing: -0.3px;
}

/* Opciones */
.opciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opcion-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--gris-suave);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-family: var(--fuente);
  font-size: 14px;
  font-weight: 500;
  color: var(--azul);
  text-align: left;
  transition: var(--trans);
  width: 100%;
  line-height: 1.4;
}

.opcion-btn:hover:not(:disabled) {
  background: var(--blanco);
  border-color: var(--azul);
  transform: translateX(4px);
  box-shadow: var(--sombra);
}

.opcion-letra {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blanco);
  border: 1.5px solid var(--gris-borde);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gris-texto);
  flex-shrink: 0;
  transition: var(--trans);
}

/* Estados de respuesta */
.opcion-btn.correcta {
  background: rgba(39, 174, 96, 0.08);
  border-color: var(--verde);
  color: var(--azul);
}

.opcion-btn.correcta .opcion-letra {
  background: var(--verde);
  border-color: var(--verde);
  color: white;
}

.opcion-btn.incorrecta {
  background: rgba(231, 76, 60, 0.06);
  border-color: var(--rojo);
  color: #999;
}

.opcion-btn.incorrecta .opcion-letra {
  background: var(--rojo);
  border-color: var(--rojo);
  color: white;
}

.opcion-btn:disabled {
  cursor: not-allowed;
}

/* Feedback */
.feedback-zona {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  display: none;
  animation: fadeIn 0.3s ease both;
}

.feedback-zona.correcto {
  background: rgba(39, 174, 96, 0.08);
  color: #1a7a42;
  display: block;
}

.feedback-zona.incorrecto {
  background: rgba(231, 76, 60, 0.06);
  color: #c0392b;
  display: block;
}

.feedback-icono {
  font-size: 16px;
  margin-right: 6px;
}

/* Siguiente */
.siguiente-zona {
  margin-top: 24px;
  display: none;
  animation: fadeIn 0.3s ease 0.2s both;
}

.siguiente-zona.visible {
  display: block;
}

/* ======= PANTALLA RESULTADO ======= */

.resultado-card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 48px 36px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.resultado-banda {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--oro);
}

.insignia-contenedor {
  margin: 0 auto 24px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
  box-shadow: 0 8px 32px rgba(31,42,68,0.18);
}

.resultado-puntaje-visual {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.puntaje-num {
  font-size: 64px;
  font-weight: 900;
  color: var(--azul);
  line-height: 1;
  letter-spacing: -2px;
}

.puntaje-total {
  font-size: 24px;
  font-weight: 400;
  color: var(--gris-texto);
}

.resultado-nivel-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.nivel-alto .resultado-nivel-tag { background: rgba(39,174,96,0.1); color: #1a7a42; }
.nivel-medio .resultado-nivel-tag { background: var(--oro-claro); color: #a07a00; }
.nivel-bajo .resultado-nivel-tag { background: rgba(31,42,68,0.06); color: var(--azul); }

.resultado-titulo {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  color: var(--azul);
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.resultado-texto {
  font-size: 15px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 8px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.insignia-nombre {
  font-size: 13px;
  font-weight: 700;
  color: var(--gris-texto);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.divider {
  width: 48px;
  height: 3px;
  background: var(--oro);
  margin: 20px auto;
  border-radius: 2px;
}

/* Tarjeta compartir */
.compartir-seccion {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gris-borde);
}

.compartir-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gris-texto);
  margin-bottom: 16px;
}

/* Canvas oculto para descarga */
#canvas-compartir {
  display: none;
}

/* ======= CONFETTI ======= */
.confetti-pieza {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: caer linear forwards;
}

@keyframes caer {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ======= FOOTER APP ======= */
.app-footer {
  text-align: center;
  margin-top: 24px;
  padding: 0 16px 16px;
}

.app-footer p {
  font-size: 11px;
  color: var(--gris-texto);
  letter-spacing: 0.5px;
}

.app-footer strong {
  color: var(--azul);
  font-weight: 700;
}

/* ======= ANIMACIÓN ENTRADA QUIZ ======= */
.quiz-card.saliendo {
  animation: fadeSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-24px); }
}

.quiz-card.entrando {
  animation: fadeSlideEntra 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeSlideEntra {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ======= RESPONSIVE ======= */

@media (max-width: 480px) {
  body { padding: 12px; align-items: flex-start; padding-top: 24px; }
  .inicio-card { padding: 28px 22px; }
  .quiz-card { padding: 28px 20px; }
  .resultado-card { padding: 36px 22px; }
  .opcion-btn { padding: 14px 14px; font-size: 13px; }
  .btn { padding: 15px 24px; font-size: 13px; }
  .puntaje-num { font-size: 52px; }
}

/* ======= ACCESIBILIDAD ======= */
:focus-visible {
  outline: 3px solid var(--oro);
  outline-offset: 2px;
}

.opcion-btn:focus-visible {
  border-color: var(--azul);
}
