/* ============================================================
   Godoy Advogados — Portal do Cliente
   Identidade: grafite #272624 · dourado #917B59 · champanhe #B7A892
   Mobile-first, sem fontes externas (PWA offline-first)
   ============================================================ */

:root {
  --grafite: #272624;
  --grafite-2: #4A4642;
  --dourado: #917B59;
  --dourado-escuro: #75613F;
  --champanhe: #B7A892;
  --champanhe-claro: #E4DCCE;
  --areia: #F6F3EE;
  --branco: #FFFFFF;
  --ok: #4A7C59;
  --alerta: #A4553D;
  --sombra: 0 1px 2px rgba(39, 38, 36, .06), 0 4px 16px rgba(39, 38, 36, .07);
  --raio: 14px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--grafite);
  background: var(--areia);
  min-height: 100vh;
  padding-bottom: 84px; /* espaço da nav inferior */
}

/* ---------- Cabeçalho ---------- */
.topbar {
  background: var(--grafite);
  color: var(--branco);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.selo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--dourado);
  color: var(--dourado);
  font-family: var(--serif);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-nome { font-family: var(--serif); font-size: 17px; letter-spacing: .02em; }
.brand-sub {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--champanhe);
}

.topbar .nav-desktop { margin-left: auto; display: none; gap: 4px; }
.topbar .nav-desktop a {
  color: var(--champanhe-claro);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: 8px;
}
.topbar .nav-desktop a:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Navegação inferior (celular = app) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--branco);
  border-top: 1px solid var(--champanhe-claro);
  box-shadow: 0 -4px 18px rgba(39, 38, 36, .08);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--grafite-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.tabbar a.ativo { color: var(--dourado-escuro); font-weight: 700; }
.tabbar a.ativo svg { stroke: var(--dourado); }

/* ---------- Página ---------- */
.page {
  max-width: 660px;
  margin: 0 auto;
  padding: 22px 18px 40px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 27px; margin: 6px 0 8px; }
h2 { font-size: 19px; margin: 26px 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--dourado-escuro);
  margin: 0;
  font-weight: 700;
}

/* ---------- Mensagens flash ---------- */
.messages { margin-bottom: 14px; }
.message {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  background: var(--branco);
  border-left: 4px solid var(--dourado);
  box-shadow: var(--sombra);
  margin: 0 0 8px;
}
.message.error { border-left-color: var(--alerta); }
.message.success { border-left-color: var(--ok); }

/* ---------- Hero ---------- */
.hero { padding: 6px 2px 4px; }
.hero p { color: var(--grafite-2); margin: 4px 0 14px; font-size: 15px; }
.hero.compact { padding-bottom: 0; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 12px; }

.card {
  background: var(--branco);
  border: 1px solid var(--champanhe-claro);
  border-radius: var(--raio);
  padding: 18px;
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.card-link .seta { color: var(--dourado); font-size: 22px; flex: none; }

.notice {
  background: #FBF6EC;
  border: 1px solid var(--champanhe);
  border-radius: var(--raio);
  padding: 16px 18px;
  margin-top: 18px;
}
.notice h2 { margin-top: 0; font-size: 16px; }
.notice .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--champanhe);
  font-size: 14.5px;
}
.notice .row:first-of-type { border-top: 0; }

/* ---------- Botões ---------- */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dourado);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15.5px;
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease;
  min-height: 46px;
}
.button:hover, button:hover { background: var(--dourado-escuro); }
.button.small { padding: 8px 14px; min-height: 36px; font-size: 13.5px; }
.button.ghost {
  background: transparent;
  color: var(--dourado-escuro);
  border: 1.5px solid var(--champanhe);
}
.button.ghost:hover { background: var(--branco); }

/* ---------- Formulários ---------- */
.auth-panel { max-width: 420px; margin: 0 auto; text-align: center; }
.auth-panel .selo {
  width: 62px;
  height: 62px;
  font-size: 34px;
  margin: 18px auto 10px;
  border-width: 2px;
}
.auth-panel h1 { margin-bottom: 4px; }
.auth-panel > p { color: var(--grafite-2); font-size: 14.5px; }

.form-card {
  background: var(--branco);
  border: 1px solid var(--champanhe-claro);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 20px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.form-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--grafite-2);
}
.form-card input, .form-card select, .form-card textarea {
  font: inherit;
  padding: 13px 12px;
  border: 1.5px solid var(--champanhe);
  border-radius: 10px;
  background: #FDFCFA;
  color: var(--grafite);
  min-height: 48px;
}
.form-card textarea { min-height: 96px; resize: vertical; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: 2px solid var(--dourado);
  outline-offset: 1px;
  border-color: var(--dourado);
}
.form-card details { font-size: 13.5px; color: var(--grafite-2); }
.form-card details summary { cursor: pointer; color: var(--dourado-escuro); font-weight: 700; }
.form-card details label { margin-top: 10px; }

/* ---------- Timeline ---------- */
.timeline { margin-top: 10px; }
.timeline-item {
  position: relative;
  padding: 2px 0 22px 26px;
  border-left: 2px solid var(--champanhe);
  margin-left: 8px;
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dourado);
  border: 2.5px solid var(--areia);
}
.timeline-item time {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dourado-escuro);
}
.timeline-item p { margin: 4px 0 2px; font-size: 15px; }
.timeline-item span {
  font-size: 11.5px;
  color: var(--champanhe);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ---------- Aviso WhatsApp ---------- */
.whatsapp {
  background: var(--branco);
  border: 1px solid var(--champanhe-claro);
  border-radius: var(--raio);
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--grafite-2);
  margin: 14px 0 4px;
}
.whatsapp a { color: var(--dourado-escuro); font-weight: 700; }

/* ---------- Chat ---------- */
.chat-panel { margin-top: 12px; }
.chat-history { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.chat-bubble {
  max-width: 88%;
  border-radius: 16px;
  padding: 11px 14px;
  box-shadow: var(--sombra);
  font-size: 14.5px;
}
.chat-bubble span {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 3px;
  opacity: .75;
  font-weight: 700;
}
.chat-bubble p { margin: 0; white-space: pre-wrap; }
.chat-bubble.user {
  align-self: flex-end;
  background: var(--grafite);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant, .chat-bubble.assistente {
  align-self: flex-start;
  background: var(--branco);
  border: 1px solid var(--champanhe-claro);
  border-bottom-left-radius: 4px;
}
.empty-chat { color: var(--grafite-2); font-size: 14px; text-align: center; padding: 18px 0; }

/* ---------- Admin (sóbrio, funcional) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--branco);
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--champanhe-claro); }
th { background: var(--grafite); color: var(--champanhe-claro); font-weight: 600; font-size: 12.5px; }

/* ---------- Acessibilidade ---------- */
a:focus-visible, button:focus-visible, .button:focus-visible {
  outline: 3px solid var(--dourado);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  body { padding-bottom: 40px; }
  .tabbar { display: none; }
  .topbar { padding: 16px 32px; }
  .topbar .nav-desktop { display: flex; }
  .page { padding-top: 34px; }
  h1 { font-size: 32px; }
  .grid { grid-template-columns: 1fr 1fr; }
}
