/* ==========================================================================
   Espectra — Calm Design System
   ========================================================================== */
:root {
  --lavanda: #a78bfa;
  --lavanda-dark: #8b5cf6;
  --lavanda-soft: #ede9fe;
  --salvia: #86efac;
  --ceu: #7dd3fc;
  --creme: #fef3e2;
  --ink: #334155;
  --line-h: 1.6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { line-height: var(--line-h); letter-spacing: 0.01em; }

/* Foco acessível (navegação por teclado / WCAG 2.1 AA) */
:focus-visible {
  outline: 3px solid var(--lavanda-dark);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar suave */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd6f3; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--lavanda-light, #c4b5fd); }

/* Animações suaves */
.fade-in { animation: fadeIn 0.45s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pop-in { animation: popIn 0.3s ease both; }
@keyframes popIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.card { transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -12px rgba(139,92,246,.25); }

.nav-link { transition: background .2s, color .2s; }

/* Likert / opções */
.option-btn { transition: all .18s ease; }
.option-btn:hover { transform: translateY(-2px); }

/* Barra de progresso */
.progress-fill { transition: width .4s cubic-bezier(.4,0,.2,1); }

/* ==========================================================================
   MODO LOW-STIM (baixa estimulação)
   Remove imagens decorativas, atenua cores -> sépia/cinza, sem animações
   ========================================================================== */
body.low-stim * {
  animation: none !important;
  transition: none !important;
}
body.low-stim {
  background: #f5f3ef !important;
  color: #3a3a3a !important;
}
body.low-stim img.decorative,
body.low-stim .decorative-illustration,
body.low-stim .stim-only {
  display: none !important;
}
/* Atenua cores fortes para tons monocromáticos suaves */
body.low-stim .stim-color {
  filter: grayscale(0.85) brightness(0.99) !important;
}
body.low-stim .bg-lavanda,
body.low-stim .bg-lavanda-dark { background-color: #8c8a96 !important; }
body.low-stim .bg-salvia,
body.low-stim .bg-salvia-soft { background-color: #e7e5e0 !important; }
body.low-stim .bg-ceu,
body.low-stim .bg-ceu-soft { background-color: #e7e5e0 !important; }
body.low-stim .text-lavanda,
body.low-stim .text-lavanda-dark { color: #5a5566 !important; }
body.low-stim .gradient-hero,
body.low-stim .gradient-soft { background: #efedea !important; }
body.low-stim .shadow-soft { box-shadow: none !important; }

/* Gradientes (desativados em low-stim) */
.gradient-hero { background: linear-gradient(135deg, #ede9fe 0%, #e0f2fe 55%, #fef3e2 100%); }
.gradient-soft { background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%); }
.gradient-lav { background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%); }

.shadow-soft { box-shadow: 0 10px 30px -12px rgba(99,86,140,.18); }

/* Emoji faces */
.emoji-face { transition: transform .18s ease, box-shadow .18s ease; }
.emoji-face:hover { transform: scale(1.06); }
.emoji-face.selected { transform: scale(1.08); box-shadow: 0 0 0 3px var(--lavanda-dark); }

/* Texto grande / leitura confortável */
.reading p { margin-bottom: 1rem; }

/* Faixa de aviso fixa */
.warning-bar { background: linear-gradient(90deg, #f97316, #ef4444); }
body.low-stim .warning-bar { background: #6b5a52 !important; }

/* Acessibilidade: respeita preferência do sistema por menos movimento */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Dark mode (could-have) */
body.dark-mode { background: #14121a !important; color: #e2e0e8 !important; }
body.dark-mode .bg-white { background: #1e1b27 !important; color: #e2e0e8 !important; }
body.dark-mode .bg-creme { background: #14121a !important; }
body.dark-mode .text-slate-700,
body.dark-mode .text-slate-800 { color: #e2e0e8 !important; }
body.dark-mode .text-slate-500,
body.dark-mode .text-slate-400 { color: #a9a6b5 !important; }
body.dark-mode .border-slate-100,
body.dark-mode .border-slate-200 { border-color: #2c2838 !important; }
body.dark-mode .gradient-hero { background: linear-gradient(135deg,#241f33,#1a2733,#241f1a) !important; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--lavanda-dark); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ===========================================================================
   ANÁLISE POR IA — tema escuro / glassmorphism futurista
   =========================================================================== */
.ia-screen {
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(124,58,237,0.22), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(34,211,238,0.16), transparent 55%),
    linear-gradient(160deg, #0b0a14 0%, #0e0c1a 50%, #0a0f1c 100%);
  padding: 24px 16px 60px;
}
.ia-wrap { max-width: 1180px; margin: 0 auto; }

:root {
  --ia-purple: #A78BFA;
  --ia-cyan: #22D3EE;
  --ia-green: #86EFAC;
}
.text-ia-purple { color: var(--ia-purple) !important; }
.text-ia-cyan { color: var(--ia-cyan) !important; }
.text-ia-green { color: var(--ia-green) !important; }

.ia-logo-badge {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7C3AED, #22D3EE);
  color: #fff; font-size: 20px; box-shadow: 0 8px 30px rgba(124,58,237,0.5);
}

.ia-card {
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
}
.ia-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ia-card-title { color: #fff; font-weight: 700; font-size: 1.05rem; }
.ia-num {
  width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, rgba(167,139,250,0.35), rgba(34,211,238,0.3));
  border: 1px solid rgba(255,255,255,0.18);
}
.ia-info { color: #8b8a9a; width: 30px; height: 30px; border-radius: 8px; }
.ia-info:hover { background: rgba(255,255,255,0.06); color: #fff; }

.ia-pill-btn {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #cbd5e1;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  transition: all .2s;
}
.ia-pill-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* métricas */
.ia-metric { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; padding: 11px 12px; }
.ia-metric-label { font-size: 11px; color: #9ca3b8; margin-bottom: 3px; }
.ia-metric-val { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }

/* waveform */
.ia-wave { position: relative; height: 90px; background: rgba(0,0,0,0.25); border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.06); }
.ia-wave canvas { width: 100%; height: 100%; display: block; }
.ia-wave-idle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6b7280; font-size: 13px; }

/* botão de ação */
.ia-action {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 12px 14px; color: #fff; transition: all .2s; text-align: left;
}
.ia-action:hover { background: rgba(167,139,250,0.16); border-color: rgba(167,139,250,0.4); }
.ia-action-stop { background: rgba(248,113,113,0.14); border-color: rgba(248,113,113,0.4); }
.ia-mic {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #7C3AED, #22D3EE);
}
.ia-mic.rec { background: linear-gradient(135deg, #ef4444, #f97316); animation: iaPulse 1.2s infinite; }
@keyframes iaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } }

.ia-local { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #7dd3fc; margin-top: 10px; }
.ia-local i { color: #22D3EE; }

/* vídeo */
.ia-video-frame { position: relative; aspect-ratio: 4/3; background: #05070f; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.ia-video-frame video, .ia-video-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.ia-video-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6b7280; font-size: 12px; text-align: center; padding: 14px; }
.ia-corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--ia-cyan); }
.ia-corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.ia-corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.ia-corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.ia-corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

/* desenho */
.ia-draw-stage { position: relative; background: #0b1020; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); min-height: 180px; }
.ia-draw-stage canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }
.ia-draw-toolbar { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; }
.ia-tool { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.14); color: #fff; }
.ia-tool:hover { background: rgba(255,255,255,0.2); }
.ia-tool-primary { background: linear-gradient(135deg, #7C3AED, #22D3EE); border: 0; }
.ia-upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed rgba(255,255,255,0.22); border-radius: 14px; color: #9ca3b8; padding: 14px; cursor: pointer; transition: all .2s;
}
.ia-upload:hover { border-color: var(--ia-cyan); color: #cbd5e1; background: rgba(34,211,238,0.05); }
.ia-insights { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; padding: 14px; }
.ia-insight-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; color: #b6b4c4; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ia-insight-row:last-child { border-bottom: 0; }

/* medidor (gauge) */
.ia-gauge { position: relative; }
.ia-gauge-label { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }

/* aviso ético */
.ia-warning {
  display: flex; align-items: center; gap: 10px;
  background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.35);
  border-radius: 14px; padding: 12px 16px; color: #fcd34d; font-size: 13px;
}
.ia-warning strong { color: #fde68a; }

/* low-stim: suaviza o tema da IA */
body.low-stim .ia-screen { background: #15131c !important; }
body.low-stim .ia-card, body.low-stim .ia-metric, body.low-stim .ia-insights { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.low-stim .ia-mic.rec { animation: none !important; }
body.low-stim .ia-logo-badge, body.low-stim .ia-mic, body.low-stim .ia-tool-primary { background: #6b6480 !important; }

/* =========================================================================
   PERFIL SENSORIAL 3D (Boneco · Dunn)
   ========================================================================= */
.sns-wrap { max-width: 1100px; margin: 0 auto; padding: 4px 2px 40px; }
.sns-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sns-badge { background: #ede9fe; color: #6d28d9; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.sns-info { background: #f5f3ff; border: 1px solid #e9d5ff; color: #6d28d9; border-radius: 14px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.sns-info-soft { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.sns-inline { color: #6d28d9; font-weight: 700; text-decoration: underline; }
.sns-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .sns-grid { grid-template-columns: 1fr; } }
.sns-stage-card { background: #fff; border: 1px solid #eef0f5; border-radius: 20px; padding: 14px; box-shadow: 0 6px 22px rgba(80,60,140,.06); }
.sns-stage-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sns-hover { font-size: 12px; color: #94a3b8; }
.sns-stage { width: 100%; height: 420px; border-radius: 16px; background: radial-gradient(circle at 50% 30%, #faf7ff, #eef0fb); cursor: grab; touch-action: none; }
.sns-stage:active { cursor: grabbing; }
.sns-fallback, .aur-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #94a3b8; font-size: 14px; text-align: center; gap: 6px; }
.sns-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 10px; font-size: 12px; color: #64748b; }
.sns-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.sns-panel { background: #fff; border: 1px solid #eef0f5; border-radius: 20px; padding: 16px; box-shadow: 0 6px 22px rgba(80,60,140,.06); }
#sns-radar { max-height: 220px; margin-bottom: 10px; }
.sns-sliders { display: flex; flex-direction: column; gap: 14px; }
.sns-slider-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.sns-slider-label { font-weight: 600; color: #475569; }
.sns-slider-label i { color: #a78bfa; margin-right: 6px; }
.sns-slider-q { font-size: 12px; font-weight: 700; }
.sns-slider input[type=range] { width: 100%; accent-color: #a78bfa; margin: 6px 0 2px; }
.sns-slider-desc { font-size: 11px; color: #94a3b8; margin: 0; }
.sns-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.sns-card { background: #fff; border: 1px solid #eef0f5; border-radius: 16px; padding: 14px; box-shadow: 0 4px 14px rgba(80,60,140,.05); }
.sns-card-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 8px; }
.sns-card h3 { font-size: 14px; font-weight: 700; color: #334155; margin: 0 0 2px; }
.sns-card-q { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.sns-card p { font-size: 11px; color: #64748b; margin: 0; line-height: 1.4; }
.sns-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.sns-btn, .aur-btn-ghost, .sns-btn-ghost { border: none; border-radius: 12px; padding: 11px 18px; font-weight: 700; font-size: 14px; cursor: pointer; }
.sns-btn { background: #a78bfa; color: #fff; }
.sns-btn-ghost, .aur-btn-ghost { background: #f1f5f9; color: #475569; }
.sns-disc, .aur-disc { font-size: 12px; color: #94a3b8; margin-top: 16px; text-align: center; }
.sns-disc i, .aur-disc i { color: #a78bfa; margin-right: 4px; }

/* =========================================================================
   MUNDO AURORA (Phaser)
   ========================================================================= */
.aur-wrap { max-width: 1100px; margin: 0 auto; padding: 4px 2px 40px; }
.aur-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.aur-stats { display: flex; gap: 16px; font-size: 14px; color: #475569; }
.aur-stats i { color: #fbbf24; margin-right: 4px; }
.aur-info { background: #f5f3ff; border: 1px solid #e9d5ff; color: #6d28d9; border-radius: 14px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.aur-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 860px) { .aur-grid { grid-template-columns: 1fr; } }
.aur-stage-card { background: #0f1226; border-radius: 20px; padding: 8px; box-shadow: 0 8px 28px rgba(40,30,90,.18); overflow: hidden; }
.aur-stage { width: 100%; min-height: 460px; border-radius: 14px; overflow: hidden; }
.aur-stage canvas { border-radius: 14px; display: block; margin: 0 auto; max-width: 100%; }
.aur-side { display: flex; flex-direction: column; gap: 14px; }
.aur-side-card { background: #fff; border: 1px solid #eef0f5; border-radius: 18px; padding: 16px; box-shadow: 0 6px 22px rgba(80,60,140,.06); }
.aur-side-card h3 { font-size: 14px; font-weight: 700; color: #334155; margin: 0 0 10px; }
.aur-side-card h3 i { color: #a78bfa; margin-right: 6px; }
.aur-metric { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; color: #64748b; }
.aur-metric:last-child { border-bottom: none; }
.aur-metric strong { color: #6d28d9; font-size: 16px; }
.aur-howto p { font-size: 13px; color: #64748b; margin: 0; line-height: 1.5; }

/* low-stim suaviza animações intensas do jogo/3D */
body.low-stim .sns-stage { background: #f3f4f8 !important; }
body.low-stim .aur-stage-card { background: #2a2640 !important; }
