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

:root {
  --purple: #6B2FA0;
  --purple-light: #8B4CC0;
  --purple-dark: #4A1F72;
  --yellow: #F5B400;
  --yellow-light: #FFD04D;
  --yellow-dark: #D99E00;
  --blue: #1A6FB5;
  --blue-light: #2E8FE0;
  --white: #FFFFFF;
  --bg: #3D1A6B;
  --bg2: #4A1F82;
  --text: #1A1033;
  --text-soft: #5A4875;
  --text-muted: #9B8BAE;
  --success: #22C55E;
  --error: #EF4444;
  --card-shadow: 0 8px 32px rgba(107,47,160,0.10);
  --card-shadow-hover: 0 16px 48px rgba(107,47,160,0.18);
  --radius: 20px;
  --radius-sm: 12px;
  --transition: all 0.35s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(145deg, #2A1050 0%, #4A1F82 40%, #3D1A6B 70%, #1A0A3D 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

/* ── BACKGROUND BLOBS ─────────────────────────────── */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}
.bg-blob-1 {
  width: 600px; height: 600px;
  background: #7B3FBF;
  top: -200px; left: -200px;
}
.bg-blob-2 {
  width: 500px; height: 500px;
  background: var(--yellow);
  opacity: 0.12;
  bottom: -150px; right: -150px;
}
.bg-blob-3 {
  width: 350px; height: 350px;
  background: #5B2FA8;
  top: 50%; left: 55%;
}

/* ── APP CONTAINER ────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── SCREEN ───────────────────────────────────────── */
.screen {
  display: none;
  width: 100%;
  max-width: 620px;
  animation: fadeSlideUp 0.5s ease both;
}
.screen.active { display: flex; flex-direction: column; align-items: center; }

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

/* ── CARD ─────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(24px);
  border-radius: var(--radius);
  box-shadow: 0 16px 64px rgba(0,0,0,0.35);
  padding: 40px 36px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.5);
}

/* ── LOGO ─────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.logo-wrap img {
  width: auto;
  max-width: 240px;
  max-height: 140px;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}
.logo-svg {
  width: 200px;
  height: 130px;
}

/* ── BADGE ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

/* ── TYPOGRAPHY ───────────────────────────────────── */
.title-main {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.title-section {
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  color: var(--purple);
  margin-bottom: 12px;
}
.subtitle {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-soft);
  text-align: center;
  margin-bottom: 20px;
}
.highlight-box {
  background: linear-gradient(135deg, rgba(245,180,0,0.12), rgba(107,47,160,0.08));
  border: 1.5px solid rgba(245,180,0,0.35);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.highlight-box strong { color: var(--purple); }

/* ── DIVIDER ──────────────────────────────────────── */
.divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--purple), var(--yellow));
  border-radius: 999px;
  margin: 0 auto 24px;
}

/* ── BUTTONS ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding: 16px 36px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.12); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  box-shadow: 0 8px 24px rgba(107,47,160,0.32);
}
.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(107,47,160,0.42);
  transform: translateY(-2px);
}

.btn-yellow {
  background: linear-gradient(135deg, var(--yellow-dark), var(--yellow));
  color: var(--text);
  box-shadow: 0 8px 24px rgba(245,180,0,0.32);
}
.btn-yellow:hover {
  box-shadow: 0 12px 32px rgba(245,180,0,0.42);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}
.btn-outline:hover { background: var(--purple); color: #fff; }

.btn-large { font-size: 1.15rem; padding: 18px 48px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn:disabled::after { display: none; }

.btn-pulse {
  animation: btnPulse 2.2s infinite;
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(107,47,160,0.32); }
  50% { box-shadow: 0 8px 40px rgba(107,47,160,0.55), 0 0 0 8px rgba(107,47,160,0.08); }
}

/* ── PROGRESS BAR ─────────────────────────────────── */
.progress-wrap {
  width: 100%;
  margin-bottom: 28px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}
.progress-label span { color: var(--purple); }
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(107,47,160,0.12);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--yellow));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.progress-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(107,47,160,0.18);
  transition: var(--transition);
}
.progress-dot.done { background: var(--purple); transform: scale(1.2); }
.progress-dot.active { background: var(--yellow); transform: scale(1.3); }

/* ── QUIZ OPTIONS ─────────────────────────────────── */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 24px 0;
}
.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(107,47,160,0.12);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.option-btn:hover {
  border-color: var(--purple);
  background: rgba(107,47,160,0.05);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(107,47,160,0.12);
}
.option-letter {
  min-width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(107,47,160,0.1);
  color: var(--purple);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.option-btn:hover .option-letter {
  background: var(--purple);
  color: #fff;
}
.option-btn.correct {
  border-color: var(--success);
  background: rgba(34,197,94,0.08);
  animation: correctPop 0.4s ease;
}
.option-btn.correct .option-letter {
  background: var(--success);
  color: #fff;
}
.option-btn.wrong {
  border-color: var(--error);
  background: rgba(239,68,68,0.08);
  animation: shake 0.45s ease;
}
.option-btn.wrong .option-letter {
  background: var(--error);
  color: #fff;
}
.option-btn:disabled { cursor: default; }

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ── FEEDBACK MSG ─────────────────────────────────── */
.feedback-msg {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  animation: fadeSlideUp 0.3s ease;
  margin-top: 4px;
}
.feedback-msg.show { display: flex; }
.feedback-msg.error { background: rgba(239,68,68,0.1); color: #c0392b; }
.feedback-msg.success { background: rgba(34,197,94,0.1); color: #166534; }

/* ── VIDEO WRAP ───────────────────────────────────── */
.video-container {
  width: 100%;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin: 20px 0;
  aspect-ratio: 16/9;
  background: #000;
}
.video-container iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}
.video-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 2;
}
.video-play-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(107,47,160,0.75);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.video-play-btn:hover { transform: scale(1.08); }

/* Barra de progresso somente leitura */
.video-progress-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
  pointer-events: none;
}
.video-progress-bg {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  overflow: hidden;
}
.video-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-light), var(--yellow));
  border-radius: 999px;
  transition: width 0.5s linear;
  width: 0%;
}
.video-time {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

.video-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  justify-content: center;
  margin-top: 10px;
}

