:root{--bg:#ffffff;--text:#1f2937;--muted:#6b7280;--primary:#0ea5e9;--border:#e5e7eb;--radius:16px;--shadow:0 8px 24px rgba(15,23,42,.06)}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:var(--bg);line-height:1.5;overscroll-behavior-y:none}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}

.container{max-width:1100px;margin:0 auto;padding:7.5px 25px}
.section{padding:24px 0}
.space{height:16px}
.row{display:flex;gap:16px;align-items:center}
.center{text-align:center}

/* Header */
.header{position:sticky;top:0;z-index:10;border-bottom:1px solid var(--border);background:rgba(255,255,255,.85);backdrop-filter:blur(8px)}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:24px}
.brand{display:flex;align-items:center;gap:12px;font-weight:400}
.brand img{height:40px;width:auto}
.brand-title{font-size:18px;font-weight:600}
.brand-subtitle{font-size:12px;color:var(--muted)}
.nav{display:flex;gap:24px}
.header-cta{display:flex;align-items:center;gap:12px}
.greeting{color:var(--muted)}

/* Panels / Home */
.home-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.panel{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);padding:24px}
.panel-title{font-size:20px;font-weight:600;margin:0 0 12px}
.panel-actions{display:flex;gap:12px;align-items:center;margin-top:16px}
@media(max-width:900px){.home-grid{grid-template-columns:1fr}}

