/* W Studios voice editor reveal: specter art, lightning and cursor smoke. */
.voice-vfx-surface {
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
}

.voice-vfx-surface > textarea,
.voice-vfx-textarea-frame > textarea {
  position: relative;
  z-index: 3;
  background: transparent !important;
}

.voice-vfx-textarea-frame {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.voice-vfx-textarea-frame #ai33el-text {
  flex: 1;
}

.voice-vfx-stage {
  --vfx-image-opacity: .24;
  --vfx-flash-image-opacity: .56;
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(110deg, transparent 10%, rgba(112,128,145,.045) 48%, transparent 84%);
  transition: opacity 90ms linear;
  contain: strict;
}

.voice-vfx-stage.is-visible {
  opacity: 1;
}

.voice-vfx-stage.is-fading {
  opacity: 0;
  transition: opacity 2s cubic-bezier(.22,.66,.24,1);
}

.voice-vfx-image {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: center;
  opacity: var(--vfx-image-opacity);
  filter: grayscale(.22) saturate(.72) contrast(1.08);
  transform: scale(1.018);
  transition: opacity 70ms linear, filter 75ms ease, transform 120ms ease;
}

.voice-vfx-stage.is-flashing .voice-vfx-image {
  opacity: var(--vfx-flash-image-opacity);
  filter: grayscale(.08) saturate(1.04) contrast(1.22) brightness(.96);
  transform: scale(1.026);
  transition-duration: 16ms, 22ms, 45ms;
}

.voice-vfx-haze {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 0 30%, rgba(238,243,247,.07) 68%, rgba(221,228,234,.13) 100%),
    linear-gradient(90deg, rgba(246,249,251,.13), transparent 22% 78%, rgba(246,249,251,.13));
}

.voice-vfx-stage.is-flashing::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--vfx-flare-x, 50%) 42%, rgba(255,255,255,.94), rgba(198,229,255,.34) 28%, transparent 64%),
    rgba(255,255,255,var(--vfx-wash-opacity, .28));
  mix-blend-mode: screen;
}

.voice-vfx-surface.voice-vfx-box-flash {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.9),
    inset 0 0 46px rgba(151,217,255,.5),
    0 0 22px rgba(151,217,255,.3) !important;
}

body[data-design="arctic"] .voice-vfx-stage {
  --vfx-image-opacity: .28;
  --vfx-flash-image-opacity: .62;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.2), transparent 55%),
    linear-gradient(110deg, transparent 10%, rgba(92,107,123,.06) 48%, transparent 84%);
}

body[data-design="arctic"] .voice-vfx-image {
  filter: grayscale(.3) saturate(.62) contrast(1.12);
}

/* Nos três temas claros a arte ganha corpo no pulso de luz, sem virar um
   clarão branco que apaga o personagem. */
body[data-design="arctic"][data-gradient="white"] .voice-vfx-stage {
  --vfx-image-opacity: .46;
  --vfx-flash-image-opacity: .84;
}

body[data-design="arctic"][data-gradient="metallic-white"] .voice-vfx-stage {
  --vfx-image-opacity: .5;
  --vfx-flash-image-opacity: .87;
}

body[data-design="arctic"]:is([data-gradient="white"], [data-gradient="metallic-white"]) .voice-vfx-image {
  filter: grayscale(.12) saturate(.9) contrast(1.24) brightness(.9);
}

body[data-design="arctic"]:is([data-gradient="white"], [data-gradient="metallic-white"]) .voice-vfx-stage.is-flashing .voice-vfx-image {
  filter: grayscale(0) saturate(1.14) contrast(1.46) brightness(.84);
}

body[data-design="arctic"]:is([data-gradient="white"], [data-gradient="metallic-white"], [data-gradient="metallic-pink"]) .voice-vfx-haze {
  opacity: .54;
  transition: opacity 65ms linear;
}

body[data-design="arctic"]:is([data-gradient="white"], [data-gradient="metallic-white"], [data-gradient="metallic-pink"]) .voice-vfx-stage.is-flashing .voice-vfx-haze {
  opacity: .08;
}

body[data-design="arctic"]:is([data-gradient="white"], [data-gradient="metallic-white"], [data-gradient="metallic-pink"]) .voice-vfx-stage.is-flashing::after {
  opacity: .38;
}

body[data-gradient="blue"] .voice-vfx-image,
body[data-gradient="green"] .voice-vfx-image,
body[data-gradient="gold"] .voice-vfx-image {
  opacity: .28;
  filter: saturate(.9) contrast(1.1);
}

body[data-gradient="metallic-pink"] .voice-vfx-stage {
  --vfx-image-opacity: .54;
  --vfx-flash-image-opacity: .89;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(110deg, transparent 10%, rgba(190,79,124,.08) 48%, transparent 84%);
}

body[data-gradient="metallic-pink"] .voice-vfx-image {
  filter: saturate(1.03) contrast(1.22) brightness(.94);
}

