/* Estilos compartilhados da Editta (protótipo visual) */

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { font-family: 'Inter', system-ui, sans-serif; }

/* scrollbar customizada (Chrome/Edge) — o padrão do Chrome é bem feio */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d0ea; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

/* ---- animação de entrada ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.anim { opacity: 0; animation: fadeUp .7s cubic-bezier(.22, 1, .36, 1) both; }

/* ---- glow de fundo flutuante ---- */
@keyframes floatGlow {
  0%, 100% { transform: translateX(-50%) translateZ(0) scale(1);   opacity: .9; }
  50%      { transform: translateX(-50%) translateZ(0) translateY(-24px) scale(1.1); opacity: 1; }
}
/* translateZ(0) força compositing de GPU no Chrome, garantindo que o blur renderize */
.glow-float {
  animation: floatGlow 9s ease-in-out infinite;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ---- brilho que varre o botão ---- */
.btn-shine {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .8s cubic-bezier(.22, 1, .36, 1);
}
.group:hover .btn-shine { transform: translateX(130%); }

/* ---- chip de nicho selecionável (onboarding / filtros) ---- */
.niche-chip.is-active {
  background-color: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #fff !important;
}

/* ---- balãozinho de filtros (popover) ---- */
@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.pop-in { animation: popIn .18s ease-out both; transform-origin: top right; }

/* ---- slider customizado (orçamento) ---- */
.range-editta {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;            /* área de arraste */
  background: transparent;
  cursor: pointer;
  touch-action: none;      /* permite arrastar no touch */
  --pct: 50%;
}
/* trilho — WebKit */
.range-editta::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed 0%, #c026d3 var(--pct), #ece9fb var(--pct), #ece9fb 100%);
}
/* thumb — WebKit */
.range-editta::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 22px;
  width: 22px;
  margin-top: -7px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 3px #7c3aed, 0 4px 12px rgba(124, 58, 237, .45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.range-editta:hover::-webkit-slider-thumb  { transform: scale(1.12); }
.range-editta:active::-webkit-slider-thumb { transform: scale(1.2); box-shadow: 0 0 0 5px rgba(124, 58, 237, .25), 0 4px 14px rgba(124, 58, 237, .5); }
.range-editta:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(124, 58, 237, .3), 0 4px 12px rgba(124, 58, 237, .45); }

/* trilho — Firefox */
.range-editta::-moz-range-track    { height: 8px; border-radius: 999px; background: #ece9fb; }
.range-editta::-moz-range-progress { height: 8px; border-radius: 999px; background: linear-gradient(90deg, #7c3aed, #c026d3); }
.range-editta::-moz-range-thumb {
  height: 22px; width: 22px; border: none; border-radius: 999px; background: #fff;
  box-shadow: 0 0 0 3px #7c3aed, 0 4px 12px rgba(124, 58, 237, .45);
  transition: transform .15s ease;
}
.range-editta:active::-moz-range-thumb { transform: scale(1.2); }

@media (prefers-reduced-motion: reduce) {
  .anim, .glow-float, .btn-shine { animation: none !important; transition: none !important; opacity: 1 !important; }
  #page-overlay { animation: none !important; opacity: 0 !important; }
  .skeleton     { animation: none !important; }
  .mascot-greeter, .mascot-scene, .mascot-spot { animation: none !important; }
}

/* ---- transição entre páginas ---- */
#page-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fbfbfd;
  pointer-events: none;
  opacity: 0; /* fallback: sem animação, fica invisível */
  animation: overlayOut 0.45s cubic-bezier(.22, 1, .36, 1) 0.06s both;
}
@keyframes overlayOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
#page-overlay.is-leaving {
  animation: overlayIn 0.22s ease-in both;
  pointer-events: all;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- animações de troca de página (catálogo) ---- */
@keyframes pageOutLeft  { to { opacity: 0; transform: translateX(-36px); } }
@keyframes pageOutRight { to { opacity: 0; transform: translateX(36px);  } }
@keyframes pageInRight  { from { opacity: 0; transform: translateX(36px);  } to { opacity: 1; transform: none; } }
@keyframes pageInLeft   { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
.page-out-left  { animation: pageOutLeft  0.18s ease-in      both; pointer-events: none; }
.page-out-right { animation: pageOutRight 0.18s ease-in      both; pointer-events: none; }
.page-in-right  { animation: pageInRight  0.3s  cubic-bezier(.22,1,.36,1) both; }
.page-in-left   { animation: pageInLeft   0.3s  cubic-bezier(.22,1,.36,1) both; }

/* ---- animação de entrada de avisos / erros ---- */
@keyframes alertIn {
  0%   { opacity: 0; transform: translateY(-6px) scale(.97); }
  60%  { opacity: 1; transform: translateY(2px)  scale(1.005); }
  100% { opacity: 1; transform: none; }
}
.alert-in {
  animation: alertIn 0.28s cubic-bezier(.22, 1, .36, 1) both;
}

/* ---- skeleton de carregamento (catálogo) ---- */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.skeleton {
  background: linear-gradient(90deg, #f0eef8 25%, #e4e0f5 50%, #f0eef8 75%) !important;
  background-size: 200% 100% !important;
  animation: shimmer 1.4s ease-in-out infinite;
  color: transparent !important;
}

/* ---- mascotes (landing page) ---- */
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes mascotFloatSlow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.mascot-greeter, .mascot-scene {
  display: block;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;       /* puramente decorativo, não atrapalha cliques */
  will-change: transform;
}
.mascot-greeter {
  height: 7rem;               /* ~112px */
  width: auto;
  margin-bottom: .5rem;
  animation: mascotFloat 4.5s ease-in-out infinite;
}
.mascot-scene {
  width: 100%;
  max-width: 26rem;
  margin-top: 3rem;
  filter: drop-shadow(0 24px 32px rgba(124, 58, 237, .15));
  animation: mascotFloatSlow 6.5s ease-in-out infinite;
}
@media (min-width: 640px) {
  .mascot-greeter { height: 9rem; }   /* ~144px */
  .mascot-scene   { max-width: 30rem; margin-top: 3.5rem; }
}

/* No PC (>=1024px): mascotes vão pros cantos, ladeando o texto central.
   No mobile/tablet continuam empilhados no fluxo (regras acima). */
@media (min-width: 1024px) {
  .hero-relative { position: relative; }

  /* 2 — canto superior direito: mascote acenando */
  .mascot-greeter-wrap {
    position: absolute;
    top: 1rem;
    right: 2.5rem;
    margin: 0;
    z-index: 0;
  }
  .mascot-greeter { height: 12rem; margin: 0; }   /* ~192px */

  /* 1 — canto inferior esquerdo: mascote editando */
  .mascot-scene-wrap {
    position: absolute;
    left: 2rem;
    bottom: 1.5rem;
    margin: 0;
    z-index: 0;
  }
  .mascot-scene { max-width: 21rem; margin: 0; }   /* ~336px */
}

/* Telas bem largas: pode crescer e respirar mais */
@media (min-width: 1440px) {
  .mascot-greeter { height: 14rem; }
  .mascot-scene   { max-width: 25rem; }
}

/* ---- mascote "avulso" (boas-vindas, estados vazios, onboarding) ---- */
.mascot-spot {
  display: block;
  width: auto;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  animation: mascotFloat 4.5s ease-in-out infinite;
  will-change: transform;
}
.mascot-spot--sm   { height: 4rem; }    /* ~64px */
.mascot-spot--md   { height: 6.5rem; }  /* ~104px */
.mascot-spot--left { margin-left: 0; margin-right: auto; }
