/* ════════════════════════════════════════
   Reset & Variáveis — Spiltag Brand Colors
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1D1D1B;
  --surface: #242420;
  --surface-dark: #191917;
  --surface-mid: #252522;
  --border: rgba(211,204,195,0.1);
  --accent: #BC2E19;
  --accent2: #EE736C;
  --text: #D3CCC3;
  --muted: #8a847d;
  --card-bg: #2a2a27;
}

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(188,46,25,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(238,115,108,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ════════════════════════════════════════
   Loading
════════════════════════════════════════ */
#loading {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 99;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   Login
════════════════════════════════════════ */
#login-screen {
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 48px 42px;
  width: 100%; max-width: 410px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: fadeUp 0.6s ease both;
}

/* Assinatura: o gesto da batuta — traço que se desenha na carga */
.login-gesture {
  display: block;
  width: 120px; height: 38px;
  margin: 0 auto 18px;
}

.login-gesture path,
.greeting-gesture path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: gesture-draw 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}

.login-gesture circle,
.greeting-gesture circle {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.4);
  animation: gesture-tip 0.3s ease-out 1.15s forwards;
}

@keyframes gesture-draw { to { stroke-dashoffset: 0; } }
@keyframes gesture-tip  { to { opacity: 1; transform: scale(1); } }

.login-title {
  font-family: 'Syne', sans-serif;
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}

.login-eyebrow {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
}

.login-sub {
  font-size: 14px; color: var(--muted);
  margin-bottom: 32px; line-height: 1.5;
}

.btn-microsoft {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  background: #fff; color: #1a1a1a;
  border: none; border-radius: 10px;
  padding: 14px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}

.btn-microsoft:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.btn-microsoft:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-microsoft:focus-visible,
.login-privacy a:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .login-box, .card { animation: none; }
  .login-gesture path, .greeting-gesture path { animation: none; stroke-dashoffset: 0; }
  .login-gesture circle, .greeting-gesture circle { animation: none; opacity: 1; transform: scale(1); }
  .btn-microsoft, .btn-microsoft:hover,
  .card, .card:hover { transition: none; transform: none; }
}

.login-footer {
  margin-top: 24px; font-size: 12px; color: var(--muted);
}

.error-box {
  margin-top: 16px; padding: 12px;
  background: rgba(188,46,25,0.1);
  border: 1px solid rgba(188,46,25,0.3);
  border-radius: 8px;
  font-size: 12px; color: var(--accent2);
  text-align: left; word-break: break-all;
  display: none;
}

/* ════════════════════════════════════════
   Portal / Topbar
════════════════════════════════════════ */
#portal { display: none; min-height: 100vh; position: relative; z-index: 1; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px;
  background: rgba(29,29,27,0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 18px; letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}

/* Gesto da batuta compacto no topbar/sidebar (estático — a animação fica no hero) */
.brand-gesture { width: 44px; height: 14px; flex: none; }

.topbar-user { display: flex; align-items: center; gap: 12px; }

/* Revelado pelo app.js via classe (nunca estilo inline — o inline venceria
   o display:none das media queries e vazaria o link no mobile) */
.admin-link { display: none; }
.admin-link.is-visible { display: inline-flex; }

.user-name, .topbar-link, .btn-logout { white-space: nowrap; }
.user-avatar { flex-shrink: 0; }

.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}

.user-name { font-size: 14px; color: var(--text); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 14px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.btn-logout:hover { color: var(--text); border-color: rgba(211,204,195,0.3); }

.card:focus-visible, .btn-logout:focus-visible, .topbar-link:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}

/* Topbar responsivo — 768px (não 600) porque a viewport CSS de celulares
   grandes com escala de tela (ex.: Galaxy S/Ultra) chega a ~640px */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; }
  .user-name { display: none; }
  .topbar-link { display: none; }
  .admin-link.is-visible { display: inline-flex; } /* admin continua acessível */
  .policy-topbar .topbar-link { display: inline-flex; }
}

@media (max-width: 480px) {
  .topbar .brand-gesture { display: none; } /* sobra só o wordmark; libera ~54px */
}

/* ════════════════════════════════════════
   Main / Cards
════════════════════════════════════════ */
.main { max-width: 1100px; margin: 0 auto; padding: 60px 32px 80px; }

.main-greeting { margin-bottom: 48px; }

