/* =========================================================
   Telas de acesso — Catálogo Só Pássaros (Admin + Vendedor)
   Tudo dentro de .cq é medido em "cqw" (% da largura do cartão),
   então o conjunto cresce/diminui junto, mantendo a proporção.
   O cartão em si acompanha a tela com clamp(): nunca fica
   minúsculo no monitor grande nem estoura no celular.
   ========================================================= */
:root {
  --laranja: #ff6a00;
  --laranja-borda: #f07d1a;
  --laranja-escuro: #e85d00;
  --texto: #262626;
  --suave: #737373;
  --campo: #f2f2f2;
  --fundo: #cccccc;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fundo);
  font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--texto);
  display: flex;
}

/* ---------- Coluna central (proporcional à tela) ---------- */
.wrap {
  margin: auto;
  width: 100%;
  /* celular: ocupa a largura toda · notebook: ~30% da tela · monitor grande: até 540px */
  max-width: clamp(380px, 30vw, 540px);
  padding: clamp(18px, 5vh, 56px) max(16px, env(safe-area-inset-right)) clamp(18px, 5vh, 56px) max(16px, env(safe-area-inset-left));
}
/* telas largas porém baixas (notebook 1366×768, janela pela metade…) */
@media (min-width: 900px) and (max-height: 820px) {
  .wrap { max-width: clamp(380px, 56vh, 480px); }
}
/* celulares bem estreitos (iPhone SE, Galaxy A0x): respira menos */
@media (max-width: 360px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
}

.cq { container-type: inline-size; }

