/* SaferPet — identidade SaferSoftware (linho, cartão branco, serifa nos
   títulos, uma cor de acento só). Sem gradiente animado, sem emoji. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #6D538F;
  --primary-ink: color-mix(in srgb, var(--primary) 85%, #241E2B);
  --primary-soft: color-mix(in srgb, var(--primary) 8%, #ffffff);
  --primary-border: color-mix(in srgb, var(--primary) 30%, #ffffff);

  --bg-base: #F6F3EC;
  --bg-panel: #FFFFFF;
  --bg-inset: #FAF8F3;
  --border: #E7E1D4;
  --border-strong: #D8D1C1;

  --text-main: #26232B;
  --text-muted: #726E7A;
  --text-subtle: #9D9AA3;

  --success: #2F7D5C;
  --success-soft: #EAF3EE;
  --danger: #B4452F;
  --danger-soft: #F9EDE9;

  --shadow-card: 0 1px 2px rgba(38, 35, 43, 0.05), 0 10px 30px rgba(38, 35, 43, 0.06);
  --fonte-titulo: 'Fraunces', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, sans-serif; }

body {
  background: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--fonte-titulo); font-weight: 500; letter-spacing: -0.02em; }
a { color: var(--primary-ink); }
a:hover { color: var(--primary); }

.cartao {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 16px;
}

/* ─── Botões ─── */
.btn-primario {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: #fff; border: 1px solid var(--primary-ink);
  padding: 11px 24px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: background 0.2s ease; white-space: nowrap;
}
.btn-primario:hover { background: var(--primary-ink); }
.btn-primario:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-fantasma {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-muted);
  padding: 10px 20px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.btn-fantasma:hover { color: var(--text-main); border-color: var(--border-strong); }
.btn-fantasma.perigo { color: var(--danger); }
.btn-fantasma.perigo:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-mini { padding: 7px 16px; font-size: 0.8rem; }

/* ─── Formulários ─── */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label {
  font-size: 0.74rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.campo input, .campo select, .campo textarea {
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-panel); color: var(--text-main); font-size: 0.92rem; outline: none;
  transition: border-color 0.2s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--primary); }
.campo input::placeholder, .campo textarea::placeholder { color: var(--text-subtle); }

.busca {
  width: 100%; max-width: 400px; padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text-main); font-size: 0.9rem; outline: none;
}
.busca:focus { border-color: var(--primary); }

