/* ==========================================================================
   DOCE SURPRESA — Sistema de Design CSS
   Experiência premium mobile-first para venda de Ouro Branco via QR Code
   Tema: Luxo Dourado + Escuro
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Design Tokens (Variáveis CSS)
   -------------------------------------------------------------------------- */
:root {
  /* Paleta Dourada */
  --gold-50: #FFF8E1;
  --gold-100: #FFECB3;
  --gold-200: #FFE082;
  --gold-300: #FFD54F;
  --gold-400: #FFCA28;
  --gold-500: #FFC107;
  --gold-600: #FFB300;
  --gold-700: #FFA000;
  --gold-800: #FF8F00;
  --gold-900: #FF6F00;

  /* Paleta Escura */
  --dark-950: #050508;
  --dark-900: #0D0D14;
  --dark-800: #1A1A2E;
  --dark-700: #16213E;
  --dark-600: #1F2B47;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 215, 79, 0.15);
  --glass-border-hover: rgba(255, 215, 79, 0.35);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Texto */
  --text-primary: #FAFAFA;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-gold: #FFD54F;

  /* Raio de borda */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Tipografia */
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-display: 'Outfit', -apple-system, sans-serif;

  /* Transições */
  --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--dark-950);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100dvh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.15;
  color: var(--text-primary);
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  line-height: 1.2;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  line-height: 1.3;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.text-gold {
  color: var(--text-gold);
}

.text-gradient {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   Layout Principal
   -------------------------------------------------------------------------- */
.app-container {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

.screen {
  min-height: 100dvh;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  pointer-events: none;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.screen-content {
  width: 100%;
  max-width: 380px;
  z-index: 2;

  /* Na tela de reveal o conteúdo pode ser maior que 100dvh */
  overflow-y: auto;
}

/* --------------------------------------------------------------------------
   Glassmorphism Cards
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
}

.glass-card:hover,
.glass-card:active {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(255, 193, 7, 0.1);
}

.glass-card.selected {
  border-color: var(--gold-500);
  background: rgba(255, 193, 7, 0.08);
  box-shadow: 0 0 30px rgba(255, 193, 7, 0.15);
}

/* --------------------------------------------------------------------------
   Tier Cards (Pacotes de venda)
   -------------------------------------------------------------------------- */
.tier-card {
  cursor: pointer;
}

.tier-card .tier-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.tier-card .tier-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.tier-card .tier-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 8px;
}

.tier-card .tier-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 360px) {
  .tier-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */

/* Botão Primário — Gradiente Dourado */
.btn-primary {
  width: 100%;
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  border: none;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--dark-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 600ms;
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Botão Secundário — Contorno Dourado */
.btn-secondary {
  width: 100%;
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  background: transparent;
  border: 2px solid var(--gold-500);
  color: var(--gold-300);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-secondary:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--gold-400);
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* Botão WhatsApp */
.btn-whatsapp {
  width: 100%;
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  border: none;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-whatsapp:hover {
  filter: brightness(1.1);
}

.btn-whatsapp:active {
  transform: scale(0.97);
}

/* Botão Copiar */
.btn-copy {
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  background: transparent;
  border: 2px solid var(--gold-500);
  color: var(--gold-300);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  letter-spacing: 0.5px;
}

.btn-copy:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--gold-400);
}

.btn-copy:active {
  transform: scale(0.97);
}

/* Botão Voltar — discreto */
.btn-back {
  width: 100%;
  padding: 10px 20px;
  border-radius: var(--radius-xl);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  letter-spacing: 0.3px;
}

.btn-back:hover {
  color: var(--text-gold);
}

.btn-back:active {
  transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   Tela de Pagamento Pix
   -------------------------------------------------------------------------- */
.pix-container {
  text-align: center;
}

.pix-qr-wrapper {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin: 16px 0;
}

.pix-qr-wrapper img,
.pix-qr-wrapper canvas {
  width: 220px;
  height: 220px;
}

.pix-amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-gold);
}

.pix-code-text {
  font-size: 0.7rem;
  word-break: break-all;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  max-height: 60px;
  overflow: auto;
  margin: 8px 0;
  color: var(--text-secondary);
  font-family: monospace;
}

.pix-instructions {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 12px 0;
}

/* --------------------------------------------------------------------------
   Tela de Revelação da Surpresa
   -------------------------------------------------------------------------- */
.reveal-container {
  text-align: center;
  position: relative;
}

.reveal-message {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  margin: 20px 0;
  padding: 24px;
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.reveal-category {
  font-size: 0.85rem;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.reveal-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
}

/* --------------------------------------------------------------------------
   Roleta
   -------------------------------------------------------------------------- */
.roulette-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 24px;
}

.roulette-canvas {
  width: 100%;
  height: 100%;
}

.roulette-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.roulette-spin-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  border: none;
  font-weight: bold;
  cursor: pointer;
  z-index: 3;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  color: var(--dark-900);
  font-family: var(--font-display);
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.roulette-spin-btn:hover {
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.5);
}