/* ---------- Topo: logo + pílula ---------- */
header.top { position: relative; }
header.top img { position: relative; z-index: 1; display: block; width: 47.4cqw; height: auto; }
.pill {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; gap: 1.8cqw;
  height: 10.5cqw; width: 61.3cqw; padding: 0 2.5cqw 0 11cqw;
  border: 1px solid var(--laranja-borda); border-radius: 999px;
  background: var(--laranja); color: #fff;
  font: 700 max(3.3cqw, 11px) Montserrat, sans-serif; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.pill svg { width: max(3.5cqw, 12px); height: max(3.5cqw, 12px); opacity: .85; flex: none; }

/* ---------- Cartão ---------- */
.cartao {
  margin-top: 6cqw; background: #fff; border-radius: 7.3cqw;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  padding: 8cqw 7cqw 7cqw;
}
.cartao + .cartao { margin-top: 4cqw; }
h1 { margin: 0; font-size: max(5.4cqw, 19px); font-weight: 800; letter-spacing: -.01em; line-height: 1.2; text-wrap: balance; }
h2 { margin: 0; font-size: max(4.4cqw, 16px); font-weight: 800; }
.sub { margin: 1.6cqw 0 0; font-size: max(3.3cqw, 12.5px); color: var(--suave); line-height: 1.45; }

form { margin-top: 5.5cqw; display: grid; gap: 3.4cqw; }
label { display: block; font-size: max(3cqw, 12px); font-weight: 600; margin: 0 0 1.4cqw 4cqw; }
.campo { position: relative; }
.campo svg.ic {
  position: absolute; left: 14px; top: 50%; width: 19px; height: 19px;
  transform: translateY(-50%); color: #a3a3a3; pointer-events: none;
}
input[type="email"], input[type="password"], input[type="text"], input[type="tel"] {
  display: block; width: 100%; height: 10.5cqw; min-height: 44px;
  border: 1.5px solid transparent; border-radius: 999px; background: var(--campo);
  padding: 0 16px 0 44px;
  font: 500 max(3.3cqw, 16px) Montserrat, sans-serif; /* 16px evita o zoom do iPhone */
  color: var(--texto);
  transition: border-color .15s, background .15s;
}
input::placeholder { color: #b5b5b5; font-weight: 500; }
input:hover { background: #ececec; }
input:focus { outline: none; border-color: var(--laranja); background: #fff; box-shadow: 0 0 0 4px rgba(255, 106, 0, .14); }
input[aria-invalid="true"] { border-color: #d92d20; background: #fff; }
input.com-olho { padding-right: 48px; }
.olho {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: none;
  color: #8a8a8a; cursor: pointer; display: grid; place-items: center;
}
.olho:hover { background: #e4e4e4; color: var(--texto); }
.olho:focus-visible { outline: 2px solid #171717; }
.olho svg { width: 19px; height: 19px; }
.olho[aria-pressed="true"] { color: var(--laranja); }

.dica { margin: 1.2cqw 0 0 4cqw; font-size: max(2.7cqw, 11.5px); color: var(--suave); }
.linha-senha { display: flex; justify-content: flex-end; margin-top: -1cqw; }
.link {
  font-size: max(3cqw, 12.5px); font-weight: 600; color: var(--laranja-escuro);
  text-decoration: none; background: none; border: 0; padding: 4px 0; cursor: pointer; font-family: inherit;
}
.link:hover { text-decoration: underline; }

/* ---------- Avisos ---------- */
.aviso {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 5cqw;
  padding: 12px 14px; border-radius: 16px;
  font-size: max(3.1cqw, 13px); font-weight: 600; line-height: 1.4;
}
.aviso.erro { background: #fdecea; color: #b42318; }
.aviso.ok { background: #e7f6ec; color: #146c2e; }
.aviso svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Botão principal ---------- */
button.entrar {
  margin-top: 1.5cqw; height: 10.5cqw; min-height: 46px; width: 100%;
  border: 1px solid var(--laranja-borda); border-radius: 999px;
  background: var(--laranja); color: #fff;
  font: 700 max(3.6cqw, 15px) Montserrat, sans-serif; cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 106, 0, .35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .15s, box-shadow .15s;
}
button.entrar:hover { background: var(--laranja-escuro); box-shadow: 0 6px 16px rgba(255, 106, 0, .35); }
button.entrar:active { transform: scale(.98); }
button.entrar:focus-visible { outline: 2px solid #171717; outline-offset: 2px; }
button.entrar[disabled] { opacity: .7; cursor: progress; }
button.entrar .gira {
  display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; border-radius: 50%; animation: g .7s linear infinite;
}
button.entrar[disabled] .gira { display: block; }
@keyframes g { to { transform: rotate(360deg); } }

/* ---------- Abas "Já tenho conta / Criar minha conta" ---------- */
.abas {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1cqw;
  padding: 1cqw; margin-bottom: 6cqw;
  background: var(--campo); border-radius: 999px;
}
.abas a {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 40px; height: 9cqw; padding: 0 2cqw; border-radius: 999px;
  font-size: max(3.1cqw, 12.5px); font-weight: 700; color: var(--suave); text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s;
}
.abas a:hover { color: var(--texto); }
.abas a[aria-selected="true"] { background: #fff; color: var(--laranja-escuro); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.abas a:focus-visible { outline: 2px solid #171717; outline-offset: 1px; }
[role="tabpanel"][hidden] { display: none; }
.troca { margin: 4.5cqw 0 0; text-align: center; font-size: max(3cqw, 12.5px); color: var(--suave); }

/* ---------- Rodapé ---------- */
.voltar {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin-top: 5cqw; font-size: max(3.1cqw, 13px); font-weight: 600;
  color: #525252; text-decoration: none;
}
.voltar:hover { color: var(--texto); text-decoration: underline; }
.voltar svg { width: 16px; height: 16px; }

/* ---------- Painel largo (lista de vendedores) ---------- */
.wrap.largo { max-width: min(1000px, 100%); }
.largo header.top { width: min(100%, 440px); container-type: inline-size; } /* topo com o mesmo tamanho das outras telas */
.largo .cartao { border-radius: 28px; padding: clamp(20px, 4cqw, 36px); margin-top: 24px; }
.largo h1 { font-size: clamp(19px, 2.6cqw, 26px); }
.largo .sub, .largo .dica, .largo label { font-size: 13.5px; }
.largo input[type="text"] { height: 46px; font-size: 16px; }
.largo button.entrar { height: 46px; font-size: 15px; width: auto; padding: 0 24px; margin: 0; }
.largo .aviso { margin-top: 16px; font-size: 13.5px; }
.largo .voltar { margin-top: 24px; font-size: 14px; }
.gerar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; }
.gerar > div { flex: 1 1 220px; }
.tabela-rola { overflow-x: auto; margin-top: 16px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee; white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); }
.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.etiqueta.livre { background: #e7f6ec; color: #146c2e; }
.etiqueta.usado { background: #f2f2f2; color: #525252; }
.etiqueta.off { background: #fdecea; color: #b42318; }
.mini { border: 1px solid #ddd; background: #fff; border-radius: 999px; padding: 6px 12px; font: 600 12.5px Montserrat, sans-serif; cursor: pointer; }
.mini:hover { border-color: var(--laranja); color: var(--laranja-escuro); }
.acoes-topo { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
form .aviso-js { margin-top: 0; }
[hidden] { display: none !important; }
.largo label { margin-left: 16px; margin-bottom: 6px; }
/* compatibilidade com o aviso de erro do admin/login.php atual (<div class="erro">) */
.cartao > .erro {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 5cqw;
  padding: 12px 14px; border-radius: 16px; background: #fdecea; color: #b42318;
  font-size: max(3.1cqw, 13px); font-weight: 600; line-height: 1.4;
}
.cartao > .erro svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