/* ─── Chips ─── */
.chip {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
  border: 1px solid var(--border); background: var(--bg-inset); color: var(--text-muted);
  white-space: nowrap;
}
.chip.acento { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-border); }
.chip.ok { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.chip.alerta { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

/* ─── Barra de saldo ─── */
.barra {
  height: 8px; border-radius: 999px; background: var(--bg-inset);
  border: 1px solid var(--border); overflow: hidden;
}
.barra > div { height: 100%; background: var(--primary); }
.barra > div.baixa { background: var(--danger); }

/* ─── Topo do painel ─── */
.topo {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 32px; background: var(--bg-panel); border-bottom: 1px solid var(--border);
  gap: 16px; flex-wrap: wrap;
}
.marca { display: flex; align-items: center; gap: 12px; }
.marca-icone {
  width: 36px; height: 36px; border-radius: 12px; background: var(--primary-soft);
  border: 1px solid var(--primary-border); display: flex; align-items: center;
  justify-content: center; color: var(--primary-ink); flex-shrink: 0;
}
.marca-nome { font-family: var(--fonte-titulo); font-weight: 550; font-size: 1.25rem; }
.marca-empresa { font-size: 0.84rem; color: var(--text-muted); }

.abas {
  display: flex; gap: 4px; background: var(--bg-inset); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px; overflow-x: auto; max-width: 100%;
}
.aba {
  background: transparent; border: none; color: var(--text-muted); padding: 8px 18px;
  border-radius: 999px; font-size: 0.86rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all 0.2s ease; text-decoration: none;
}
.aba:hover { color: var(--text-main); }
.aba.ativa { background: var(--primary); color: #fff; }

/* ─── Conteúdo ─── */
.conteudo { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.cabecalho-pagina h2 { font-size: 2.1rem; line-height: 1.1; }
.cabecalho-pagina p { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }
.linha-cabecalho { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.kpi { padding: 20px 24px; display: flex; align-items: center; gap: 16px; }
.kpi-rotulo { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.3px; color: var(--text-muted); }
.kpi-valor { font-family: var(--fonte-titulo); font-size: 2.5rem; font-weight: 550; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-icone {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; border: 1px solid var(--border); background: var(--bg-inset);
  color: var(--primary-ink); flex-shrink: 0;
}

.lista { display: flex; flex-direction: column; gap: 10px; }
.linha {
  display: flex; align-items: center; gap: 16px; padding: 14px 20px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color 0.2s ease;
}
.linha:hover { border-color: var(--primary-border); }
.linha-inset { background: var(--bg-inset); }
.linha-titulo { font-size: 0.96rem; font-weight: 600; }
.linha-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.linha-data {
  font-family: var(--fonte-titulo); font-size: 1.1rem; font-weight: 550;
  color: var(--primary-ink); min-width: 60px; font-variant-numeric: tabular-nums;
}

.avatar {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; background: var(--bg-inset); border: 1px solid var(--border);
  font-family: var(--fonte-titulo); font-weight: 550; font-size: 1rem;
  color: var(--primary-ink); flex-shrink: 0;
}

.vazio {
  padding: 3rem; text-align: center; color: var(--text-muted);
  background: var(--bg-inset); border: 1px dashed var(--border-strong);
  border-radius: 12px; font-size: 0.95rem; line-height: 1.6;
}

.rotulo-secao {
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.4px; color: var(--text-muted);
}

/* ─── Modal ─── */
.modal-fundo {
  position: fixed; inset: 0; background: rgba(38, 35, 43, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-card); width: 100%; max-width: 460px; padding: 26px;
  display: flex; flex-direction: column; gap: 16px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-size: 1.35rem; }

/* ─── Aviso e toast ─── */
.faixa-aviso {
  background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger);
  border-radius: 12px; padding: 14px 20px; font-size: 0.9rem; font-weight: 600;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-main); color: var(--bg-base); padding: 12px 24px;
  border-radius: 999px; font-size: 0.88rem; font-weight: 600; z-index: 100;
  box-shadow: var(--shadow-card); max-width: 90vw; text-align: center;
}
.toast.erro { background: var(--danger); color: #fff; }

/* ─── Login ─── */
.pagina-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.cartao-login { width: 100%; max-width: 420px; padding: 34px; display: flex; flex-direction: column; gap: 18px; }

/* ─── Portal (celular) ─── */
.portal { max-width: 430px; margin: 0 auto; padding: 26px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.portal-saldo { font-family: var(--fonte-titulo); font-size: 3.4rem; font-weight: 550; letter-spacing: -0.02em; line-height: 1; }

/* ─── Agenda (grade do dia) ─── */
.agenda-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agenda-data {
  font-family: var(--fonte-titulo); font-size: 1.15rem; font-weight: 550;
  min-width: 210px; text-align: center;
}
.agenda-grade {
  display: grid; gap: 0; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden;
}
.agenda-cabecalho {
  padding: 10px 12px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border); text-align: center; background: var(--bg-inset);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agenda-horas { position: relative; border-left: none; }
.agenda-coluna { position: relative; border-left: 1px solid var(--border); }
.agenda-hora {
  position: absolute; right: 8px; transform: translateY(-50%);
  font-size: 0.72rem; color: var(--text-subtle); font-variant-numeric: tabular-nums;
}
.agenda-linha-hora { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); opacity: 0.6; }
.agenda-fora { position: absolute; left: 0; right: 0; background: var(--bg-inset); opacity: 0.7; }
.agenda-bloco {
  position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 3px 8px;
  font-size: 0.74rem; font-weight: 600; cursor: pointer; overflow: hidden;
  border: 1px solid var(--primary-ink); background: var(--primary); color: #fff;
  line-height: 1.25;
}
.agenda-bloco small { display: block; font-weight: 500; opacity: 0.85; font-size: 0.68rem; }
.agenda-bloco.rota { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-border); }
.agenda-bloco.concluido { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.agenda-bloco.faltou { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

.pilulas-horario { display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow-y: auto; }
.pilula-horario {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-panel); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  font-variant-numeric: tabular-nums; color: var(--text-main);
}
.pilula-horario:hover { border-color: var(--primary); }
.pilula-horario.escolhida { background: var(--primary); color: #fff; border-color: var(--primary-ink); }

/* Barrinha de crédito por serviço */
.credito-linha { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.credito-nome { flex: 1; font-weight: 600; }
.credito-numeros { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 720px) {
  .topo { padding: 12px 16px; }
  .conteudo { padding: 20px 14px 48px; }
  .linha { flex-wrap: wrap; }
  .agenda-data { min-width: 150px; font-size: 1rem; }
}

/* ─── Vitrine pública do petshop (/apelido) ─── */
.vitrine { max-width: 760px; margin: 0 auto; padding: 0 20px 56px; display: flex; flex-direction: column; gap: 22px; }

.vitrine-capa {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 44px 20px 8px;
}
.vitrine-logo {
  width: 92px; height: 92px; border-radius: 26px; object-fit: cover;
  border: 1px solid var(--border); background: var(--bg-panel); box-shadow: var(--shadow-card);
}
.vitrine-logo-vazia {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-ink);
  font-family: var(--fonte-titulo); font-size: 2.4rem; font-weight: 550;
}
.vitrine-capa h1 { font-size: 2.3rem; line-height: 1.1; }
.vitrine-capa p { color: var(--text-muted); font-size: 0.95rem; max-width: 46ch; }
.vitrine-acoes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.vitrine-secao { display: flex; flex-direction: column; gap: 12px; }
.vitrine-secao > h2 { font-size: 1.5rem; }
.vitrine-secao > .rotulo-secao + h2 { margin-top: -6px; }

.vitrine-preco {
  font-family: var(--fonte-titulo); font-size: 1.15rem; font-weight: 550;
  color: var(--primary-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}

.vitrine-pacote { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.vitrine-pacote-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.vitrine-pacote-topo h3 { font-size: 1.15rem; }
.vitrine-itens { display: flex; flex-wrap: wrap; gap: 6px; }

.vitrine-produtos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.vitrine-produto { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vitrine-produto img, .vitrine-produto .sem-foto {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  background: var(--bg-inset); border: 1px solid var(--border);
}
.vitrine-produto .sem-foto { display: flex; align-items: center; justify-content: center; color: var(--text-subtle); }
.vitrine-produto-nome { font-size: 0.9rem; font-weight: 600; line-height: 1.3; }

.vitrine-rodape {
  text-align: center; color: var(--text-subtle); font-size: 0.8rem;
  padding-top: 18px; border-top: 1px solid var(--border);
}
.vitrine-rodape a { color: var(--text-muted); text-decoration: none; }

.aviso-suave {
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  color: var(--primary-ink); border-radius: 12px; padding: 14px 18px;
  font-size: 0.9rem; line-height: 1.55;
}

.erro-campo { color: var(--danger); font-size: 0.84rem; font-weight: 600; }
.link-texto {
  background: none; border: none; color: var(--primary-ink); font-size: 0.86rem;
  font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0;
}

@media (max-width: 520px) {
  .vitrine-capa { padding-top: 30px; }
  .vitrine-capa h1 { font-size: 1.9rem; }
  .vitrine-produtos { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* ─── Dica de campo (o "?" ao lado do rótulo) ─── */
.dica {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--bg-inset);
  color: var(--text-muted); font-size: 0.68rem; font-weight: 700;
  cursor: help; padding: 0; line-height: 1; vertical-align: middle;
}
.dica:hover, .dica:focus-visible { border-color: var(--primary); color: var(--primary-ink); }
.dica:focus-visible { outline: 2px solid var(--primary-border); outline-offset: 1px; }

.dica-balao {
  position: fixed; z-index: 200; max-width: 300px;
  background: var(--text-main); color: var(--bg-base);
  border-radius: 10px; padding: 10px 14px;
  font-size: 0.82rem; font-weight: 500; line-height: 1.55;
  box-shadow: var(--shadow-card); pointer-events: none;
}

/* Rótulo com dica ao lado */
.campo label { display: flex; align-items: center; gap: 6px; }

/* ─── Boas-vindas (primeiro acesso) ─── */
.boasvindas-passos { display: flex; flex-direction: column; gap: 10px; }
.boasvindas-passo { display: flex; align-items: baseline; gap: 12px; font-size: 0.92rem; }
.boasvindas-numero {
  font-family: var(--fonte-titulo); font-weight: 550; font-size: 1.05rem;
  color: var(--primary-ink); min-width: 20px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.boasvindas-passo small { display: block; color: var(--text-muted); font-size: 0.82rem; margin-top: 1px; }

/* ─── Ajuda ─── */
.ajuda-topico { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-panel); }
.ajuda-topico summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--fonte-titulo); font-weight: 550; font-size: 1.08rem;
}
.ajuda-topico summary::-webkit-details-marker { display: none; }
.ajuda-topico summary::after {
  content: ''; margin-left: auto; width: 8px; height: 8px; flex-shrink: 0;
  border-right: 2px solid var(--text-subtle); border-bottom: 2px solid var(--text-subtle);
  transform: rotate(45deg); transition: transform 0.2s ease;
}
.ajuda-topico[open] summary::after { transform: rotate(225deg); }
.ajuda-topico[open] summary { border-bottom: 1px solid var(--border); }
.ajuda-corpo { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.ajuda-corpo p, .ajuda-corpo li { font-size: 0.9rem; line-height: 1.65; color: var(--text-main); }
.ajuda-corpo p strong { font-weight: 650; }
.ajuda-corpo ol, .ajuda-corpo ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.ajuda-corpo .nota {
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; color: var(--primary-ink);
  line-height: 1.55;
}
.ajuda-pergunta { font-weight: 650; font-size: 0.92rem; margin-top: 4px; }
.ajuda-sem-resultado { display: none; }