.roulette-spin-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* --------------------------------------------------------------------------
   Gerador de Cartão
   -------------------------------------------------------------------------- */
.card-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.card-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.card-input:focus {
  border-color: var(--gold-500);
}

.card-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.card-preview-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0 auto 16px;
}

.card-preview-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Animações (Keyframes)
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(255, 193, 7, 0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

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

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 193, 7, 0.6);
  }
}

/* --------------------------------------------------------------------------
   Classes Utilitárias de Animação
   -------------------------------------------------------------------------- */
.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out both;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-shimmer {
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease-out both;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Delays de animação */
.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
}

/* --------------------------------------------------------------------------
   Classes Utilitárias Gerais
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

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

/* Margin Bottom */
.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

/* Margin Top */
.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
}

/* Gap */
.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

/* --------------------------------------------------------------------------
   Canvas de Partículas (Fundo decorativo)
   -------------------------------------------------------------------------- */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Canvas de Confetti (Celebração)
   -------------------------------------------------------------------------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Toast / Notificação
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-500);
  color: var(--dark-900);
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
}

.toast.show {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Spinner de Carregamento
   -------------------------------------------------------------------------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   Efeitos Especiais
   -------------------------------------------------------------------------- */

/* Emoji herói flutuante */
.hero-emoji {
  font-size: clamp(4rem, 12vw, 6rem);
  animation: float 3s ease-in-out infinite;
  display: block;
  text-align: center;
}

/* Badge VIP */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-800));
  color: var(--dark-900);
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   Indicador de Scroll
   -------------------------------------------------------------------------- */
.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.5;
  animation: float 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Responsividade — Ajustes para telas muito pequenas
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .screen {
    padding: 16px;
  }

  .glass-card {
    padding: 18px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-whatsapp {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .pix-qr-wrapper img,
  .pix-qr-wrapper canvas {
    width: 180px;
    height: 180px;
  }

  .roulette-container {
    width: 240px;
    height: 240px;
  }

  .tier-card .tier-price {
    font-size: 1.5rem;
  }

  .tier-card .tier-icon {
    font-size: 2rem;
  }
}

@media (max-width: 320px) {
  .screen {
    padding: 12px;
  }

  .glass-card {
    padding: 14px;
  }

  .btn-primary,
  .btn-secondary,
  .btn-whatsapp {
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  .pix-qr-wrapper img,
  .pix-qr-wrapper canvas {
    width: 160px;
    height: 160px;
  }

  .roulette-container {
    width: 220px;
    height: 220px;
  }

  .roulette-spin-btn {
    width: 50px;
    height: 50px;
    font-size: 0.7rem;
  }
}

/* --------------------------------------------------------------------------
   Prefers Reduced Motion — Acessibilidade
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
