/* ============================================================
   Gestante Premiada — Estilos
   Paleta: rosa (#f9a8d4, #ec4899) + lilás (#c084fc, #a855f7)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rosa:      #ec4899;
  --rosa-leve: #fce7f3;
  --rosa-med:  #fbcfe8;
  --lilas:     #a855f7;
  --lilas-leve:#f5f3ff;
  --lilas-med: #e9d5ff;
  --cinza:     #6b7280;
  --cinza-leve:#f9fafb;
  --borda:     #e5e7eb;
  --texto:     #111827;
  --branco:    #ffffff;
  --vermelho:  #dc2626;
  --verde:     #16a34a;
  --raio:      14px;
  --sombra:    0 4px 20px rgba(0,0,0,.07);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #fdf2f8;
  color: var(--texto);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Tipografia ─────────────────────────────────────────────── */
h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem;    font-weight: 700; }
a  { color: var(--rosa);  text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout público ─────────────────────────────────────────── */
.gp-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header público ─────────────────────────────────────────── */
.gp-header {
  background: linear-gradient(135deg, #be185d 0%, #a855f7 100%);
  color: #fff;
  padding: 14px 0;
}
.gp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gp-brand {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gp-header-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gp-header-nav a {
  color: rgba(255,255,255,.85);
  font-size: .86rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.3);
  transition: background .15s;
}
.gp-header-nav a:hover {
  background: rgba(255,255,255,.15);
  text-decoration: none;
}

/* ── Botões ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--rosa);  color: #fff; }
.btn-lilas    { background: var(--lilas); color: #fff; }
.btn-outline  { background: #fff; color: var(--rosa); border: 2px solid var(--rosa); }
.btn-outline-lilas { background: #fff; color: var(--lilas); border: 2px solid var(--lilas); }
.btn-ghost    { background: transparent; color: var(--cinza); border: 1.5px solid var(--borda); }
.btn-danger   { background: var(--vermelho); color: #fff; }
.btn-success  { background: var(--verde); color: #fff; }
.btn-green    { background: #25d366; color: #fff; }
.btn-sm       { padding: 8px 16px; font-size: .82rem; }
.btn-lg       { padding: 16px 32px; font-size: 1rem; }
.btn-block    { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Cards ───────────────────────────────────────────────────── */
.gp-card {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 24px;
  border: 1px solid var(--borda);
}
.gp-card-header {
  border-bottom: 1px solid var(--borda);
  padding-bottom: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ── Formulários ─────────────────────────────────────────────── */
.gp-form-group { margin-bottom: 18px; }
.gp-label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 6px;
}
.gp-input, .gp-select, .gp-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--texto);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.gp-input:focus, .gp-select:focus, .gp-textarea:focus {
  outline: none;
  border-color: var(--rosa);
  box-shadow: 0 0 0 3px rgba(236,72,153,.12);
}
.gp-textarea { resize: vertical; min-height: 120px; }
.gp-input-hint { font-size: .78rem; color: var(--cinza); margin-top: 4px; }
.gp-input-error { border-color: var(--vermelho) !important; }
.gp-error-msg { font-size: .8rem; color: var(--vermelho); margin-top: 4px; }

/* ── Alertas ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-info    { background: var(--lilas-leve); color: #6b21a8; border: 1px solid var(--lilas-med); }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-valid     { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-won       { background: #fef9c3; color: #713f12; }
.badge-expired   { background: #f3f4f6; color: #374151; }
.badge-active    { background: #d1fae5; color: #065f46; }
.badge-draft     { background: #f3f4f6; color: #374151; }
.badge-finished  { background: #e0e7ff; color: #3730a3; }
.badge-drawn     { background: #fef9c3; color: #713f12; }

/* ── Tabelas ─────────────────────────────────────────────────── */
.gp-table-wrap { overflow-x: auto; }
.gp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
}
.gp-table th {
  background: var(--cinza-leve);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--cinza);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.gp-table td {
  padding: 12px;
  border-bottom: 1px solid var(--borda);
  vertical-align: middle;
}
.gp-table tr:hover td { background: var(--rosa-leve); }

/* ── Página de auth (login/cadastro) ────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--rosa-leve) 0%, var(--lilas-leve) 100%);
}
.auth-box {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
  padding: 36px 32px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo h1 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #be185d, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-logo p {
  font-size: .85rem;
  color: var(--cinza);
  margin-top: 4px;
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: .85rem;
  color: var(--cinza);
}

/* ── Dashboard pública ──────────────────────────────────────── */
.gp-dashboard {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px;
}
.dash-greeting {
  background: linear-gradient(135deg, #be185d 0%, #a855f7 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-greeting h2 { font-size: 1.1rem; font-weight: 800; }
.dash-greeting p  { font-size: .85rem; opacity: .88; margin-top: 2px; }

.sorteio-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--borda);
}
.sorteio-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display:block; }
.sorteio-card-img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--rosa-med), var(--lilas-med));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.sorteio-card-body { padding: 20px; }
.sorteio-card-body h3 { font-size: 1.1rem; color: var(--rosa); margin-bottom: 6px; }