/* Assinatura do portal: o gesto se desenha sobre a saudação */
.greeting-gesture { display: block; width: 120px; height: 38px; margin-bottom: 16px; }
.main-greeting h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin-bottom: 10px;
  color: var(--text);
}
.main-greeting p { color: var(--muted); font-size: 15px; }

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 48px;
}

.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 14px;
  transition: all 0.25s; animation: fadeUp 0.5s ease both;
}

.card:hover {
  border-color: rgba(188,46,25,0.4);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  background: #312f2c;
}

.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

.card-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--text); }
.card-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 4px; }

.card-arrow {
  margin-top: auto; font-size: 18px; color: var(--muted);
  transition: transform 0.2s, color 0.2s; align-self: flex-end;
}
.card:hover .card-arrow { transform: translate(3px, -3px); color: var(--accent); }

.card:nth-child(1){animation-delay:.05s} .card:nth-child(2){animation-delay:.10s}
.card:nth-child(3){animation-delay:.15s} .card:nth-child(4){animation-delay:.20s}
.card:nth-child(5){animation-delay:.25s} .card:nth-child(6){animation-delay:.30s}

/* ════════════════════════════════════════
   Responsivo
════════════════════════════════════════ */
@media(max-width:600px) {
  .main { padding: 32px 16px 60px; }
  .cards-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ════════════════════════════════════════
   Página do Chat (/chat) — layout tela cheia
   Sidebar colapsável + coluna central + composer pílula.
   Nomes com prefixo chat-/sb-/msg- para não colidir com o portal
   (.main/.topbar são do index).
════════════════════════════════════════ */
.chat-app {
  display: none; /* chat.js liga (flex) após o auth validar a sessão */
  height: 100dvh;
  position: relative;
}

/* ── Sidebar ── */
.chat-sidebar {
  width: 264px; flex-shrink: 0;
  background: var(--surface-dark);
  border-right: 1px solid rgba(211,204,195,0.06);
  display: flex; flex-direction: column;
  transition: margin-left 0.25s ease;
}
.chat-app.collapsed .chat-sidebar { margin-left: -264px; }

.sb-top { padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 10px; }
.sb-brand-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.sb-brand { display: flex; align-items: center; gap: 9px; font-family: 'Syne', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: 0.02em; color: #EEE9E2; }
.sb-brand .brand-gesture { width: 38px; height: 12px; }

.chat-icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: background 0.15s, color 0.15s;
}
.chat-icon-btn:hover { background: rgba(211,204,195,0.07); color: #EEE9E2; }
.chat-icon-btn svg { width: 17px; height: 17px; }

.btn-new-chat {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(188,46,25,0.12);
  border: 1px solid rgba(188,46,25,0.28);
  color: var(--accent2); font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 13.5px;
  cursor: pointer; transition: background 0.15s;
}
.btn-new-chat:hover { background: rgba(188,46,25,0.2); }
.btn-new-chat svg { width: 15px; height: 15px; }

.sb-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface-mid); border: 1px solid rgba(211,204,195,0.06);
  color: var(--muted);
}
.sb-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.sb-search input {
  background: none; border: none; outline: none; width: 100%;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px;
}
.sb-search input::placeholder { color: var(--muted); }

