/* ==========================================================================
   Nova Escola de Dança — aviso, formulário de aula experimental e chatbot
   Usa os tokens de style.css.
   ========================================================================== */

/* Aviso no topo ----------------------------------------------------------- */
.aviso {
  position: relative; z-index: 51; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px calc(48px + var(--gutter-r)) 10px var(--gutter-l); margin-top: var(--topo-seguro);
  background: linear-gradient(90deg, var(--magenta), #a3175a 60%, var(--magenta)); color: var(--branco);
  font-size: var(--t-s); font-weight: 600; text-align: center;
}
.aviso p { margin: 0; }
.aviso a { color: var(--branco); text-underline-offset: 3px; }
.aviso button {
  position: absolute; right: var(--gutter-r); top: 50%; translate: 0 -50%;
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.18); color: inherit; cursor: pointer;
}
.aviso button:hover { background: rgb(0 0 0 / 0.3); }

/* Modal da aula experimental ------------------------------------------------ */
.modal { border: 0; padding: 0; background: transparent; color: var(--texto); max-width: none; max-height: none; width: 100%; height: 100%; }
.modal::backdrop { background: rgb(14 5 10 / 0.82); backdrop-filter: blur(6px); }
.modal[open] { display: grid; place-items: center; overflow-y: auto; padding: 16px; animation: aparecer 0.3s ease; }
.modal__caixa {
  position: relative; width: min(100%, 520px); padding: clamp(24px, 4vw, 36px);
  border-radius: calc(var(--raio) + 6px); border: 1px solid var(--vidro-borda);
  background: radial-gradient(120% 80% at 100% 0%, rgb(214 31 110 / 0.28), transparent 60%), var(--vinho);
  box-shadow: 0 40px 100px rgb(0 0 0 / 0.6); animation: surgir 0.45s var(--ease-suave);
}
.modal__fechar { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--vidro-borda); background: var(--vidro); color: var(--texto); cursor: pointer; }
.modal__fechar:hover { border-color: var(--neon); }
.modal h2 { font-size: clamp(2rem, 6vw, 2.6rem); margin: 6px 0 8px; }
.modal__lead { margin: 0 0 18px; color: var(--texto-suave); font-size: var(--t-s); }
.modal__form { display: grid; gap: 14px; }
.campo { display: grid; gap: 6px; font-size: var(--t-s); font-weight: 600; border: 0; margin: 0; padding: 0; min-width: 0; }
.campo legend { padding: 0; margin-bottom: 6px; }
.campo input, .campo select {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--raio-s);
  border: 1px solid var(--vidro-borda); background: rgb(0 0 0 / 0.25); color: var(--texto);
  font: 500 1rem/1.2 var(--f-corpo);
}
.campo select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--blush) 50%), linear-gradient(-45deg, transparent 50%, var(--blush) 50%); background-position: right 20px center, right 14px center; background-size: 6px 6px; background-repeat: no-repeat; }
.campo select option { background: var(--vinho); }
.campo input:focus, .campo select:focus { outline: 2px solid var(--neon); outline-offset: 1px; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--vidro-borda); background: var(--vidro); font-weight: 600; font-size: var(--t-xs); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.chips input:checked + span { background: var(--magenta); border-color: var(--magenta); color: var(--branco); }
.chips input:focus-visible + span { outline: 2px solid var(--neon); outline-offset: 2px; }
.aceite { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: var(--t-xs); color: var(--texto-suave); cursor: pointer; }
.aceite input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--magenta); }
.modal__isca { position: absolute; left: -9999px; width: 1px; height: 1px; }
.modal__erro { margin: 0; min-height: 1.2em; color: #ffb4c8; font-size: var(--t-s); font-weight: 600; }
.modal__erro:empty { display: none; }
.modal__enviar { width: 100%; }
.modal__enviar:disabled { opacity: 0.7; cursor: progress; }
.modal__ok { display: grid; justify-items: center; gap: 10px; text-align: center; padding-top: 8px; }
.modal__ok[hidden] { display: none; }
.modal__ok-titulo { outline: none; }
.modal__ok p { margin: 0 0 8px; color: var(--texto-suave); }
.modal__check { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 95 162 / 0.16); box-shadow: 0 0 0 1px var(--vidro-borda), 0 0 50px rgb(214 31 110 / 0.4); }
.modal__check svg { width: 36px; height: 36px; fill: none; stroke: var(--neon); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: tracar 0.6s 0.15s var(--ease-suave) forwards; }
@keyframes tracar { to { stroke-dashoffset: 0; } }