/* ── Cronômetro ──────────────────────────────────────────────── */
.countdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.countdown-unit {
  background: var(--rosa-leve);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  min-width: 72px;
}
.countdown-num  { font-size: 1.8rem; font-weight: 900; color: var(--rosa); display: block; }
.countdown-label { font-size: .7rem; color: var(--cinza); text-transform: uppercase; letter-spacing: .5px; }
.countdown-ended { font-size: 1.1rem; font-weight: 700; color: var(--vermelho); }

/* ── Bilhete card ────────────────────────────────────────────── */
.ticket-card {
  background: linear-gradient(135deg, #be185d 0%, #a855f7 100%);
  color: #fff;
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  max-width: 380px;
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(168,85,247,.3);
}
.ticket-card-logo  { font-size: 1rem; font-weight: 900; opacity: .9; margin-bottom: 6px; }
.ticket-card-raffle { font-size: .85rem; opacity: .8; margin-bottom: 16px; }
.ticket-card-number {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: rgba(255,255,255,.2);
  border-radius: 12px;
  padding: 14px 20px;
  margin: 12px 0;
}
.ticket-card-name  { font-size: .9rem; opacity: .85; margin-bottom: 4px; }
.ticket-card-date  { font-size: .78rem; opacity: .7; margin-bottom: 16px; }
.ticket-card-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
}

/* ── Bilhetes lista ──────────────────────────────────────────── */
.ticket-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--borda);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.ticket-row-num { font-weight: 800; color: var(--rosa); font-size: .9rem; white-space: nowrap; }
.ticket-row-info { flex: 1; min-width: 0; }
.ticket-row-raffle { font-size: .82rem; color: var(--cinza); }
.ticket-row-date   { font-size: .78rem; color: var(--cinza); }

/* ── Página pública do sorteio ──────────────────────────────── */
.sorteio-hero {
  background: linear-gradient(135deg, #be185d 0%, #a855f7 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.sorteio-hero img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 4px solid rgba(255,255,255,.3);
}
.sorteio-hero h1 { font-size: clamp(1.4rem,3vw,2rem); margin-bottom: 8px; }
.sorteio-hero p  { opacity: .88; max-width: 540px; margin: 0 auto; }

.sorteio-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}
.sorteio-meta-item {
  background: rgba(255,255,255,.18);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: .82rem;
  text-align: center;
}
.sorteio-meta-item strong { display: block; font-size: .95rem; }

/* ── Admin layout ────────────────────────────────────────────── */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
}
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1e1b4b;
  color: #c4b5fd;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.admin-sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(196,181,253,.1);
}
.admin-sidebar-brand h2 {
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
}
.admin-sidebar-brand p { font-size: .72rem; opacity: .6; margin-top: 2px; }
.admin-nav { padding: 16px 0; flex: 1; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: .85rem;
  font-weight: 600;
  color: #c4b5fd;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.admin-nav-item:hover { background: rgba(196,181,253,.08); color: #fff; text-decoration: none; }
.admin-nav-item.active { color: #fff; border-left-color: #a855f7; background: rgba(168,85,247,.12); }
.admin-nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.admin-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--borda);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 800; }
.admin-main { padding: 28px; flex: 1; }

/* ── Stats cards (admin) ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid var(--borda);
  box-shadow: var(--sombra);
}
.stat-card-num  { font-size: 2rem; font-weight: 900; color: var(--rosa); }
.stat-card-label { font-size: .8rem; color: var(--cinza); margin-top: 2px; }

/* ── Paginação ───────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 20px;
  align-items: center;
}
.page-btn {
  padding: 7px 13px;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 600;
  border: 1.5px solid var(--borda);
  background: #fff;
  color: var(--texto);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.page-btn:hover, .page-btn.active { background: var(--rosa); color: #fff; border-color: var(--rosa); text-decoration: none; }

/* ── Filtros / Pesquisa ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: flex-end;
}
.filter-bar .gp-input, .filter-bar .gp-select { max-width: 200px; }

/* ── Utilitários ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--cinza); font-size: .85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 10px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--borda); margin: 20px 0; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; }
  .admin-main { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .auth-box { padding: 24px 20px; }
  .gp-header-nav a span { display: none; }
  .countdown { gap: 8px; }
  .countdown-unit { min-width: 60px; padding: 10px 12px; }
  .countdown-num { font-size: 1.4rem; }
  .ticket-card { padding: 24px 20px; }
  .sorteio-hero { padding: 32px 0; }
  .filter-bar .gp-input,
  .filter-bar .gp-select { max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .dash-greeting { flex-direction: column; text-align: center; }
}