/* Estilos compartilhados por todas as páginas. */

:root {
  --bg: #f5f3ef;
  --card: #ffffff;
  --ink: #1a1714;
  --ink-2: #3b3530;
  --muted: #6f675f;
  --line: #e6e1d8;
  --line-2: #d6cfc3;
  --gold: #c89b3c;
  --gold-ink: #7d5a12;
  --gold-soft: #faf3e3;
  --ok: #1f7a4d;
  --ok-soft: #e6f4ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(26, 23, 20, .05), 0 6px 20px rgba(26, 23, 20, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primario { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primario:hover { background: #000; border-color: #000; }
.btn-ouro { background: var(--gold); border-color: var(--gold); color: #1a1714; }
.btn-ouro:hover { background: #b8892c; border-color: #b8892c; }
.btn-perigo { color: var(--danger); border-color: #f0c7c2; }
.btn-perigo:hover { border-color: var(--danger); }
.btn-whats { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn-whats:hover { background: #197a42; border-color: #197a42; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-bloco { width: 100%; }
.btn-link {
  background: none; border: 0; padding: 6px 2px; color: var(--gold-ink);
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Formulários ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo > span, .rotulo { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.campo small, .dica { font-size: 13px; color: var(--muted); }
.input, .campo input:not([type=checkbox]):not([type=radio]), .campo select, .campo textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; font-size: 16px;
}
.campo textarea { min-height: 88px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .input:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(200, 155, 60, .25);
}
.linha-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.linha-campos .campo { min-width: 0; }
.campo-prefixo { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.campo-prefixo span { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.campo-prefixo input { border: 0 !important; box-shadow: none !important; padding-left: 2px !important; min-width: 0; }
.campo-prefixo:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(200, 155, 60, .25); }
.campo-senha { position: relative; }
.campo-senha input { padding-right: 52px !important; }
.campo-senha button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 40px; border: 0; background: none; color: var(--muted);
}
.check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.erro { color: var(--danger); font-size: 14px; min-height: 0; }
.erro:not(:empty) { margin: 4px 0 12px; }

/* ---------- Cartões ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card h2 { font-size: 18px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--gold-soft); color: var(--gold-ink); font-weight: 700; font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em; background: #efebe4; color: var(--ink-2); white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-perigo { background: var(--danger-soft); color: var(--danger); }
.badge-aviso { background: var(--warn-soft); color: var(--warn); }
.badge-ouro { background: var(--gold-soft); color: var(--gold-ink); }

.aviso { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.aviso-perigo { background: var(--danger-soft); color: var(--danger); }
.vazio { text-align: center; color: var(--muted); padding: 36px 16px; }
.vazio strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 17px; }

/* ---------- Carregando ---------- */
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--ink);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
.tela-centro { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }

/* ---------- Modal ---------- */
dialog.modal {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 18px; background: var(--card); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: auto;
}
dialog.modal::backdrop { background: rgba(26, 23, 20, .5); }
.modal-corpo { padding: 22px 20px 20px; }
.modal-corpo h2 { font-size: 20px; margin-bottom: 16px; padding-right: 36px; }
.modal-corpo h2 + .sub { color: var(--muted); font-size: 14px; margin: -8px 0 16px; }
.modal-fechar {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; color: var(--muted);
}
.modal-fechar:hover { background: var(--bg); }
.modal-botoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.modal-botoes .esquerda { margin-right: auto; }
@media (max-width: 560px) {
  dialog.modal { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .modal-botoes .btn:not(.esquerda) { flex: 1; }
}

/* ---------- Avisos rápidos (toast) ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: 84px; z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 440px; padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 15px; box-shadow: var(--shadow);
  animation: subir .2s ease-out;
}
.toast-erro { background: var(--danger); }
@keyframes subir { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Tela de configuração pendente ---------- */
.config-pendente { max-width: 520px; margin: 40px auto; padding: 24px; }
.config-pendente code { background: #efebe4; padding: 2px 6px; border-radius: 6px; font-size: 14px; }
.confirmacao-app{width:min(440px,calc(100% - 28px));max-width:440px;border:1px solid var(--line);border-radius:20px;padding:0;box-shadow:0 28px 80px #1116;background:var(--card);color:var(--ink)}
.confirmacao-app::backdrop{background:#1119;backdrop-filter:blur(3px)}
.confirmacao-app .modal-corpo{padding:28px}
.confirmacao-app h2{font-size:22px;margin:0 0 10px;padding:0}
.confirmacao-texto{color:var(--ink-2);line-height:1.55;white-space:pre-line;margin:0 0 24px}
.confirmacao-icone{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--gold-soft);color:var(--gold-ink);font-weight:800;font-size:22px;margin-bottom:16px}
.confirmacao-icone.confirmacao-perigo{background:var(--danger-soft);color:var(--danger)}
.confirmacao-botoes{margin-top:0}
.confirmacao-botoes .btn{min-width:110px}
@media(max-width:560px){.confirmacao-app{margin:auto 14px;border-radius:20px}.confirmacao-app .modal-corpo{padding:24px}.confirmacao-botoes{display:grid;grid-template-columns:1fr 1fr}.confirmacao-botoes .btn{min-width:0}}