/* ── UNLOCK ANIMATION ─────────────────────────────── */
.btn-unlock-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.unlock-glow {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--yellow), var(--purple));
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.btn-unlock-wrap.unlocked .unlock-glow { opacity: 0.45; }

/* ── LOADING SCREEN ───────────────────────────────── */
.loading-screen {
  text-align: center;
  padding: 60px 36px;
}
.loading-icon {
  width: 90px; height: 90px;
  margin: 0 auto 28px;
  position: relative;
}
.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  animation: spin 1.4s linear infinite;
}
.loading-ring-1 { border-top-color: var(--purple); border-right-color: var(--purple-light); }
.loading-ring-2 { inset: 8px; border-top-color: var(--yellow); animation-duration: 2s; animation-direction: reverse; }
.loading-heart {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: heartBeat 1.2s ease infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ── PARTICLES ────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.5; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── CONFETTI ─────────────────────────────────────── */
.confetti-wrap {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 10px; height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* ── CODE DISPLAY ─────────────────────────────────── */
.code-card {
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  border-radius: var(--radius);
  padding: 28px 32px;
  text-align: center;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}
.code-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(245,180,0,0.15);
}
.code-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  font-family: 'Outfit', sans-serif;
  margin-bottom: 10px;
}
.code-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  color: var(--yellow);
  letter-spacing: 0.06em;
  text-shadow: 0 4px 20px rgba(245,180,0,0.4);
}
.code-copy-btn {
  margin-top: 14px;
  padding: 8px 20px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.code-copy-btn:hover { background: rgba(255,255,255,0.25); }

/* ── FORM ─────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
}
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  font-family: 'Outfit', sans-serif;
}
.form-input {
  padding: 14px 18px;
  border: 2px solid rgba(107,47,160,0.15);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255,255,255,0.9);
  transition: var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(107,47,160,0.1);
}
.form-input.error-field { border-color: var(--error); }

.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-soft);
  cursor: pointer;
  line-height: 1.5;
  user-select: none;
  margin-bottom: 20px;
}
.checkbox-wrap input[type="checkbox"] { display: none; }
.checkbox-box {
  min-width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(107,47,160,0.3);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
}
.checkbox-wrap input:checked + .checkbox-box {
  background: var(--purple);
  border-color: var(--purple);
}
.checkbox-wrap input:checked + .checkbox-box::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.terms-link {
  color: var(--purple);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

/* ── MODAL ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,16,51,0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.3s ease; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 32px;
  max-width: 540px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(26,16,51,0.25);
  animation: fadeSlideUp 0.35s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--purple);
}
.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(107,47,160,0.1);
  color: var(--purple);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--purple); color: #fff; }
.modal-body {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-soft);
}
.modal-body h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--purple);
  margin: 16px 0 6px;
}

/* ── SUCCESS EMOJI ────────────────────────────────── */
.success-icon {
  font-size: 4rem;
  text-align: center;
  animation: bounceIn 0.6s cubic-bezier(.36,.07,.19,.97);
  margin-bottom: 16px;
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── STARS ────────────────────────────────────────── */
.stars-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}
.star { font-size: 1.4rem; animation: starPop 0.4s ease both; }
.star:nth-child(1) { animation-delay: 0.1s; }
.star:nth-child(2) { animation-delay: 0.2s; }
.star:nth-child(3) { animation-delay: 0.3s; }
@keyframes starPop {
  from { opacity: 0; transform: scale(0) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* ── STEP INDICATORS ──────────────────────────────── */
.steps-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
}
.step-item.active { color: var(--purple); }
.step-item.done { color: var(--success); }
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(107,47,160,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: var(--transition);
}
.step-item.active .step-circle { background: var(--purple); color: #fff; }
.step-item.done .step-circle { background: var(--success); color: #fff; }
.step-line { width: 24px; height: 2px; background: rgba(107,47,160,0.15); border-radius: 1px; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 28px 20px; }
  .btn-large { padding: 16px 28px; font-size: 1rem; }
  .steps-row { gap: 4px; }
  .step-line { width: 12px; }
  .code-value { font-size: 2rem; }
  .modal-box { padding: 24px 18px; }
}

/* ── SCROLLBAR ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(107,47,160,0.3); border-radius: 3px; }
