/* =============================================
   ONE ESCENCIAL | TEST PLATFORM STYLES
   ============================================= */

:root {
  --c1: #FEFEFE;
  --c2: #F23A7A;
  --c3: #FBBE00;
  --c4: #E78522;
  --c5: #2AB0C9;
  --c6: #414D71;
}

/* Fonts */
.font-bangers { font-family: 'Bangers', cursive; letter-spacing: 0.05em; }
.font-nunito  { font-family: 'Nunito', sans-serif; }
.font-800     { font-weight: 800; }
.font-700     { font-weight: 700; }

/* Tailwind color utilities */
.bg-c6   { background-color: var(--c6); }
.text-c1 { color: var(--c1); }
.text-c2 { color: var(--c2); }
.text-c3 { color: var(--c3); }
.text-c5 { color: var(--c5); }

/* =============================================
   DOT BACKGROUND
   ============================================= */
.dots-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}

/* =============================================
   SCREEN MANAGEMENT
   ============================================= */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  font-family: 'Nunito', sans-serif;
  animation: fadeIn 0.35s ease;
}
.screen.active { display: block; }

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

/* =============================================
   HOME – TEST CARDS
   ============================================= */
.test-card {
  position: relative;
  cursor: pointer;
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1);
  overflow: visible;
}
.test-card:hover { transform: translateY(-8px) scale(1.02); }
.test-card:active { transform: scale(0.97); }

.card-glow {
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  background: var(--glow);
  filter: blur(18px);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}
.test-card:hover .card-glow { opacity: 0.45; }

.card-inner {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 28px 24px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.3s;
}
.test-card:hover .card-inner {
  border-color: var(--card-accent);
}

.card-badge {
  display: inline-block;
  font-family: 'Bangers', cursive;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  border-radius: 100px;
  color: white;
  width: fit-content;
}

.card-icon {
  font-size: 3rem;
  line-height: 1;
  margin: 4px 0;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

.card-title {
  font-family: 'Bangers', cursive;
  font-size: 2.2rem;
  color: var(--c1);
  line-height: 1.05;
  letter-spacing: 0.03em;
}

.card-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  color: rgba(254,254,254,0.65);
  line-height: 1.5;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.card-tags span {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  padding: 3px 10px;
  border-radius: 100px;
}

.card-btn {
  margin-top: 8px;
  text-align: center;
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: white;
  padding: 10px 0;
  border-radius: 12px;
  transition: filter 0.2s, transform 0.2s;
}
.test-card:hover .card-btn {
  filter: brightness(1.15);
  transform: scale(1.03);
}

/* =============================================
   TEST SCREEN – PROGRESS
   ============================================= */
.back-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: rgba(254,254,254,0.6);
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.12);
  padding: 7px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.back-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--c1);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c2), var(--c5));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(.34,1.56,.64,1);
}

/* Progress dots */
.pdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: all 0.3s;
}
.pdot.answered {
  background: var(--c5);
  transform: scale(1.2);
}
.pdot.current {
  background: var(--c2);
  transform: scale(1.4);
  box-shadow: 0 0 8px var(--c2);
}

/* =============================================
   TEST SCREEN – QUESTION CARD
   ============================================= */
.question-card {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 32px 28px;
  backdrop-filter: blur(8px);
  animation: slideUp 0.35s cubic-bezier(.34,1.56,.64,1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Option buttons */
.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(.34,1.56,.64,1);
  text-align: left;
  position: relative;
  overflow: hidden;
}
.option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--opt-color);
  opacity: 0;
  transition: opacity 0.2s;
}
.option-btn:hover {
  border-color: var(--opt-color);
  transform: translateX(4px) scale(1.01);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.option-btn:hover::before { opacity: 0.12; }
.option-btn:active { transform: scale(0.97); }

.option-btn.selected {
  border-color: var(--opt-color);
  background: rgba(255,255,255,0.12);
  transform: scale(1.01);
}
.option-btn.selected::before { opacity: 0.2; }

.opt-letter {
  font-family: 'Bangers', cursive;
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  position: relative;
  z-index: 1;
}

.opt-text {
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(254,254,254,0.85);
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

/* =============================================
   RESULT SCREEN
   ============================================= */
/* ── IMAGE NORMALIZER ──────────────────────────────────────────────────────
   All result images are forced into the same 400×400 box regardless of their
   original size or aspect ratio. object-fit:contain keeps proportions intact
   and centers the image; the bg fill blends into the dark theme.
   ─────────────────────────────────────────────────────────────────────────── */
.result-image-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 24px;
}

.result-image-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle at center, var(--result-color, #F23A7A) 0%, transparent 70%);
  opacity: 0.3;
  filter: blur(30px);
  z-index: 0;
  border-radius: 50%;
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(1.05); }
}

/* Fixed-size frame – ALL images render inside this exact box */
.result-image-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;          /* always a perfect square */
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  background: rgba(255,255,255,0.04);  /* subtle fill for letterboxed images */
  animation: revealResult 0.6s cubic-bezier(.34,1.56,.64,1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-image {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* preserves ratio, no cropping, centers automatically */
  display: block;
}

@keyframes revealResult {
  from { opacity: 0; transform: scale(0.85) rotate(-3deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.result-desc-box {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 20px 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(254,254,254,0.8);
  line-height: 1.65;
  text-align: center;
}

.action-btn {
  font-family: 'Bangers', cursive;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: white;
  padding: 14px 24px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.22s;
  border: none;
  outline: none;
}
.action-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.action-btn:active { transform: scale(0.97); }

/* =============================================
   CONFETTI CANVAS
   ============================================= */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .question-card { padding: 22px 18px; }
  .card-inner    { padding: 22px 18px; }
}