.sb-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sb-list::-webkit-scrollbar { width: 4px; }
.sb-list::-webkit-scrollbar-thumb { background: rgba(211,204,195,0.12); border-radius: 4px; }
.sb-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); padding: 14px 10px 5px;
}
.sb-empty { font-size: 12px; color: var(--muted); padding: 12px 10px; }
.sb-item {
  display: flex; align-items: center; gap: 6px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 9px;
  font-size: 13.5px; color: var(--text);
  cursor: pointer; transition: background 0.15s;
}
.sb-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item:hover { background: rgba(211,204,195,0.06); }
.sb-item.active { background: rgba(188,46,25,0.14); color: #EEE9E2; }
.sb-more {
  opacity: 0; color: var(--muted);
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.sb-item:hover .sb-more, .sb-more:focus-visible { opacity: 1; }
.sb-more:hover { color: #EEE9E2; background: rgba(211,204,195,0.06); }
.sb-more svg { width: 13px; height: 13px; }

.sb-foot {
  border-top: 1px solid rgba(211,204,195,0.06);
  padding: 10px 12px; display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: 'Syne', sans-serif;
}
.sb-who { flex: 1; min-width: 0; }
.sb-who b { display: block; font-size: 13px; font-weight: 600; color: #EEE9E2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-who small { font-size: 11px; color: var(--muted); }
.sb-foot .btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: 'DM Sans', sans-serif; font-size: 12px;
}
.sb-foot .btn-logout:hover { color: var(--accent2); }

/* ── Área principal ── */
.chat-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }

.chat-topbar {
  height: 52px; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
}
.chat-topbar .reveal { display: none; }
.chat-app.collapsed .chat-topbar .reveal { display: inline-flex; }
.chat-topbar-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: #EEE9E2; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
.chat-topbar .spacer { flex: 1; }
.portal-link {
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.portal-link:hover { background: rgba(211,204,195,0.07); color: #EEE9E2; }

/* ── Thread ── */
.chat-thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.chat-thread::-webkit-scrollbar { width: 5px; }
.chat-thread::-webkit-scrollbar-thumb { background: rgba(211,204,195,0.12); border-radius: 5px; }
.chat-col { max-width: 768px; margin: 0 auto; padding: 18px 24px 10px; display: flex; flex-direction: column; gap: 26px; }
.chat-col-typing { padding-top: 0; padding-bottom: 16px; }

.msg-user { display: flex; justify-content: flex-end; animation: fadeUp 0.3s ease; }
.msg-bubble {
  max-width: 78%;
  background: var(--card-bg); border: 1px solid rgba(211,204,195,0.06);
  color: #EEE9E2;
  padding: 11px 16px; border-radius: 18px; border-bottom-right-radius: 6px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap;
  overflow-wrap: break-word; word-break: break-word;
}

.msg-bot { display: flex; gap: 12px; animation: fadeUp 0.3s ease; }
.bot-mark {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; font-family: 'Syne', sans-serif;
}
.msg-body { min-width: 0; font-size: 14px; line-height: 1.7; overflow-wrap: break-word; word-break: break-word; }
.msg-body p { margin: 0; }
.msg-body p + p, .msg-body ul + p, .msg-body ol + p { margin-top: 10px; }
.msg-body ul, .msg-body ol { margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.msg-body strong { color: #EEE9E2; }
.msg-body code {
  background: rgba(211,204,195,0.09); padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
}
.msg-actions { display: flex; gap: 2px; margin-top: 8px; opacity: 0; transition: opacity 0.15s; }
.msg-bot:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-actions .chat-icon-btn { width: 26px; height: 26px; }
.msg-actions .chat-icon-btn svg { width: 14px; height: 14px; }
.msg-actions .chat-icon-btn.copied { color: var(--accent2); }

/* ── Typing ── */
.typing-indicator { display: none; gap: 12px; align-items: center; }
.typing-indicator.active { display: flex; }
.typing-dots { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typingBounce 1.2s infinite; }
.typing-dot:nth-child(2){animation-delay:.2s} .typing-dot:nth-child(3){animation-delay:.4s}
@keyframes typingBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }
.typing-label { font-size: 12.5px; color: var(--muted); }

/* ── Composer ── */
.composer-zone { flex-shrink: 0; padding: 4px 24px 14px; }
.composer {
  /* 720px = largura útil da .chat-col (768px − 2×24px de padding): a barra
     alinha com a coluna de mensagens e nunca estica de ponta a ponta.
     width:100% mantém fluido abaixo do teto (tela estreita/celular). */
  width: 100%; max-width: 720px; margin: 0 auto;
  background: var(--surface-mid); border: 1px solid var(--border);
  border-radius: 28px;
  padding: 12px 10px 12px 22px;
  display: flex; align-items: flex-end; gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  transition: border-color 0.2s;
}
.composer:focus-within { border-color: rgba(188,46,25,0.45); }
.chat-input {
  flex: 1; background: transparent; border: none; outline: none; resize: none;
  color: #EEE9E2; font-family: 'DM Sans', sans-serif; font-size: 15px; line-height: 1.55;
  min-height: 24px; max-height: 200px; padding: 7px 0;
  overflow-y: hidden;
}
.chat-input::placeholder { color: var(--muted); }
.chat-send {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s, opacity 0.15s;
}
.chat-send:hover { transform: scale(1.06); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.chat-send svg { width: 17px; height: 17px; }
.chat-hint { margin: 7px auto 0; text-align: center; font-size: 10.5px; color: var(--muted); }

/* ── Estado vazio (conversa sem mensagens) ── */
.chat-empty-view { flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.chat-app.view-empty .chat-empty-view { display: flex; }
.chat-app.view-empty .chat-thread, .chat-app.view-empty .composer-zone { display: none; }
.empty-inner { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
/* Barra do estado vazio um pouco mais alta (presença de "hero", como no ChatGPT) */
.chat-empty-view .composer { padding: 15px 12px 15px 24px; }
.greeting { text-align: center; }
.greeting h1 { font-family: 'DM Sans', sans-serif; font-size: 32px; font-weight: 500; letter-spacing: -0.01em; color: #EEE9E2; text-wrap: balance; }
.greeting p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.suggestion-list { display: flex; flex-direction: column; }
.suggestion {
  width: 100%; text-align: left;
  padding: 13px 4px;
  background: none; border: none; cursor: pointer;
  border-bottom: 1px solid rgba(211,204,195,0.06);
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--muted);
  transition: color 0.15s;
}
.suggestion:last-child { border-bottom: none; }
.suggestion:hover { color: var(--accent2); }

/* ── Menu de contexto da conversa (⋯) ── */
.ctx-menu {
  position: fixed; z-index: 60; display: none;
  min-width: 190px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
}
.ctx-menu.open { display: block; }
.ctx-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  transition: background 0.12s;
}
.ctx-menu button:hover { background: rgba(211,204,195,0.07); }
.ctx-menu button svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.ctx-menu .sep { height: 1px; background: rgba(211,204,195,0.06); margin: 5px 8px; }
.ctx-menu .danger, .ctx-menu .danger svg { color: #ff6b6b; }
.ctx-menu .danger:hover { background: rgba(255,107,107,0.1); }

/* ── Confirmação de exclusão ── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
.confirm-overlay.open { display: flex; }
.confirm-box {
  width: 100%; max-width: 400px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.confirm-box h2 { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; color: #EEE9E2; }
.confirm-box p { margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.confirm-box p b { color: var(--text); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.btn-ghost {
  padding: 8px 16px; border-radius: 10px; font-size: 13px;
  background: none; border: 1px solid var(--border); color: var(--text);
  font-family: 'DM Sans', sans-serif; cursor: pointer;
}
.btn-ghost:hover { background: rgba(211,204,195,0.06); }
.btn-danger {
  padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: var(--accent); border: none; color: #fff;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
}
.btn-danger:hover { background: #d43a22; }

/* ── Reenvio idempotente após falha transitória ── */
.msg-retry-row { display: flex; margin: 2px 0 14px; }
.msg-retry-btn {
  background: var(--surface-mid); color: var(--accent2);
  border: 1px solid rgba(188,46,25,0.35); border-radius: 999px;
  padding: 7px 16px; font-size: 13px;
  font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.2s;
}
.msg-retry-btn:hover { background: rgba(188,46,25,0.12); }
.msg-retry-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 3px; }

/* Aviso transitório (pendência aberta / conversa somente leitura) */
.msg-hint-row {
  margin: 2px 0 14px; font-size: 12.5px; color: var(--muted);
  border-left: 2px solid rgba(188,46,25,0.4); padding-left: 10px;
}

.chat-input:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Responsivo ── */
@media (max-width: 800px) {
  .chat-sidebar { position: absolute; z-index: 30; height: 100%; box-shadow: 10px 0 30px rgba(0,0,0,0.4); }
  .chat-app:not(.collapsed) .chat-sidebar { margin-left: 0; }
}
/* 768 (não 600): viewport de celulares grandes com escala chega a ~640px */
@media (max-width: 768px) {
  .chat-col { padding: 14px 14px 10px; }
  .composer-zone { padding: 4px 12px 12px; }
  .composer { padding: 10px 8px 10px 16px; border-radius: 24px; }
  .chat-empty-view { padding: 16px 14px; }
  .greeting h1 { font-size: 24px; }
}

/* Privacy and cookies */
.login-privacy {
  margin: 14px auto 0;
  max-width: 300px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.login-privacy a,
.topbar-link,
.policy-section a {
  color: var(--accent2);
  text-decoration: none;
}

.login-privacy a:hover,
.topbar-link:hover,
.policy-section a:hover {
  color: var(--text);
  text-decoration: underline;
}

.topbar-link {
  font-size: 13px;
  color: var(--muted);
}

.policy-topbar {
  position: sticky;
}

.policy-topbar-brand {
  text-decoration: none;
}

.policy-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.policy-login-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.policy-page {
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: 36px 32px 72px;
}

.policy-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.policy-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.6fr);
  gap: 32px;
  align-items: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-dark) 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 44px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.32);
  margin-bottom: 28px;
  animation: fadeUp 0.45s ease both;
}
/* brilho de marca no canto do hero */
.policy-hero::before {
  content: '';
  position: absolute;
  top: -45%; right: -8%;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(188,46,25,0.18) 0%, transparent 65%);
  pointer-events: none;
}
.policy-hero > div { position: relative; z-index: 1; }

.policy-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(238,115,108,0.3);
  border-radius: 999px;
  color: var(--accent2);
  background: rgba(188,46,25,0.1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.policy-badge::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.policy-hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 4.5vw, 46px);
  letter-spacing: -1.5px;
  line-height: 1.03;
  margin-bottom: 16px;
  color: var(--text);
}

.policy-lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

.policy-summary {
  display: grid;
  gap: 10px;
}

.policy-summary span {
  position: relative;
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px 13px 40px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.policy-summary span::before {
  content: '✓';
  position: absolute;
  left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--accent2);
  font-weight: 700;
}

.policy-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.policy-nav {
  position: sticky;
  top: 88px;
  background: var(--surface-dark);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.policy-nav p {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.policy-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 9px;
  border-left: 2px solid transparent;
  transition: all 0.18s;
}

.policy-nav a:hover {
  background: rgba(188,46,25,0.1);
  color: var(--accent2);
  border-left-color: var(--accent);
}

.policy-nav span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  margin-top: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.policy-content {
  display: grid;
  gap: 14px;
}

.policy-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  animation: fadeUp 0.5s ease both;
}
.policy-section:hover {
  border-color: rgba(188,46,25,0.35);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0,0,0,0.26);
}
.policy-section:nth-child(1){animation-delay:.04s}
.policy-section:nth-child(2){animation-delay:.08s}
.policy-section:nth-child(3){animation-delay:.12s}
.policy-section:nth-child(4){animation-delay:.16s}
.policy-section:nth-child(5){animation-delay:.20s}
.policy-section:nth-child(6){animation-delay:.24s}

.policy-section h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--text);
}