/* Chatbot ------------------------------------------------------------------ */
.chat { position: fixed; z-index: 45; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.chat .chat__fallback { position: static; }
.chat__botao {
  position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--magenta); color: var(--branco);
  box-shadow: 0 6px 24px rgb(214 31 110 / 0.55); animation: pulsar 2.6s ease-out infinite;
  transition: transform 0.25s var(--ease);
}
.chat__botao:hover { transform: scale(1.06); }
.chat__botao:focus-visible { outline: 3px solid var(--blush); outline-offset: 3px; }
.chat__botao svg { position: absolute; width: 28px; height: 28px; transition: opacity 0.2s, transform 0.3s var(--ease); }
.chat__icone { fill: currentColor; }
.chat__icone circle { fill: var(--magenta); }
.chat__x { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; opacity: 0; transform: rotate(-90deg); }
.chat.aberto .chat__botao { animation: none; }
.chat.aberto .chat__icone { opacity: 0; transform: rotate(90deg); }
.chat.aberto .chat__x { opacity: 1; transform: none; }
.chat__bolha {
  position: absolute; right: 70px; bottom: 12px; white-space: nowrap; cursor: pointer;
  padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--branco); color: var(--vinho-noite);
  font-size: var(--t-s); font-weight: 700; box-shadow: 0 10px 30px rgb(0 0 0 / 0.4); animation: surgir 0.5s var(--ease-suave);
}
.chat__bolha[hidden] { display: none; }
.chat__painel {
  position: absolute; right: 0; bottom: 74px; width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100dvh - 120px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden;
  border-radius: calc(var(--raio) + 4px); border: 1px solid var(--vidro-borda);
  background: var(--vinho); box-shadow: 0 30px 80px rgb(0 0 0 / 0.6);
  transform-origin: bottom right; animation: chat-abrir 0.35s var(--ease-suave);
}
.chat__painel[hidden] { display: none; }
@keyframes chat-abrir { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
.chat__topo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: linear-gradient(120deg, var(--magenta), #8f1450); color: var(--branco); }
.chat__topo b { display: block; font-size: var(--t-s); }
.chat__topo small { display: block; font-size: 0.75rem; opacity: 0.85; }
.chat__avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--vinho-noite); font: 800 1.1rem/1 var(--f-display); letter-spacing: 0.08em; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.5); }
.chat__wpp, .chat__fechar { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgb(0 0 0 / 0.18); color: var(--branco); cursor: pointer; }
.chat__wpp svg { width: 20px; height: 20px; }
.chat__wpp:hover, .chat__fechar:hover { background: rgb(0 0 0 / 0.32); }
.chat__corpo { overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat__msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: var(--t-s); line-height: 1.45; animation: msg 0.3s var(--ease-suave); }
.chat__msg small { color: var(--texto-suave); }
@keyframes msg { from { opacity: 0; transform: translateY(6px); } }
.chat__msg--bot { align-self: flex-start; background: var(--ameixa); border-bottom-left-radius: 4px; }
.chat__msg--eu { align-self: flex-end; background: var(--magenta); color: var(--branco); border-bottom-right-radius: 4px; }
.chat__digitando { display: flex; gap: 4px; padding: 14px; }
.chat__digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--blush); animation: digitar 1s ease-in-out infinite; }
.chat__digitando i:nth-child(2) { animation-delay: 0.15s; }
.chat__digitando i:nth-child(3) { animation-delay: 0.3s; }
@keyframes digitar { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat__opcoes { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 12px; max-height: 52%; overflow-y: auto; align-content: flex-start; }
.chat__opcoes:empty { display: none; }
.chat__opcao {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--vidro-borda); background: transparent;
  color: var(--texto); font: 600 var(--t-xs)/1.2 var(--f-corpo); text-decoration: none; cursor: pointer;
  animation: msg 0.3s var(--ease-suave) both; transition: background 0.2s, border-color 0.2s;
}
.chat__opcao:hover { border-color: var(--neon); background: rgb(255 95 162 / 0.1); }
.chat__opcao--destaque { background: var(--magenta); border-color: var(--magenta); color: var(--branco); }
.chat__opcao--destaque:hover { background: #e9307e; }
.chat__opcao:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.chat__digitar { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--vidro-borda); }
.chat__digitar input { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--vidro-borda); background: rgb(0 0 0 / 0.25); color: var(--texto); font: 500 var(--t-s) var(--f-corpo); }
.chat__digitar input:focus { outline: 2px solid var(--neon); border-color: transparent; }
.chat__digitar button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--magenta); color: var(--branco); display: grid; place-items: center; cursor: pointer; }
.chat__digitar button svg { width: 20px; height: 20px; fill: currentColor; }

@media (max-width: 560px) {
  .chat__painel { position: fixed; right: 8px; left: 8px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: auto; height: min(560px, calc(100dvh - 110px)); }
}
@media (prefers-reduced-motion: reduce) {
  .chat__botao, .chat__msg, .chat__opcao, .chat__painel, .modal__caixa { animation: none; }
}
