/* =========================================================
   base-zazzy — componentes Spell UI adaptados (vanilla HTML/CSS/JS)
   Origem: https://spell.sh/ (biblioteca de componentes React, copy-paste)
   Adaptação: reescritos em HTML/CSS/JS puro sem build step, sem React,
   integrados aos design tokens do base-zazzy (tokens.css).
   Componentes WebGL (Light Rays, Animated Gradient) não foram adaptados.
   ========================================================= */

/* ---------- BADGE ---------- */
.spell-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--raio);
  border: 1px solid var(--line);
  background: var(--coal);
  color: var(--cream);
  font-family: var(--fonte-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 1;
  transition: all 0.25s var(--ease);
}
.spell-badge:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--gold-glow);
}
.spell-badge--gold {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}
.spell-badge--gold:hover {
  background: var(--cream);
  color: var(--ink);
}

/* ---------- BUTTON: POP ---------- */
.spell-btn-pop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--raio);
  border: 0;
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--fonte-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease);
}
.spell-btn-pop:active {
  transform: translateY(3px) scale(0.97);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.spell-btn-pop:hover {
  box-shadow: 0 12px 32px var(--gold-glow);
}
.spell-btn-pop:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

/* ---------- BUTTON: FLOW ---------- */
.spell-btn-flow {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--raio);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font-family: var(--fonte-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.spell-btn-flow::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed transparent;
  border-radius: var(--raio);
  transition: border-color 0.6s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.spell-btn-flow:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.spell-btn-flow:hover::before {
  border-color: var(--gold);
  transform: translate(4px, 4px);
}
.spell-btn-flow:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

/* ---------- INPUT: LABEL (floating label) ---------- */
.spell-input-label {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 360px;
}
.spell-input-label label {
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--muted);
  font-family: var(--fonte-corpo);
  font-size: 0.95rem;
  pointer-events: none;
  transition: all 0.25s var(--ease);
}
.spell-input-label input {
  width: 100%;
  padding: 14px 14px 10px;
  border-radius: var(--raio);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font-family: var(--fonte-corpo);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-sizing: border-box;
}
.spell-input-label input::placeholder {
  color: transparent;
}
.spell-input-label input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.spell-input-label input:focus + label,
.spell-input-label input:not(:placeholder-shown) + label {
  top: -8px;
  left: 8px;
  font-size: 0.75rem;
  color: var(--gold);
  background: var(--ink);
  padding: 0 6px;
}

/* ---------- SPINNER ---------- */
.spell-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spell-spin 0.8s linear infinite;
}
@keyframes spell-spin {
  to { transform: rotate(360deg); }
}
.spell-spinner--sm { width: 24px; height: 24px; border-width: 2px; }

/* ---------- TEXT: BLUR REVEAL ---------- */
.spell-blur-reveal {
  display: inline-block;
  filter: blur(12px);
  opacity: 0;
  animation: spell-blur-reveal 1s var(--ease) forwards;
}
@keyframes spell-blur-reveal {
  to { filter: blur(0); opacity: 1; }
}
.spell-blur-reveal--delayed { animation-delay: 0.4s; }

/* ---------- TEXT: SHIMMER ---------- */
.spell-shimmer-text {
  display: inline-block;
  position: relative;
  color: var(--cream);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-size: 200% 100%;
  -webkit-mask-size: 200% 100%;
  animation: spell-shimmer 2s var(--ease) infinite;
  background: linear-gradient(90deg, var(--muted), var(--gold), var(--muted));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes spell-shimmer {
  0% { mask-position: -100% 0; -webkit-mask-position: -100% 0; background-position: -100% 0; }
  100% { mask-position: 200% 0; -webkit-mask-position: 200% 0; background-position: 200% 0; }
}

/* ---------- TILT CARD ---------- */
.spell-tilt-card {
  position: relative;
  display: inline-block;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.1s cubic-bezier(0.23, 1, 0.32, 1);
}
.spell-tilt-card__face {
  position: relative;
  transform: translateZ(40px);
  transition: transform 0.4s var(--ease);
}
.spell-tilt-card:hover .spell-tilt-card__face {
  transform: translateZ(60px);
}

/* ---------- RESPECTA PREFERS-REDUCED-MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .spell-btn-pop:active { transform: none; }
  .spell-btn-flow::before { transition: none; }
  .spell-blur-reveal { animation: none; filter: none; opacity: 1; }
  .spell-shimmer-text { animation: none; mask-size: auto; -webkit-mask-size: auto; background-size: auto; -webkit-background-clip: initial; background-clip: initial; color: var(--cream); }
  .spell-spinner { animation: none; }
  .spell-tilt-card { transition: none; transform: none; }
}