.policy-section p,
.policy-section li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.policy-section ul {
  display: grid;
  gap: 10px;
  padding-left: 2px;
  list-style: none;
}
.policy-section li {
  position: relative;
  padding-left: 22px;
}
.policy-section li::before {
  content: '';
  position: absolute;
  left: 2px; top: 10px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.policy-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.policy-table th,
.policy-table td {
  border-bottom: 1px solid var(--border);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  color: var(--muted);
  line-height: 1.55;
}

.policy-table thead th {
  background: var(--surface-dark);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.policy-table tbody td:first-child { color: var(--text); font-weight: 500; }
.policy-table tbody tr:hover td { background: rgba(255,255,255,0.025); }

.policy-table tr:last-child td {
  border-bottom: none;
}

.policy-callout {
  border-left: 3px solid var(--accent);
  background: rgba(188,46,25,0.08);
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--text);
}

.policy-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.policy-footer a {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.policy-footer a:first-child {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.policy-footer a:first-child:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(188,46,25,0.35);
}
.policy-footer a:last-child {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.policy-footer a:last-child:hover {
  color: var(--text);
  border-color: rgba(211,204,195,0.3);
}

@media(max-width:600px) {
  .login-box { max-width: calc(100% - 32px); padding: 42px 28px 34px; }
  .policy-page { padding: 20px 14px 48px; }
  .policy-hero {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    border-radius: 16px;
  }
  .policy-hero h1 { font-size: 34px; }
  .policy-layout { grid-template-columns: 1fr; }
  .policy-nav {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .policy-nav p,
  .policy-nav span {
    grid-column: 1 / -1;
  }
  .policy-section { padding: 20px; }
  .policy-table { display: block; overflow-x: auto; }
}
