/* Cívia, assistente do protótipo interno da home (home-ia.html).
   Usa os tokens de ../capital.css: --navy, --blue, --blue-bright, --gold, --gold-ink, --blue-soft, --gold-soft, --line, --muted, --ink. */

.civia-av { display: block; width: 100%; height: 100%; object-fit: contain; }

/* botão flutuante */
.civia-launch { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; padding: 5px 18px 5px 5px; border: 2px solid var(--gold); border-radius: 999px; background: #fff; color: var(--navy); font: inherit; font-weight: 800; font-size: 15px; box-shadow: 0 14px 34px rgba(8, 28, 52, .28); cursor: pointer; transition: transform .2s, box-shadow .2s, opacity .25s; }
.civia-launch:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(8, 28, 52, .34); }
.civia-launch[aria-expanded="true"] { display: none; }
.civia-launch .civia-av-box { width: 52px; height: 52px; border-radius: 50%; background: var(--blue-soft); display: grid; place-items: center; overflow: hidden; }
.civia-launch .civia-av { width: 52px; height: 52px; animation: civia-float 3.2s ease-in-out infinite; }

.civia-hint { position: fixed; right: 24px; bottom: 90px; z-index: 60; display: flex; gap: 8px; align-items: flex-start; background: var(--navy); color: #fff; padding: 10px 10px 10px 14px; border-radius: 14px 14px 4px 14px; font-size: 14px; font-weight: 600; line-height: 1.35; box-shadow: 0 16px 36px rgba(8, 28, 52, .3); max-width: 250px; cursor: pointer; }
.civia-hint[hidden] { display: none; }
.civia-hint button { flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 16px; line-height: 1; }

/* painel */
.civia-panel { position: fixed; right: 20px; bottom: 20px; z-index: 61; width: min(400px, calc(100vw - 24px)); height: min(660px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: 0 30px 70px rgba(8, 28, 52, .38); overflow: hidden; border: 1px solid #dfe7ef; }
.civia-panel[hidden] { display: none; }
.civia-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: radial-gradient(700px 300px at 20% -40%, #17548f 0%, var(--navy) 60%, #071a30 100%); color: #fff; border-bottom: 4px solid var(--gold); }
.civia-head-av { width: 48px; height: 48px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: 0 0 auto; }
.civia-head-av .civia-av { width: 46px; height: 46px; }
.civia-title { flex: 1; min-width: 0; }
.civia-title b { display: block; font-size: 17px; line-height: 1.2; }
.civia-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #c8d9ea; }
.civia-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #56d364; }
.civia-status.local::before { background: var(--gold); }
.civia-tools { display: flex; gap: 4px; }
.civia-tools button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; }
.civia-tools button:hover { background: rgba(255, 255, 255, .18); }
.civia-tools button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }

/* mensagens */
.civia-msgs { flex: 1; overflow: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 12px; background: #f4f7fa; scroll-behavior: smooth; }
.civia-m { display: flex; gap: 8px; align-items: flex-end; max-width: 94%; animation: civia-in .25s ease-out; }
.civia-m.user { align-self: flex-end; flex-direction: row-reverse; max-width: 86%; }
.civia-av-s { flex: 0 0 auto; width: 34px; height: 34px; }
.civia-av-s .civia-av { width: 34px; height: 34px; }
.civia-b { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.civia-bubble { background: #fff; border: 1px solid #e1e8ef; color: var(--ink); padding: 10px 14px; border-radius: 16px 16px 16px 4px; font-size: 15px; line-height: 1.5; }
.civia-m.user .civia-bubble { background: var(--blue-bright); color: #fff; border-color: var(--blue-bright); border-radius: 16px 16px 4px 16px; }
.civia-bubble p { margin: 0; }
.civia-bubble p + p, .civia-bubble p + ul { margin-top: 6px; }
.civia-bubble ul { margin: 0; padding-left: 18px; }
.civia-bubble li + li { margin-top: 2px; }
.civia-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.civia-typing { display: inline-flex; gap: 4px; padding: 4px 2px; vertical-align: middle; }
.civia-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: civia-blink 1s infinite; }
.civia-typing i:nth-child(2) { animation-delay: .15s; }
.civia-typing i:nth-child(3) { animation-delay: .3s; }

.civia-cards { display: flex; flex-direction: column; gap: 8px; }
.civia-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid #d5e0ea; border-left: 4px solid var(--gold); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: inherit; transition: border-color .2s, box-shadow .2s; }
.civia-card:hover, .civia-card:focus-visible { border-color: var(--blue-bright); box-shadow: 0 8px 20px rgba(16, 40, 70, .1); }
.civia-card b { font-size: 15px; color: var(--navy); line-height: 1.25; }
.civia-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.civia-card .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
.civia-card .row span { display: inline-flex; align-items: center; gap: 4px; }
.civia-card .go { margin-left: auto; color: var(--blue-bright); font-weight: 800; font-size: 13px; background: none; min-height: 0; padding: 0; border-radius: 0; } /* anula o .go global do capital.css (botão azul), que escondia o texto */

.civia-contact { background: var(--gold-soft); border: 1px solid #f1d98a; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.civia-contact b { color: var(--gold-ink); }
.civia-contact a { color: var(--blue); font-weight: 700; }

.civia-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.civia-chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid #b7cde0; background: var(--blue-soft); color: var(--blue); font: inherit; font-weight: 600; font-size: 13px; }
.civia-chip:hover { background: #c9ddf0; }
.civia-chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.civia-note { display: flex; gap: 10px; align-items: flex-start; background: #fff8e6; border: 1px solid #f1d98a; color: #5a4300; font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 12px; }
.civia-note svg { flex: 0 0 auto; margin-top: 2px; }
.civia-note button { margin-left: auto; flex: 0 0 auto; border: 0; background: var(--gold); color: var(--gold-ink); font: inherit; font-weight: 700; font-size: 13px; border-radius: 8px; padding: 6px 10px; }

/* entrada */
.civia-form { display: flex; gap: 8px; padding: 10px 12px 8px; border-top: 1px solid #e1e8ef; background: #fff; }
.civia-form input { flex: 1; min-width: 0; min-height: 46px; border: 2px solid #c9d6e2; border-radius: 12px; padding: 0 14px; font: inherit; font-size: 15px; color: var(--ink); background: #f7fafc; }
.civia-form input:focus { outline: none; border-color: var(--blue-bright); box-shadow: 0 0 0 4px rgba(20, 120, 212, .18); background: #fff; }
.civia-send { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; border: 0; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; }
.civia-send:hover { background: #e0a31a; }
.civia-send:disabled { opacity: .5; cursor: default; }
.civia-foot { font-size: 11px; color: var(--muted); text-align: center; padding: 0 14px 9px; background: #fff; line-height: 1.35; }

/* personagem em movimento */
.civia-head-av .civia-av[data-humor="achou"] { animation: civia-bounce .5s ease-out; }
.civia-head-av .civia-av[data-humor="pensando"] { transform: rotate(-7deg); }
.civia-head-av .civia-av[data-humor="naosei"] { transform: rotate(5deg); }
.civia-head-av .civia-av { transition: transform .3s; }
@keyframes civia-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes civia-bounce { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes civia-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes civia-in { from { opacity: 0; transform: translateY(6px); } }

/* integração com a caixa "Como posso te ajudar?" */
.ask-civia { margin-top: 12px; }
.ask-civia-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--blue-soft); border: 1px dashed #9dbbd8; border-radius: 14px; padding: 7px 14px 7px 7px; color: var(--navy); font: inherit; font-size: 14px; line-height: 1.35; cursor: pointer; }
.ask-civia-btn:hover { background: #c9ddf0; border-style: solid; }
.ask-civia-btn > span:nth-child(2) { flex: 1; }
.ask-civia-av { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; }
.ask-civia-av .civia-av { width: 44px; height: 44px; }
.ask-civia-go { flex: 0 0 auto; font-weight: 800; color: var(--blue-bright); white-space: nowrap; }
.civia-inline { border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 700; text-decoration: underline; padding: 0; cursor: pointer; }

/* carinha da Cívia no título da caixa */
.ask-card h1 { align-items: center; }
.ask-civia-face { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-soft); overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; }
.ask-civia-face .civia-av { width: 42px; height: 42px; }
.ask-card .ask-field { padding-left: 16px; }

/* lupa do cabeçalho: o componente já existe em capital.css; aqui só garante o lugar dele ao lado do Acesse */
.site .nav .search.icon { display: flex; margin-left: auto; flex: 0 0 auto; min-width: 0; }
.site .nav nav.main { flex: 1; }

/* botão flutuante em espera enquanto a caixa está na tela */
.civia-launch.civia-launch-espera { opacity: 0; pointer-events: none; transform: translateY(12px); }

@media (max-width: 600px) {
  .civia-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .civia-launch { padding-right: 5px; }
  .civia-launch b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ask-civia-go { display: none; }
  /* com a lupa no cabeçalho, o logo é quem cede espaço no celular */
  .site .nav .brand { flex: 1 1 auto; min-width: 0; }
  .site .nav .brand img { width: 100%; height: auto; max-width: 231px; }
  .site .nav .menu-btn, .site .nav .s-toggle { flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .civia-launch .civia-av, .civia-m, .civia-head-av .civia-av, .civia-typing i { animation: none; }
  .civia-head-av .civia-av { transition: none; }
  .civia-msgs { scroll-behavior: auto; }
  .civia-launch, .civia-launch:hover { transition: none; transform: none; }
}
