/* ==========================================================================
   Pingo — Base & Componentes reutilizáveis
   ========================================================================== */
@import url('tokens.css');

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--pingo-navy);
  background: var(--pingo-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--pingo-navy);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-2); }

a { color: var(--pingo-blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.container--narrow { max-width: 620px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--pingo-navy); outline-offset: 2px; }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--pingo-orange);
  color: var(--pingo-white);
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { background: var(--pingo-orange-dark); }

.btn--secondary {
  background: var(--pingo-white);
  color: var(--pingo-blue-dark);
  border: 2px solid var(--pingo-blue);
}
.btn--secondary:hover { background: var(--pingo-mist); }

.btn--block { width: 100%; }

.btn--sm { padding: 0.55rem 1.1rem; font-size: var(--text-sm); }

.btn--danger { background: var(--pingo-danger); color: var(--pingo-white); }

/* ---------- Cards ---------- */
.card {
  background: var(--pingo-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge--ativo { background: #E4F6EC; color: var(--pingo-success); }
.badge--suspenso { background: #FCE9E6; color: var(--pingo-danger); }
.badge--pendente { background: #FFF3E0; color: var(--pingo-orange-dark); }

/* ---------- Formulários ---------- */
.field { margin-bottom: var(--space-2); }

.field label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 0.4rem;
  color: var(--pingo-navy);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 0.75rem 1rem;
  border: 2px solid #DCE7EE;
  border-radius: var(--radius-sm);
  background: var(--pingo-white);
  color: var(--pingo-navy);
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--pingo-blue);
}

.field small { display: block; margin-top: 0.35rem; color: #6B8299; font-size: var(--text-xs); }

.form-error {
  background: #FCE9E6;
  color: var(--pingo-danger);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.form-success {
  background: #E4F6EC;
  color: var(--pingo-success);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  font-weight: 600;
}

/* ---------- Header simples (páginas internas) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--pingo-navy);
}
.brand img { width: 40px; height: 40px; }

/* ---------- Navegação interna (admin) ---------- */
.admin-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem var(--space-2);
}

/* ---------- Janelas modais (dialog nativo) ---------- */
dialog {
  position: relative;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  width: 90%;
  max-width: 420px;
}
dialog::backdrop { background: rgba(15, 42, 67, 0.55); }
.modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--pingo-navy);
  padding: 0.2rem 0.5rem;
}
.qr-modal-img {
  display: block;
  margin: var(--space-2) auto;
  border: 1px solid #EDF2F6;
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--pingo-white);
}

/* ---------- Divisor "trilha de patinhas" — assinatura visual da marca ---------- */
.paw-divider {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  opacity: 0.35;
  margin: var(--space-4) 0;
  font-size: 1.1rem;
  color: var(--pingo-orange);
  user-select: none;
}

/* ---------- Utilidades ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: #6B8299; }
.section { padding: var(--space-5) 0; }
.section--mist { background: var(--pingo-mist); }
.section--sand { background: var(--pingo-sand); }

@media (max-width: 640px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.7rem; }
  .section { padding: var(--space-4) 0; }
}
