/* =============================================================
   ALFABETIZA.APP — style.css
   Design: livro ilustrado brasileiro, cores vivas, formas arredondadas
   Fontes: Baloo 2 (display/títulos) + Nunito (corpo/UI)
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800&family=Nunito:wght@400;600;700;800&display=swap');

/* ----------------------------------------------------------
   TOKENS DE DESIGN
   ---------------------------------------------------------- */
:root {
  /* Paleta principal */
  --amarelo:       #FFD43B;
  --amarelo-escuro:#F5A800;
  --laranja:       #FF7F2A;
  --vermelho:      #FF4757;
  --verde:         #2ED573;
  --verde-escuro:  #1ABC6E;
  --azul:          #1E90FF;
  --azul-escuro:   #1565C0;
  --roxo:          #A855F7;
  --rosa:          #FF6BB5;

  /* Neutros */
  --branco:        #FFFEF7;
  --creme:         #FFF8E7;
  --cinza-claro:   #F0EDE6;
  --cinza:         #9E9587;
  --escuro:        #2D2417;

  /* Semânticos */
  --acerto:        var(--verde);
  --erro:          var(--vermelho);
  --destaque:      var(--amarelo);
  --premium:       var(--roxo);

  /* Tipografia */
  --fonte-display: 'Baloo 2', cursive;
  --fonte-ui:      'Nunito', sans-serif;

  /* Espaçamentos */
  --raio-sm:  12px;
  --raio-md:  20px;
  --raio-lg:  32px;
  --raio-xl:  48px;

  /* Sombras */
  --sombra-sm: 0 4px 0 rgba(0,0,0,0.15);
  --sombra-md: 0 6px 0 rgba(0,0,0,0.18);
  --sombra-lg: 0 8px 0 rgba(0,0,0,0.20);
  --sombra-flutuante: 0 16px 40px rgba(0,0,0,0.12);
}

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

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

body {
  font-family: var(--fonte-ui);
  background-color: var(--creme);
  color: var(--escuro);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fundo com textura de pontilhado suave */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(45,36,23,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* ----------------------------------------------------------
   TIPOGRAFIA
   ---------------------------------------------------------- */
h1, h2, h3, .titulo {
  font-family: var(--fonte-display);
  font-weight: 800;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

p, span, label, input {
  font-family: var(--fonte-ui);
  font-size: 1rem;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   BOTÕES
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--fonte-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 32px;
  border-radius: var(--raio-lg);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: none !important;
}

.btn-primario {
  background: var(--amarelo);
  color: var(--escuro);
  box-shadow: var(--sombra-md);
}
.btn-primario:hover { background: var(--amarelo-escuro); }

.btn-verde {
  background: var(--verde);
  color: white;
  box-shadow: 0 6px 0 var(--verde-escuro);
}
.btn-verde:hover { background: #28C066; }

.btn-azul {
  background: var(--azul);
  color: white;
  box-shadow: 0 6px 0 var(--azul-escuro);
}
.btn-azul:hover { background: #1A7FE0; }

.btn-vermelho {
  background: var(--vermelho);
  color: white;
  box-shadow: 0 6px 0 #CC1A28;
}

.btn-roxo {
  background: var(--roxo);
  color: white;
  box-shadow: 0 6px 0 #7C3AED;
}

.btn-grande {
  font-size: 1.4rem;
  padding: 20px 48px;
  border-radius: var(--raio-xl);
}

.btn-icone {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.5rem;
}

/* ----------------------------------------------------------
   CARTÕES / CARDS
   ---------------------------------------------------------- */
.card {
  background: white;
  border-radius: var(--raio-lg);
  padding: 24px;
  box-shadow: var(--sombra-flutuante);
  position: relative;
  z-index: 1;
}

.card-colorido {
  border-top: 6px solid var(--amarelo);
}

/* ----------------------------------------------------------
   INPUTS E FORMULÁRIOS
   ---------------------------------------------------------- */
.input-grupo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-grupo label {
  font-family: var(--fonte-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cinza);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-campo {
  font-family: var(--fonte-ui);
  font-size: 1rem;
  padding: 14px 18px;
  border: 2.5px solid var(--cinza-claro);
  border-radius: var(--raio-md);
  background: var(--branco);
  color: var(--escuro);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-campo:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(30,144,255,0.15);
}

.input-campo::placeholder { color: var(--cinza); }

/* ----------------------------------------------------------
   MENSAGENS DE FEEDBACK
   ---------------------------------------------------------- */
.msg {
  padding: 12px 18px;
  border-radius: var(--raio-md);
  font-weight: 600;
  font-size: 0.95rem;
  display: none;
}
.msg.visivel { display: block; }
.msg-erro    { background: #FFE5E8; color: var(--vermelho); border: 2px solid var(--vermelho); }
.msg-sucesso { background: #E6FAF0; color: var(--verde-escuro); border: 2px solid var(--verde); }
.msg-info    { background: #E8F4FF; color: var(--azul-escuro); border: 2px solid var(--azul); }

/* ----------------------------------------------------------
   LOADING SPINNER
   ---------------------------------------------------------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--cinza-claro);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------
   BARRA DE PROGRESSO
   ---------------------------------------------------------- */
.barra-progresso {
  width: 100%;
  height: 16px;
  background: var(--cinza-claro);
  border-radius: 999px;
  overflow: hidden;
}

.barra-progresso-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--verde) 0%, var(--amarelo) 100%);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.barra-progresso-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: brilho 2s ease infinite;
}

@keyframes brilho {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ----------------------------------------------------------
   ESTRELAS
   ---------------------------------------------------------- */
.estrelas {
  display: flex;
  gap: 4px;
}

.estrela {
  font-size: 1.4rem;
  filter: grayscale(1) opacity(0.3);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.estrela.ativa {
  filter: none;
  animation: estrelaPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes estrelaPop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ----------------------------------------------------------
   NUVENS DECORATIVAS (background)
   ---------------------------------------------------------- */
.nuvem {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
}

/* ----------------------------------------------------------
   ANIMAÇÕES GLOBAIS
   ---------------------------------------------------------- */
@keyframes entrarBaixo {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes entrarCima {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulsarSuave {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.03); }
}

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

@keyframes aparecer {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.animar-entrar { animation: entrarBaixo 0.5s ease forwards; }
.animar-saltitar { animation: saltitar 2s ease-in-out infinite; }
.animar-pulsar { animation: pulsarSuave 3s ease-in-out infinite; }

/* ----------------------------------------------------------
   CONFETES (JS vai adicionar esses elementos)
   ---------------------------------------------------------- */
.confete {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confeteCair linear forwards;
}

@keyframes confeteCair {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ----------------------------------------------------------
   RESPONSIVO
   ---------------------------------------------------------- */
@media (max-width: 600px) {
  .btn-grande {
    font-size: 1.2rem;
    padding: 18px 36px;
  }
  .card {
    padding: 16px;
  }
}
