/* Mesma paleta e fontes da página de links (site/index.html) */
:root {
  --bg: #16110d;
  --bg-glow: #2a1d13;
  --surface: #221a14;
  --surface-hover: #2c221a;
  --border: #3a2d22;
  --text: #f3e9dc;
  --muted: #b3a291;
  --accent: #e07a2e;
  --accent-hover: #ec8a3f;
  --ok: #6fbf73;
  --erro: #e5675b;
  --whats: #25d366;
}

* { box-sizing: border-box; margin: 0; }

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, var(--bg-glow), transparent 70%) no-repeat,
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

h1, .marca span:last-child {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.15;
}
h1 { font-size: 28px; margin: 8px 0 16px; }

.apagado { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- formulários ---------- */

label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 14px; font-weight: 500; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px evita o zoom automático do Safari no iPhone */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }

.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 400; cursor: pointer; }
.check-venda {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #1b120b;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.botao:hover { background: var(--accent-hover); }
.botao:disabled { opacity: .6; cursor: wait; }
.botao-sec { background: transparent; color: var(--text); border-color: var(--border); }
.botao-sec:hover { background: var(--surface-hover); border-color: var(--accent); }
.botao-whats { background: var(--whats); border-color: var(--whats); color: #062b13; }
.botao-whats:hover { background: #3be07a; }

.link-discreto { background: none; border: 0; padding: 8px; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.link-discreto:hover { color: var(--text); }
.perigo { color: var(--erro); }

.alerta { padding: 12px 14px; border-radius: 10px; margin: 12px 0; }
.alerta-erro { background: rgba(229, 103, 91, .12); border: 1px solid var(--erro); color: #ffb4ab; }
.alerta-ok {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(111, 191, 115, .1);
  border: 1px solid var(--ok);
}
.numero-grande { font-family: "Fraunces", Georgia, serif; font-size: 56px; line-height: 1.1; color: var(--accent); }
.numero { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */

.centralizado { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.caixa-login { width: 100%; max-width: 360px; text-align: center; }
.caixa-login form { text-align: left; margin-top: 24px; }
.caixa-login .botao { width: 100%; margin-top: 16px; }

.selo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--accent), 0 12px 32px rgba(0, 0, 0, .5);
}
.selo img { width: 80px; height: 80px; }

/* ---------- inventário ---------- */

.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(22, 17, 13, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.marca { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 20px; }
.selo-mini { display: flex; width: 36px; height: 36px; border-radius: 50%; background: var(--text); align-items: center; justify-content: center; }
.selo-mini img { width: 30px; height: 30px; }
.topo-acoes { display: flex; align-items: center; gap: 4px; }
.topo-acoes .botao { padding: 9px 14px; }

.pagina { max-width: 960px; margin: 0 auto; padding: 16px 16px 48px; }
.pagina-estreita { max-width: 520px; }

/* Formulário do disco: uma coluna no celular; no desktop, foto à esquerda e
   os campos em duas colunas à direita */
.pagina-form { max-width: 520px; }
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.opcional { font-weight: 400; opacity: .8; }
.campos { display: grid; grid-template-columns: 1fr; column-gap: 16px; }
.campo { min-width: 0; }
.campo-largo { grid-column: 1 / -1; }
.faixa-mercado {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0 0;
  padding: 4px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.faixa-mercado legend { padding: 0 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.faixa-mercado label { margin-top: 4px; font-size: 13px; }
.campos .check-venda { margin-top: 16px; }
@media (min-width: 860px) {
  .pagina-form { max-width: 1040px; }
  .form-grade { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: start; }
  .form-grade .campo-foto { position: sticky; top: 84px; }
  .form-grade .foto-alvo { width: 100%; margin: 14px 0 0; }
  .campos { grid-template-columns: 1fr 1fr; }
  .pagina-form .acoes { flex-direction: row; justify-content: flex-end; }
  .pagina-form .acoes .botao { min-width: 200px; }
}

.resumo { color: var(--muted); margin: 4px 0 12px; }
.resumo strong { color: var(--text); }

.filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.filtros input { grid-column: 1 / -1; }
.filtros .botao { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .filtros { grid-template-columns: 1fr 170px 170px auto; }
  .filtros input, .filtros .botao { grid-column: auto; }
}

.lista { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.item-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.item-texto { display: flex; flex-direction: column; min-width: 0; }
.item-texto > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-texto span:last-child { color: var(--muted); font-size: 14px; }
.item-texto .numero { font-size: 13px; }

.capa-mini { flex: none; width: 64px; height: 64px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.sem-foto {
  background:
    radial-gradient(circle, var(--accent) 0 9%, #111 10% 13%, #2a2018 14% 66%, transparent 67%),
    var(--bg);
}

.etiqueta {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.etiqueta-venda { color: var(--ok); border-color: var(--ok); background: rgba(111, 191, 115, .1); }
.etiqueta-fora { color: var(--muted); border-color: var(--border); }

.voltar { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; }

.campo-foto input[type="file"] { display: none; }
.foto-alvo {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  width: min(100%, 300px);
  margin: 0 auto;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  overflow: hidden;
}
.foto-alvo img { width: 100%; height: 100%; object-fit: cover; }
.campo-foto .check { margin-top: 8px; }

.acoes { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.acoes .botao { padding: 14px 18px; }
.excluir { margin-top: 32px; text-align: center; }

.paginacao { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; color: var(--muted); }

.vazio { text-align: center; padding: 48px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.vazio p:first-child { color: var(--text); }

/* ---------- catálogo ---------- */

.cabecalho-catalogo { max-width: 960px; margin: 0 auto; padding: 32px 16px 8px; text-align: center; }
.cabecalho-catalogo h1 { font-size: 32px; margin: 4px 0 6px; }
.busca { display: flex; gap: 8px; max-width: 520px; margin: 20px auto 0; }

.grade {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) { .grade { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 900px) { .grade { grid-template-columns: repeat(4, 1fr); } }

.cartao {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.capa { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: var(--bg); cursor: zoom-in; }
.capa img { width: 100%; height: 100%; object-fit: cover; display: block; }
div.capa { cursor: default; }
.cartao-texto { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 4px; min-width: 0; }
.cartao-texto > * { overflow-wrap: anywhere; }
.cartao-texto .apagado { font-size: 13px; }
.cartao .botao-whats { margin: 10px 12px 12px; padding: 10px 12px; font-size: 14px; }

.rodape { text-align: center; padding: 24px 16px 40px; color: var(--muted); font-size: 14px; }

.ampliada { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 92vh; margin: auto; }
.ampliada::backdrop { background: rgba(0, 0, 0, .85); }
.ampliada img { display: block; max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }
.ampliada form { position: absolute; top: 8px; right: 8px; }
.ampliada button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 24px; cursor: pointer; }

/* ---------- pesquisa automática ---------- */

.pesquisa { margin-top: 20px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pesquisa h2 { font-size: 15px; font-weight: 600; }
.pesquisa a { overflow-wrap: anywhere; }
.preco-estimado strong:last-child { color: var(--accent); }
.fontes { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.alerta-aviso { margin: 0; background: rgba(224, 122, 46, .12); border: 1px solid var(--accent); color: #f3c9a5; }
.selo-revisar { margin-left: 4px; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: #1b120b; font-size: 11px; font-weight: 600; }