/* Buttons */
.btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;border-radius:8px;font-weight:400;border:1px solid transparent;transition:.2s;cursor:pointer}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{filter:brightness(.96)}
.btn-ghost{background:transparent;color:var(--text);border-color:var(--border)}
.btn-ghost:hover{background:#f8fafc}
.icon{font-size:18px;line-height:1}

/* Cards / Grid (menu & outros) */
.grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.card{border:1px solid var(--border);border-radius:12px;padding:24px;background:#fff}
.chip.active{background:#e2e8f0;border-color:#cbd5e1}

/* Typography & helpers */
h1,h2,h3{margin:0 0 12px}
p{margin:0 0 12px;color:var(--muted)}
.badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:600;font-size:12px}
/* Destaque do status 'Em análise' na consulta */
.badge-analise{background:#f59e0b;color:#fff}
.help{color:var(--muted);font-size:14px}
.code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:#f1f5f9;padding:2px 6px;border-radius:6px}
.success{color:#16a34a}

/* Lists */
/* List base + menu (mobile) */
.list{display:grid;gap:12px}
.list-item{display:flex;align-items:center;justify-content:space-between;padding:12px;border:1px solid var(--border);border-radius:12px;background:#fff}
.menu-list .list-item{padding:14px 16px}
.menu-list .list-item{display:flex;align-items:center;justify-content:space-between}
.menu-list .list-item .left{flex:1}
.menu-list .list-item .left>div{width:100%}
.menu-icon{width:22px;height:22px;color:#0f172a}
.menu-chevron{width:22px;height:22px;color:#94a3b8}

/* Forms */
.form .input,.form .select,.form .textarea{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:#fff}
.form .input:focus,.form .select:focus,.form .textarea:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 3px rgba(147,197,253,.35)}
.label{display:block;color:#374151;font-weight:400;margin-bottom:4px}
/* Espaço vertical entre blocos de campos no formulário */
.form > div + div{margin-top:12px}
/* Grid utilitário para formulários responsivos (2 colunas desktop, 1 mobile) */
.form-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:700px){.form-grid-2{grid-template-columns:1fr}}

/* Tailwind-like utilities usadas no app-cartorio */
.bg-white{background:#fff}
.text-gray-800{color:#1f2937}
.text-gray-700{color:#374151}
.rounded-lg{border-radius:8px}
.rounded-xl{border-radius:12px}
.px-4{padding-left:16px;padding-right:16px}
.py-2{padding-top:8px;padding-bottom:8px}
.gap-2{gap:8px}
.font-medium{font-weight:400}
.mb-10px{margin-bottom:10px}

/* Footer */
.footer{border-top:1px solid var(--border);padding:24px;color:var(--muted)}
.footer-inner{display:flex;align-items:center;justify-content:space-between;gap:16px}

/* Responsividade baseado em /app-cartorio */
@media (max-width: 699px){
  .show-until-699{display:block !important}
  .hide-until-699{display:none !important}
  main{padding-bottom:72px}
  .py-8{padding-top:2rem;padding-bottom:5rem}
  .text-until-699-center{text-align:center}
}
@media (min-width: 700px){
  .show-until-699{display:none !important}
  .hide-until-699{display:block !important}
}

@media (max-width: 500px){
  .stack-mobile-500{flex-direction:column !important}
  .stack-mobile-500 .btn{width:100%}
  .row.stack-variable{flex-direction:column !important}
  .row.stack-variable .btn{width:100%}
}
@media (max-width: 999px){
  .stack-variable{flex-direction:column !important}
  .stack-variable .btn{width:100%}
}
@media (max-width: 767px){
  .stack-variable{flex-direction:row !important}
  .stack-variable .btn{width:auto}
}
@media (max-width: 850px){
  .header{display:none !important}
}
.header-cta .btn{height:60px;padding:0 16px;align-items:center}
/* Espaçamento vertical adicional e simétrico no header */
.header-inner{padding-top:14px;padding-bottom:14px}
/* Empilhar conteúdo até 699px: protocolo/created + status */
.stack-until-699{display:flex;align-items:center;justify-content:space-between}
@media (max-width: 699px){
  .stack-until-699{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:.5rem}
}

/* Bottom nav para mobile (<=699px) */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--border);z-index:100}
.bottom-nav-inner{max-width:1100px;margin:0 auto;padding:8px 16px}
.bottom-nav-items{display:flex;align-items:center;justify-content:space-around}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;color:#374151;gap:4px}
.bottom-nav a svg{width:24px;height:24px;color:#0f172a}
.bottom-nav a .text-xs{font-size:12px;color:#6b7280}
.avatar{width:96px;height:96px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:flex;align-items:center;justify-content:center}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar-placeholder{font-size:12px;color:#6b7280}
.avatar-sm{width:50px;height:50px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:inline-flex;align-items:center;justify-content:center}
.avatar-sm img{width:100%;height:100%;object-fit:cover;display:block}
.quick-nav{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:17.5px}
.chip{display:flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid var(--border);border-radius:999px;background:#f3f4f6;color:var(--text)}
.chip svg{color:#0f172a}
.w-100{width:100%}
.btn-danger{background:#e24a3c;color:#fff;border-color:#e24a3c}
.btn-danger:hover{filter:brightness(0.95)}
+/* Settings (Conta) */
+.settings-avatar-row{align-items:flex-start}

/* Section padding (≥851px): desktop e tablet */
.section{padding:25px}

/* Section padding (≤850px): mobile */
@media (max-width: 850px){
  .section{padding:25px 25px 100px 25px}
}
/* Footer oculto e bottom-nav visível até 850px */
@media (max-width: 850px){
  .footer{display:none !important}
}
/* Força o bottom-nav (que usa .show-until-699) a aparecer de 700px a 850px */
@media (min-width: 700px) and (max-width: 850px){
  .bottom-nav.show-until-699{display:block !important}
}

/* Centralizar card nas páginas Entrar e Cadastrar */
body[data-view="entrar"] main.container.section,
body[data-view="cadastrar"] main.container.section{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  min-height:100dvh;
  padding:25px !important;
}

body[data-view="entrar"] .header,
body[data-view="cadastrar"] .header,
body[data-view="entrar"] .footer,
body[data-view="cadastrar"] .footer,
body[data-view="entrar"] .bottom-nav,
body[data-view="cadastrar"] .bottom-nav{display:none !important}
/* Auth cards - melhorias visuais */
.auth-card{
  max-width: 520px;
  margin: 0 auto;
  padding: 28px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.auth-card .panel-title{ text-align:center; margin-bottom: 12px; }
.auth-card .help{ text-align:center; }

/* Input com botão para ver/ocultar senha */
.input-affix{ position: relative; }
.input-affix .input{ padding-right: 44px; }
.btn-icon{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
}
.btn-icon:hover{ background: #f1f5f9; }

@media (max-width: 500px){
  .auth-card{ padding: 24px; border-radius: 14px; }
}
@media (max-width: 500px){
  body[data-view="conta"] #settings-section .buttons-row{flex-direction:column}
  body[data-view="conta"] #settings-section .buttons-row .btn{justify-content:center;text-align:center}
  body[data-view="conta"] #settings-section .settings-avatar-row .label{text-align:center}
}
@media (max-width: 999px){
  .stack-variable{flex-direction:column !important}
  .stack-variable .btn{width:100%}
}
@media (max-width: 767px){
  .stack-variable{flex-direction:row !important}
  .stack-variable .btn{width:auto}
}
@media (max-width: 850px){
  .header{display:none !important}
}
.header-cta .btn{height:60px;padding:0 16px;align-items:center}
/* Espaçamento vertical adicional e simétrico no header */
.header-inner{padding-top:14px;padding-bottom:14px}
/* Empilhar conteúdo até 699px: protocolo/created + status */
.stack-until-699{display:flex;align-items:center;justify-content:space-between}
@media (max-width: 699px){
  .stack-until-699{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:.5rem}
}

/* Bottom nav para mobile (<=699px) */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--border);z-index:100}
.bottom-nav-inner{max-width:1100px;margin:0 auto;padding:8px 16px}
.bottom-nav-items{display:flex;align-items:center;justify-content:space-around}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;color:#374151;gap:4px}
.bottom-nav a svg{width:24px;height:24px;color:#0f172a}
.bottom-nav a .text-xs{font-size:12px;color:#6b7280}
.avatar{width:96px;height:96px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:flex;align-items:center;justify-content:center}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar-placeholder{font-size:12px;color:#6b7280}
.avatar-sm{width:50px;height:50px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:inline-flex;align-items:center;justify-content:center}
.avatar-sm img{width:100%;height:100%;object-fit:cover;display:block}
.quick-nav{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:17.5px}
.chip{display:flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid var(--border);border-radius:999px;background:#f3f4f6;color:var(--text)}
.chip svg{color:#0f172a}
.w-100{width:100%}
.btn-danger{background:#e24a3c;color:#fff;border-color:#e24a3c}
.btn-danger:hover{filter:brightness(0.95)}
+/* Settings (Conta) */
+.settings-avatar-row{align-items:flex-start}

/* Section padding (≥851px): desktop e tablet */
.section{padding:25px}

/* Section padding (≤850px): mobile */
@media (max-width: 850px){
  .section{padding:25px 25px 100px 25px}
}
/* Footer oculto e bottom-nav visível até 850px */
@media (max-width: 850px){
  .footer{display:none !important}
}
/* Força o bottom-nav (que usa .show-until-699) a aparecer de 700px a 850px */
@media (min-width: 700px) and (max-width: 850px){
  .bottom-nav.show-until-699{display:block !important}
}

/* Centralizar card nas páginas Entrar e Cadastrar */
body[data-view="entrar"] main.container.section,
body[data-view="cadastrar"] main.container.section{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  min-height:100dvh;
  padding:25px !important;
}

body[data-view="entrar"] .header,
body[data-view="cadastrar"] .header,
body[data-view="entrar"] .footer,
body[data-view="cadastrar"] .footer,
body[data-view="entrar"] .bottom-nav,
body[data-view="cadastrar"] .bottom-nav{display:none !important}
/* Links nas páginas de autenticação */
body[data-view="entrar"] .auth-card .help a,
body[data-view="cadastrar"] .auth-card .help a{
  color: #0ea5e9;
  font-weight: 600;
}
/* Margem extra nos parágrafos de ajuda (links) nas páginas de autenticação */
body[data-view="entrar"] .auth-card p.help.center,
body[data-view="cadastrar"] .auth-card p.help.center{
  margin-top: 12.5px;
}
body[data-view="entrar"] .header,
body[data-view="cadastrar"] .header,
body[data-view="entrar"] .footer,
body[data-view="cadastrar"] .footer,
body[data-view="entrar"] .bottom-nav,
body[data-view="cadastrar"] .bottom-nav{display:none !important}
/* Remover sombra do card nas páginas de autenticação */
body[data-view="entrar"] .auth-card,
body[data-view="cadastrar"] .auth-card{
  box-shadow: none;
  margin: 25px 0;
}
/* Branding no topo dos cards de autenticação */
.auth-card .auth-brand{ display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:8px; }
.auth-card .auth-brand .auth-logo{ height:34px; width:auto; border-radius:4px; }
.auth-card .auth-brand .auth-brand-text{ line-height:1.15; }
.auth-card .auth-brand .brand-title{ font-weight:700; color:#0f172a; }
.auth-card .auth-brand .brand-subtitle{ font-size:12.5px; color:#6b7280; }
@media (max-width: 500px){
  .auth-card .auth-brand .auth-logo{ height:30px; width:auto; }
}

/* Branding acima do card nas páginas de autenticação */
.auth-wrap{ display:flex; flex-direction:column; align-items:center; }
.auth-brand{ display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:12px; }
.auth-brand .auth-logo{ height:34px; width:auto; border-radius:4px; }
.auth-brand .auth-brand-text{ line-height:1.15; }
.auth-brand .brand-title{ font-weight:700; color:#0f172a; }
.auth-brand .brand-subtitle{ font-size:12.5px; color:#6b7280; }
@media (max-width: 500px){
  .auth-brand .auth-logo{ height:30px; width:auto; }
}
/* Créditos abaixo do branding nas páginas de autenticação */
 .auth-brand-meta{ text-align:center; color:#6b7280; font-size:12.5px; margin-bottom:12px; }
@media (max-width: 500px){
  .stack-mobile-500{flex-direction:column !important}
  .stack-mobile-500 .btn{width:100%}
  .row.stack-variable{flex-direction:column !important}
  .row.stack-variable .btn{width:100%}
}
@media (max-width: 999px){
  .stack-variable{flex-direction:column !important}
  .stack-variable .btn{width:100%}
}
@media (max-width: 767px){
  .stack-variable{flex-direction:row !important}
  .stack-variable .btn{width:auto}
}
@media (max-width: 850px){
  .header{display:none !important}
}
.header-cta .btn{height:60px;padding:0 16px;align-items:center}
/* Espaçamento vertical adicional e simétrico no header */
.header-inner{padding-top:14px;padding-bottom:14px}
/* Empilhar conteúdo até 699px: protocolo/created + status */
.stack-until-699{display:flex;align-items:center;justify-content:space-between}
@media (max-width: 699px){
  .stack-until-699{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:.5rem}
}

/* Bottom nav para mobile (<=699px) */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--border);z-index:100}
.bottom-nav-inner{max-width:1100px;margin:0 auto;padding:8px 16px}
.bottom-nav-items{display:flex;align-items:center;justify-content:space-around}
.bottom-nav a{display:flex;flex-direction:column;align-items:center;color:#374151;gap:4px}
.bottom-nav a svg{width:24px;height:24px;color:#0f172a}
.bottom-nav a .text-xs{font-size:12px;color:#6b7280}
.avatar{width:96px;height:96px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:flex;align-items:center;justify-content:center}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar-placeholder{font-size:12px;color:#6b7280}
.avatar-sm{width:50px;height:50px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:inline-flex;align-items:center;justify-content:center}
.avatar-sm img{width:100%;height:100%;object-fit:cover;display:block}
.quick-nav{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:17.5px}
.chip{display:flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid var(--border);border-radius:999px;background:#f3f4f6;color:var(--text)}
.chip svg{color:#0f172a}
.w-100{width:100%}
.btn-danger{background:#e24a3c;color:#fff;border-color:#e24a3c}
.btn-danger:hover{filter:brightness(0.95)}
+/* Settings (Conta) */
+.settings-avatar-row{align-items:flex-start}

/* Section padding (≥851px): desktop e tablet */
.section{padding:25px}

/* Section padding (≤850px): mobile */
@media (max-width: 850px){
  .section{padding:25px 25px 100px 25px}
}
/* Footer oculto e bottom-nav visível até 850px */
@media (max-width: 850px){
  .footer{display:none !important}
}
/* Força o bottom-nav (que usa .show-until-699) a aparecer de 700px a 850px */
@media (min-width: 700px) and (max-width: 850px){
  .bottom-nav.show-until-699{display:block !important}
}

/* Centralizar card nas páginas Entrar e Cadastrar */
body[data-view="entrar"] main.container.section,
body[data-view="cadastrar"] main.container.section{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  min-height:100dvh;
  padding:25px !important;
}

body[data-view="entrar"] .header,
body[data-view="cadastrar"] .header,
body[data-view="entrar"] .footer,
body[data-view="cadastrar"] .footer,
body[data-view="entrar"] .bottom-nav,
body[data-view="cadastrar"] .bottom-nav{display:none !important}
/* Links nas páginas de autenticação */
body[data-view="entrar"] .auth-card .help a,
body[data-view="cadastrar"] .auth-card .help a{
  color: #0ea5e9;
  font-weight: 600;
}
body[data-view="entrar"] .header,
body[data-view="cadastrar"] .header,
body[data-view="entrar"] .footer,
body[data-view="cadastrar"] .footer,
body[data-view="entrar"] .bottom-nav,
body[data-view="cadastrar"] .bottom-nav{display:none !important}
/* Remover sombra do card nas páginas de autenticação */
body[data-view="entrar"] .auth-card,
body[data-view="cadastrar"] .auth-card{
  box-shadow: none;
}

/* Modal (pop-up de sucesso) */
.modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:100}
.modal.is-open{display:flex}
.modal-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.4)}
.modal-content{position:relative;width:calc(100% - 48px);max-width:480px;background:#fff;border:1px solid var(--border);border-radius:16px;padding:20px;box-shadow:var(--shadow)}
@media (max-width:500px){.modal-content{padding:18px;border-radius:14px}}
.modal-content .row{justify-content:space-between}
/* Botão fechar (X) no topo direito */
.modal-close{position:absolute;top:12px;right:12px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:8px;background:#fff;color:#0f172a;cursor:pointer}
.modal-close:hover{background:#f8fafc}
.modal-close:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 3px rgba(147,197,253,.35)}
.modal-close svg{width:18px;height:18px}
/* Botão Solicitar full-width em mobile (centralizado) */
@media (max-width: 700px){
  body[data-view="solicitar"] #form-solicitar button[type="submit"]{width:100%;justify-content:center}
}
/* Botão Consultar full-width em mobile (centralizado) */
@media (max-width: 700px){
  body[data-view="consultar"] #form-consultar button[type="submit"]{width:100%;justify-content:center}
  body[data-view="consultar"] .card .row{flex-direction:column;align-items:flex-start;justify-content:flex-start !important}
}
/* Botão Entrar full-width em mobile (centralizado) */
@media (max-width: 700px){
  body[data-view="entrar"] #form-login button[type="submit"]{width:100%;justify-content:center}
}
/* Botão Cadastrar full-width em mobile (centralizado) */
@media (max-width: 700px){
  body[data-view="cadastrar"] #form-register button[type="submit"]{width:100%;justify-content:center}
}
/* Botão Enviar (Ajuda) full-width em mobile (centralizado) */
@media (max-width: 700px){
  body[data-view="ajuda"] #form-ajuda button[type="submit"]{width:100%;justify-content:center}
}
/* Avatar muito pequeno para bottom-nav */
.bottom-nav a .avatar-xxs{width:35px;height:35px;border-radius:999px;border:1px solid var(--border);background:#f3f4f6;overflow:hidden;display:inline-flex;align-items:center;justify-content:center}
.bottom-nav a .avatar-xxs img{width:100%;height:100%;object-fit:cover;display:block}
/* Override para não herdar o tamanho 20px do seletor genérico de svg do bottom-nav */
.bottom-nav a .avatar-xxs svg{width:20px;height:20px;color:#94a3b8}
.header-cta .avatar-sm svg{width:24px;height:24px;color:#94a3b8}
#account-section .field-row{display:flex;align-items:center;gap:8px}
#account-section .field-row .field-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width: 700px){
  body[data-view="conta"] #account-section #btn-sair{width:100%;justify-content:center}
}
@media (max-width: 700px){
  body[data-view="conta"] .quick-nav{flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:visible}
  body[data-view="conta"] .quick-nav .chip{width:100%;flex:0 0 100%}
}

/* Page transitions: animate only main content */
main.section{position:relative;z-index:0;transition:transform .22s ease, opacity .22s ease;will-change:transform,opacity}
.view-enter{opacity:0;transform:translateY(16px)}
.view-enter.view-enter-active{opacity:1;transform:translateY(0)}
.view-leave-up{opacity:0;transform:translateY(-16px)}