:root {
  --ink: #16213a;
  --ink-60: rgba(22, 33, 58, 0.6);
  --paper: #f3f1eb;
  --branco: #ffffff;
  --steel: #c9cdd3;
  --steel-escuro: #8c93a0;
  --steel-claro: #e7e8ea;
  --signal: #e8542e;
  --signal-escuro: #c23f1c;
  --mint: #2e9e6b;
  --mint-fundo: #eaf6f0;
  --borda: rgba(22, 33, 58, 0.12);
  --sombra: rgba(22, 33, 58, 0.1);

  --fonte-display: "Fraunces", "Iowan Old Style", serif;
  --fonte-corpo: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --fonte-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--fonte-corpo);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--fonte-corpo);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-weight: 700;
  font-size: 1.5rem;
}

h2,
h3 {
  font-weight: 600;
}

p {
  color: var(--ink-60);
}

a {
  color: var(--signal-escuro);
}

.pagina {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cabecalho com o logotipo, presente em todas as paginas */
.cabecalho {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem 1rem;
}

/* Carrinho/conta — só aparece nas paginas da loja (ver mostrar_cabecalho_loja) */
.cabecalho-loja-extra {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.link-conta-icone,
.link-carrinho {
  position: relative;
  font-size: 1.2rem;
  line-height: 1;
  text-decoration: none;
}

.badge-ativo {
  position: absolute;
  bottom: -2px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid var(--paper);
}

.badge-carrinho {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--signal);
  color: var(--branco);
  font-family: var(--fonte-mono);
  font-weight: 700;
  font-size: 0.62rem;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.logotipo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.logotipo img {
  height: 32px;
  width: auto;
}

.logotipo span {
  font-family: var(--fonte-mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.logotipo span em {
  font-style: normal;
  color: var(--signal);
}

.conteudo {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem 1rem 1rem;
}

/* Paginas largas (ex: loja) dispensam o cartao estreito e o padding do .conteudo —
   cada seccao define o proprio espacamento. */
.conteudo-larga {
  display: block;
  padding: 0;
  width: 100%;
}

.mensagens-flash {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
}

.cartao {
  width: 100%;
  max-width: 460px;
  min-width: 0;
  background: var(--branco);
  border-radius: 18px;
  border: 1px solid var(--borda);
  padding: 1.85rem 1.6rem;
  box-shadow: 0 1px 2px var(--sombra), 0 16px 32px -18px var(--sombra);
  overflow-wrap: break-word;
}

.rodape {
  text-align: center;
  padding: 1.5rem 1rem;
  font-family: var(--fonte-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--steel-escuro);
}

/* Chip da etiqueta: a peca-assinatura do site, repetida em cada pagina de uma etiqueta */
.chip-etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(155deg, #eef0f3 0%, #dadde2 55%, #c7ccd2 100%);
  border: 1px solid var(--borda);
  border-radius: 999px;
  padding: 0.35rem 0.95rem 0.35rem 0.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 6px 14px -8px var(--sombra);
  margin-bottom: 1.35rem;
}

.chip-etiqueta-argola {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--paper);
  flex-shrink: 0;
}

.chip-etiqueta-codigo {
  font-family: var(--fonte-mono);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.chip-etiqueta-rotulo {
  font-family: var(--fonte-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--steel-escuro);
  text-transform: uppercase;
}

/* Formularios */
.grupo-campo {
  border: none;
  padding: 0;
  margin: 0 0 1.75rem;
  min-width: 0;
}

.rotulo-grupo {
  display: block;
  width: 100%;
  font-family: var(--fonte-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--steel-escuro);
  padding: 0 0 0.55rem;
  margin: 0 0 0.9rem;
  border-bottom: 1px solid var(--borda);
}

.campo {
  margin-bottom: 1.1rem;
}

.campo:last-child {
  margin-bottom: 0;
}

.campo label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.campo .ajuda {
  display: block;
  font-size: 0.78rem;
  color: var(--steel-escuro);
  margin-top: 0.35rem;
  line-height: 1.45;
}

input[type="text"],
input[type="tel"],
input[type="url"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--borda);
  border-radius: 10px;
  font-family: var(--fonte-corpo);
  font-size: 1rem;
  background: var(--paper);
  color: var(--ink);
}

input[type="tel"] {
  font-family: var(--fonte-mono);
  font-size: 0.92rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--signal);
  outline-offset: 1px;
  border-color: var(--signal);
  background: var(--branco);
}

textarea {
  resize: vertical;
  min-height: 90px;
  font-family: var(--fonte-corpo);
}

/* Upload de foto */
input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px dashed var(--steel);
  border-radius: 10px;
  font-family: var(--fonte-corpo);
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--ink);
}