body[data-gradient="metallic-pink"] .voice-vfx-stage.is-flashing .voice-vfx-image {
  filter: saturate(1.28) contrast(1.4) brightness(.94);
}

body[data-design="arctic"][data-gradient="metallic-pink"] .voice-vfx-stage.is-flashing::after {
  opacity: .32;
}

body[data-gradient="metallic-pink"] .voice-vfx-surface.voice-vfx-box-flash {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.94),
    inset 0 0 48px rgba(242,151,188,.52),
    0 0 24px rgba(198,78,126,.3) !important;
}

#voice-smoke-canvas {
  position: fixed;
  inset: 0;
  z-index: 420;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: .97;
  filter: blur(.9px) saturate(1.16) contrast(1.07);
  transition: opacity .24s ease;
}

#voice-smoke-canvas.is-disabled {
  opacity: 0;
}

.mouse-smoke-toggle {
  --smoke-accent: #6576d8;
  position: relative;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  overflow: hidden;
  color: #52606e;
  border: 1px solid rgba(85,101,121,.17);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(235,240,244,.76)) padding-box,
    linear-gradient(120deg, #fff, rgba(111,128,149,.42), #fff) border-box;
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgba(44,58,77,.07);
  font-family: inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}

.mouse-smoke-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 14px;
  width: 30px;
  height: 22px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--smoke-accent) 22%, transparent), transparent 68%);
  filter: blur(4px);
  transform: translate(-50%, -50%);
  animation: smoke-toggle-breathe 2.2s ease-in-out infinite;
}

.mouse-smoke-toggle:hover {
  color: #202933;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 #fff, 0 8px 19px rgba(57,68,111,.12);
}

.mouse-smoke-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--smoke-accent) 62%, white);
  outline-offset: 2px;
}

.mouse-smoke-icon,
.mouse-smoke-label,
.mouse-smoke-switch {
  position: relative;
  z-index: 1;
}

.mouse-smoke-icon {
  color: var(--smoke-accent);
  font-size: 18px !important;
}

.mouse-smoke-label {
  font-size: .62rem;
  font-weight: 800;
  white-space: nowrap;
}

.mouse-smoke-switch {
  position: relative;
  width: 29px;
  height: 17px;
  flex: 0 0 29px;
  border: 1px solid color-mix(in srgb, var(--smoke-accent) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--smoke-accent) 17%, white);
  box-shadow: inset 0 1px 3px rgba(45,55,78,.12);
}

.mouse-smoke-switch i {
  position: absolute;
  top: 2px;
  left: 13px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, var(--smoke-accent));
  box-shadow: 0 2px 5px color-mix(in srgb, var(--smoke-accent) 42%, transparent);
  transition: left .24s cubic-bezier(.2,.8,.2,1), background .2s ease;
}

.mouse-smoke-toggle[data-smoke-state="off"] {
  color: #7d8792;
  background: rgba(239,242,244,.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

.mouse-smoke-toggle[data-smoke-state="off"]::before {
  animation: none;
  opacity: 0;
}

.mouse-smoke-toggle[data-smoke-state="off"] .mouse-smoke-icon {
  color: #8c96a1;
}

.mouse-smoke-toggle[data-smoke-state="off"] .mouse-smoke-switch {
  border-color: rgba(105,117,131,.2);
  background: rgba(132,144,157,.13);
}

.mouse-smoke-toggle[data-smoke-state="off"] .mouse-smoke-switch i {
  left: 3px;
  background: linear-gradient(145deg, #fff, #9aa4af);
  box-shadow: 0 2px 5px rgba(66,78,91,.16);
}

body[data-gradient="metallic-pink"] .mouse-smoke-toggle {
  --smoke-accent: #c34682;
  color: #765363;
  border-color: rgba(151,72,104,.2);
  background:
    linear-gradient(145deg, rgba(255,255,255,.94), rgba(246,222,233,.8)) padding-box,
    linear-gradient(120deg, #fff, rgba(195,70,130,.5), #fff) border-box;
  box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgba(118,52,82,.08);
}

@keyframes smoke-toggle-breathe {
  0%, 100% { opacity: .4; transform: translate(-50%, -50%) scale(.8); }
  50% { opacity: .9; transform: translate(-50%, -50%) scale(1.18); }
}

body:not(.dashboard-mode) #voice-smoke-canvas {
  display: none;
}

@media (max-width: 700px), (pointer: coarse) {
  #voice-smoke-canvas { display: none !important; }
  .mouse-smoke-toggle { display: none !important; }
  .voice-vfx-stage { --vfx-image-opacity: .2; }
}

@media (max-width: 1540px) {
  .mouse-smoke-label { display: none; }
  .mouse-smoke-toggle { gap: 5px; padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #voice-smoke-canvas { display: none !important; }
  .voice-vfx-stage.is-fading { transition-duration: .35s; }
}
