/* public/css/style.css */

/* ── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  background: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 450;
  letter-spacing: -0.01em;
}

/* ── Safe area (notch / Dynamic Island) — apenas páginas públicas ─ */
body:not(.admin-page) nav { padding-top: env(safe-area-inset-top); }

/* ── Nav menu button ───────────────────────────────────────────── */
.nav-menu-btn {
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-menu-btn:hover { background: rgba(255,255,255,0.12); }

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-link.active {
  background: #711DCD;
  color: #fff;
  border-left-color: transparent;
}
.sidebar-link.active svg { color: #fff; }

.sidebar-social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.sidebar-social-link:hover { opacity: 0.8; }

/* ── Form Fields ───────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  margin-bottom: 0.375rem;
}
.field-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  border-radius: 0.625rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
  -webkit-appearance: none;
}
.field-input:focus { border-color: #711DCD; box-shadow: 0 0 0 3px rgba(113,29,205,0.12); }
.field-input::placeholder { color: #4b5563; }
select.field-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  appearance: none;
}
input[type="date"].field-input,
input[type="datetime-local"].field-input { color-scheme: dark; }

/* ── Tip card ──────────────────────────────────────────────────── */
.tip-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tip-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ── Sidebar admin ─────────────────────────────────────────────── */
.sbt { color: #6b7280; }
.sbt:hover { background: rgba(255,255,255,0.04); color: #d1d5db; }

/* ── Skeleton ──────────────────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }


/* ── Nav ───────────────────────────────────────────────────────── */
.nav-link {
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.12); }
.nav-link.nav-active { color: #fff; background: rgba(255,255,255,0.2); font-weight: 700; }

/* ── Form Fields ───────────────────────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  margin-bottom: 0.375rem;
}

.field-input {
  width: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.625rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: #711DCD;
  box-shadow: 0 0 0 3px rgba(113,29,205,0.12);
}

.field-input::placeholder {
  color: #4b5563;
}

select.field-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  appearance: none;
}

input[type="date"].field-input,
input[type="datetime-local"].field-input {
  color-scheme: dark;
}

/* ── Tip card hover ────────────────────────────────────────────── */
.tip-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tip-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ── Sidebar admin tabs ────────────────────────────────────────── */
.sbt {
  color: #6b7280;
}
.sbt:hover {
  background: rgba(255,255,255,0.04);
  color: #d1d5db;
}

/* ── Animate pulse (skeleton) ──────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ── Banner promocional ───────────────────────────────────────── */
/* Mobile: altura fixa com recorte (cover) — fica perfeito. */
.promo-banner { height: 180px; }
.banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Desktop: a div acompanha a altura natural da imagem (sem cortar nem esticar). */
@media (min-width: 768px) {
  .promo-banner { height: auto; }
  .banner-img { height: auto; object-fit: contain; }
}

/* ícone discreto de admin no menu */
.sidebar-admin-icon:hover { color: rgba(255,255,255,0.6) !important; background: rgba(255,255,255,0.06); }

/* iOS: evita o zoom automático ao focar campos (só ocorre com fonte < 16px). Aplica só em telas de toque, sem alterar o desktop. */
@media (pointer: coarse) {
  body.admin-page input,
  body.admin-page select,
  body.admin-page textarea,
  .field-input { font-size: 16px; }
}

/* Botão instalar PWA (Android) — destaque com pulso */
.pwa-install-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #711DCD; color: #fff; border: none; border-radius: 12px;
  padding: 13px; font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit;
  animation: pwaPulse 1.8s ease-out infinite;
}
.pwa-install-btn:active { transform: scale(0.98); }
.pwa-install-btn:disabled { opacity: .6; animation: none; }
@keyframes pwaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(113,29,205,0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(113,29,205,0); }
  100% { box-shadow: 0 0 0 0 rgba(113,29,205,0); }
}
@media (prefers-reduced-motion: reduce) { .pwa-install-btn { animation: none; } }