input[type="file"]::file-selector-button {
  font-family: var(--fonte-corpo);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--steel-claro);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  margin-right: 0.7rem;
  cursor: pointer;
}

.foto-atual {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  border: 1px solid var(--borda);
}

/* Multiplos telefones */
.telefones {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.linha-telefone {
  display: flex;
  gap: 0.4rem;
}

.select-indicativo {
  flex: 0 0 auto;
  max-width: 42%;
  padding: 0.7rem 0.4rem;
  border: 1px solid var(--borda);
  border-radius: 10px;
  font-family: var(--fonte-mono);
  font-size: 0.82rem;
  background: var(--paper);
  color: var(--ink);
}

.linha-telefone input[type="tel"] {
  flex: 1;
  min-width: 0;
}

.botao-remover-telefone {
  flex: 0 0 auto;
  width: 2.5rem;
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-60);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.botao-remover-telefone:hover:not(:disabled) {
  border-color: var(--signal);
  color: var(--signal-escuro);
}

.botao-remover-telefone:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Botoes */
.botao {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.9rem 1rem;
  border-radius: 11px;
  border: none;
  font-family: var(--fonte-corpo);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.botao:active {
  transform: scale(0.99);
}

.botao-principal {
  background: var(--signal);
  color: var(--branco);
}

.botao-principal:hover {
  background: var(--signal-escuro);
}

.botao-secundario {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--borda);
}

.botao-secundario:hover {
  background: var(--steel-claro);
}

.botao-pequeno {
  display: inline-block;
  width: auto;
  padding: 0.5rem 0.95rem;
  font-size: 0.84rem;
}

.botao + .botao {
  margin-top: 0.65rem;
}

/* Perfil do animal */
.foto-animal {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 1.35rem;
  background: var(--steel-claro);
  border: 1px solid var(--borda);
}

.nome-animal {
  text-align: center;
  font-family: var(--fonte-display);
  font-weight: 600;
  font-size: 2.1rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.aviso-localizacao {
  font-family: var(--fonte-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--steel-escuro);
  text-align: center;
  margin: 0 0 1.3rem;
  line-height: 1.5;
}

.contactos {
  margin: 1.5rem 0;
}

.grupo-contacto + .grupo-contacto {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--borda);
}

.caixa-destaque {
  background: var(--paper);
  border-left: 3px solid var(--signal);
  border-radius: 4px 14px 14px 4px;
  padding: 1.1rem 1.2rem;
  margin-top: 1.35rem;
}

.caixa-destaque h2 {
  font-size: 0.78rem;
  font-family: var(--fonte-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--signal-escuro);
  margin-bottom: 0.5em;
}

.caixa-destaque p {
  margin: 0;
  color: var(--ink);
  white-space: pre-line;
}

.aviso-token {
  background: var(--mint-fundo);
  border: 1px solid var(--mint);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.5rem;
}

.aviso-token strong {
  color: var(--mint);
}

.aviso-token p {
  color: var(--ink-60);
}

.aviso-token .link-edicao {
  display: block;
  word-break: break-all;
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.6rem;
  font-family: var(--fonte-mono);
  font-size: 0.8rem;
}

.estado-vazio {
  text-align: center;
  padding: 2rem 0;
}

.estado-vazio .icone {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.confirmacao {
  background: var(--mint-fundo);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--mint);
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.erro {
  background: #fdecea;
  border: 1px solid #f2a99b;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--signal-escuro);
  font-weight: 600;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
