/* ====== Reset y base ====== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: transparent;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ====== Contenedor principal (300x250 adaptable) ====== */
.creative {
  width: 320px;
  height: 270px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  /* 🔹 Gradiente por defecto (EXPOSED - Púrpura/Azul) */
  background: linear-gradient(180deg, rgba(83,42,239,1) 0%, rgba(44,83,255,1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  padding: 18px;
  text-align: center;
  transition: background 0.3s ease;
}

/* 🔹 VARIANTE CONTROL (Verde/Azul turquesa) */
.creative[data-group="control"] {
  background: linear-gradient(180deg, rgba(16,185,129,1) 0%, rgba(6,182,212,1) 100%);
}

/* 🎨 Alternativa: Naranja cálido para Control (descomentar si prefieres) */
/*
.creative[data-group="control"] {
  background: linear-gradient(180deg, rgba(251,146,60,1) 0%, rgba(249,115,22,1) 100%);
}
*/

/* Móvil: escala proporcionalmente */
@media (max-width: 340px) {
  .creative {
    width: 100%;
    height: auto;
    aspect-ratio: 6 / 5;
    padding: 18px;
  }
}

/* ====== Etapas ====== */
.stage {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.stage--active { display: flex; }

/* ====== Marca ====== */
.brand-badge {
  position: absolute;
  top: 8px;
  left: 12px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: none;
}

/* Badge DEBUG: Muestra el grupo en desarrollo */
.creative[data-debug="true"] .brand-badge::after {
  content: ' [' attr(data-group) ']';
  opacity: 0.8;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 4px;
  padding: 2px 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
}

/* Indicador visual adicional en debug */
.creative[data-debug="true"][data-group="control"] .brand-badge {
  border: 1px solid rgba(255,255,255,0.4);
}

.creative[data-debug="true"][data-group="exposed"] .brand-badge {
  border: 1px solid rgba(255,255,255,0.2);
}

/* ====== Pregunta ====== */
.question {
  font-weight: 700;
  font-size: 11px;
  margin-top: 5px;
  margin-bottom: 11px;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* ====== Opciones ====== */
.options {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
}

/* Efecto translúcido con gradiente */
.btn--primary {
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.btn--primary:hover {
  background: rgba(255,255,255,0.30);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Botón secundario */
.btn--secondary {
  background: rgba(255,255,255,0.12);
  color: #ddd;
  margin-top: 5px;
}
.btn--secondary:hover {
  background: rgba(255,255,255,0.24);
}

/* ====== Estados de carga / error ====== */
.loader {
  width: 28px; 
  height: 28px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { 
  to { transform: rotate(360deg); } 
}

#stage-thanks h2,
#stage-error h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
#stage-thanks p,
#stage-error p {
  font-size: 13px;
  opacity: 0.85;
}

/* ====== Política ====== */
.policy {
  margin-top: 8px;
  font-size: 8px;
  opacity: 0.7;
  line-height: 1.3;
}

/* ====== Botón CTA ====== */
.btn--cta {
  background: #00e0b8;
  color: #0a0d14;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0,224,184,.35);
  margin-top: 6px;
  margin-bottom: 5px;
}
.btn--cta:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,224,184,.45);
}

/* Botón CTA deshabilitado */
.btn--cta.is-disabled {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  cursor: not-allowed;
  box-shadow: none;
}
.btn--cta.is-disabled:hover {
  filter: none;
  transform: none;
}

/* ====== Adaptación táctil ====== */
@media (hover: none) and (pointer: coarse) { 
  .btn { 
    padding: 8px 12px; 
    font-size: 11px; 
    min-height: 22px; /* Accesibilidad táctil */
  }
}

/* ====== Animaciones de entrada ====== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage--active {
  animation: fadeIn 0.4s ease-out;
}

/* ====== Indicador visual sutil en producción (OPCIONAL) ====== */
/* Pequeño acento de color en la esquina para QA sin debug mode */
.creative::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent rgba(255,255,255,0.08) transparent transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Solo visible en modo debug */
.creative[data-debug="true"]::before {
  opacity: 1;
}

.creative[data-debug="true"][data-group="control"]::before {
  border-color: transparent rgba(16,185,129,0.5) transparent transparent;
}

.creative[data-debug="true"][data-group="exposed"]::before {
  border-color: transparent rgba(83,42,239,0.5) transparent transparent;
}