/* ═══════════════════════════════════════════════════════════
   RIFA DIGITAL — App Styles
   Mobile First • Bootstrap 5 override
═══════════════════════════════════════════════════════════ */

:root {
  --primary:      #D4636A;
  --primary-dark: #a93c44;
  --primary-light:#F4C3C6;
  --primary-xlt:  #FFF0F1;
  --bg-main:      #FEF0F0;
  --text-dark:    #2c1a1a;
  --radius:       12px;
  --shadow:       0 4px 20px rgba(212,99,106,.15);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
}

.fw-600 { font-weight: 600; }

/* ─── Background ────────────────────────────────────────── */
.bg-rifa {
  background: linear-gradient(160deg, #ffe4e6 0%, #fdeaea 40%, #fff5f5 100%);
  min-height: 100vh;
}

/* ─── Hero Section ──────────────────────────────────────── */
.rifa-hero {
  position: relative;
  background: linear-gradient(145deg, #f8c8cc 0%, #f0a0a8 40%, #e88090 100%);
  padding: 32px 0 28px;
  overflow: hidden;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 8px 32px rgba(212,99,106,.3);
}

/* Corações decorativos */
.hearts-deco {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.heart { position: absolute; font-size: 28px; opacity: .4; animation: float 3s ease-in-out infinite; }
.heart.h1 { top: 8px;  left: 10px;  animation-delay: 0s;    font-size: 36px; }
.heart.h2 { top: 20px; right: 12px; animation-delay: .8s;   font-size: 24px; }
.heart.h3 { bottom: 20px; left: 20%; animation-delay: 1.5s; font-size: 20px; }
.heart.h4 { bottom: 10px; right: 18%; animation-delay: .4s; font-size: 30px; }

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Título RIFA */
.rifa-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 10vw, 72px);
  color: #fff;
  line-height: 1;
  text-shadow: 3px 3px 0 rgba(0,0,0,.15);
  letter-spacing: 2px;
}
.rifa-subtitle-font {
  font-family: 'Pacifico', cursive;
  font-size: clamp(24px, 6vw, 42px);
  color: #fff;
  margin-top: -6px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.12);
  line-height: 1.2;
}
.rifa-desc {
  color: rgba(255,255,255,.92);
  font-size: 14px;
  margin-top: 10px;
  max-width: 340px;
  line-height: 1.5;
}

/* Imagem circular da rifa */
.rifa-hero-img {
  width: clamp(100px, 30vw, 160px);
  height: clamp(100px, 30vw, 160px);
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.8);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

/* Badge de preço */
.price-badge {
  display: inline-block;
  background: #fff;
  color: var(--primary);
  font-size: clamp(22px, 6vw, 36px);
  font-weight: 800;
  padding: 8px 24px;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  margin-top: 6px;
}
.price-badge span { font-size: 13px; font-weight: 500; opacity: .7; }

.draw-date {
  color: rgba(255,255,255,.9);
  font-size: 13px;
  margin-top: 6px;
}

/* Pills de prêmios no hero */
.prize-badge-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.prize-pill {
  display: inline-flex; flex-direction: column;
  background: rgba(255,255,255,.25); backdrop-filter: blur(4px);
  color: #fff; border-radius: 50px; padding: 5px 14px;
  font-size: 12px; font-weight: 600; border: 1px solid rgba(255,255,255,.5);
}
.prize-pill.locked { opacity: .7; }
.prize-pill small { font-weight: 400; opacity: .85; font-size: 10px; }

/* ─── Progresso ─────────────────────────────────────────── */
.progress-wrap { background: #fff; border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }

/* ─── Seção de Prêmios ───────────────────────────────────── */
.section-title { font-weight: 700; font-size: 16px; margin-bottom: 12px; }

.prize-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform .2s;
}
.prize-card:hover { transform: translateY(-3px); }
.prize-card.prize-locked { opacity: .75; filter: grayscale(.3); }

.prize-img  { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; margin-bottom: 10px; }
.prize-medal { font-size: 32px; }
.prize-pos   { font-size: 11px; color: #888; margin-bottom: 2px; }
.prize-title { font-weight: 700; font-size: 15px; }
.prize-desc  { font-size: 12px; color: #666; margin-top: 4px; }

.prize-lock-msg {
  background: rgba(0,0,0,.06);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  margin-top: 10px;
  color: #555;
}
.mini-progress { background:#ddd; height:4px; border-radius:4px; margin-top:6px; }
.mini-progress div { background: var(--primary); height:100%; border-radius:4px; }

/* ─── Legenda ────────────────────────────────────────────── */
.legend-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: #666; }
.legend-dot { display: inline-block; width: 16px; height: 16px; border-radius: 4px; }
.legend-dot.available { background: #FBDADA; border: 1px solid #E8A0A5; }
.legend-dot.reserved  { background: #DDD; border: 1px solid #CCC; }
.legend-dot.paid      { background: var(--primary); }
.legend-dot.selected  { background: #8B1A1A; }

/* ─── Grade de Números ───────────────────────────────────── */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
@media (max-width: 400px) {
  .numbers-grid { grid-template-columns: repeat(8, 1fr); gap: 3px; padding: 10px; }
}
@media (min-width: 768px) {
  .numbers-grid { grid-template-columns: repeat(10, 1fr); }
}

.number-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: clamp(9px, 2.5vw, 13px);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  background: #FBDADA;
  color: #c0504d;
  border: 1.5px solid #e8a0a5;
  line-height: 1;
}
.number-cell:hover:not(.reserved):not(.paid):not(.dummy) {
  transform: scale(1.12);
  box-shadow: 0 2px 8px rgba(212,99,106,.4);
}
.number-cell:active:not(.reserved):not(.paid):not(.dummy) {
  transform: scale(.95);
}
.number-cell.selected {
  background: #8B1A1A;
  color: #fff;
  border-color: #8B1A1A;
  box-shadow: 0 2px 10px rgba(139,26,26,.5);
  transform: scale(1.05);
}
.number-cell.reserved {
  background: #E5E5E5;
  color: #aaa;
  border-color: #D0D0D0;
  cursor: not-allowed;
}
.number-cell.paid,
.number-cell.dummy {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
  cursor: not-allowed;
}

/* ─── Seleção Aleatória ─────────────────────────────────── */
.random-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.random-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-dark);
  white-space: nowrap;
}
.random-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.btn-rnd {
  min-width: 44px;
  padding: 6px 14px;
  border-radius: 50px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  line-height: 1;
}
.btn-rnd:hover, .btn-rnd-go:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}
.btn-rnd:active { transform: scale(.95); }
.btn-rnd-go {
  padding: 6px 14px;
  border-radius: 0 50px 50px 0;
  border: 2px solid var(--primary);
  border-left: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.random-custom-wrap {
  display: flex;
}
.random-input {
  width: 72px;
  border-radius: 50px 0 0 50px;
  border: 2px solid var(--primary);
  border-right: none;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  color: var(--primary-dark);
  text-align: center;
}
.random-input:focus { border-color: var(--primary-dark); }
/* Remove setas do input number */
.random-input::-webkit-outer-spin-button,
.random-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.random-input[type=number] { -moz-appearance: textfield; }

.btn-rnd-clear {
  padding: 6px 14px;
  border-radius: 50px;
  border: 2px solid #ccc;
  background: transparent;
  color: #888;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-rnd-clear:hover { border-color: #e74c3c; color: #e74c3c; }

/* ─── Barra Inferior Fixa ───────────────────────────────── */
.sticky-bar {
  transition: transform .15s ease;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--primary);
  padding: 12px 0;
  box-shadow: 0 -4px 20px rgba(212,99,106,.4);
  z-index: 100;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.sticky-count { color: rgba(255,255,255,.9); font-size: 13px; }
.sticky-total { color: #fff; font-size: 20px; font-weight: 800; }

/* ─── Botões ─────────────────────────────────────────────── */
.btn-primary-rifa {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  padding: 10px 28px;
  transition: background .2s, transform .15s;
}
.btn-primary-rifa:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary-rifa:active { transform: scale(.97); }

/* ─── Formulário (modal) ─────────────────────────────────── */
.selected-summary {
  background: var(--primary-xlt);
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
}
.selected-summary .num-chip {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
}

/* Opções de pagamento */
.payment-options { display: flex; flex-direction: column; gap: 10px; }
.payment-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  font-size: 14px;
}
.payment-opt:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-xlt);
}
.payment-opt input[type="radio"] { display: none; }
.pix-icon { font-size: 24px; }

/* ─── Página de Pagamento ────────────────────────────────── */
.payment-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.success-card { border-top: 6px solid #28a745; }
.success-icon { font-size: 64px; }

.countdown-wrap {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: #8a6200;
}

.numbers-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.number-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
}

.qr-img {
  width: 220px;
  height: 220px;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 6px;
}

.pix-code-box {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  word-break: break-all;
  font-size: 12px;
}

/* ─── Cards públicos (listagem) ─────────────────────────── */
.rifa-card { border-radius: 16px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.rifa-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(212,99,106,.2); }
.badge-price { background: var(--primary); color: #fff; border-radius: 50px; padding: 4px 14px; font-weight: 700; font-size: 14px; }

/* ─── ADMIN ─────────────────────────────────────────────── */
.admin-body { background: #f3f4f6; }

.admin-nav {
  height: 58px;
  background: var(--primary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

.admin-layout {
  display: flex;
  min-height: calc(100vh - 58px);
}

.admin-sidebar {
  width: 220px;
  background: #1a1a2e;
  flex-shrink: 0;
  padding: 16px 0;
  transition: transform .3s;
}
@media (max-width: 767px) {
  .admin-sidebar {
    position: fixed;
    top: 58px; left: 0; bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
  }
  .admin-sidebar.open { transform: translateX(0); }
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar-nav a.active { border-left: 3px solid var(--primary); }

.admin-main { flex: 1; overflow: auto; padding: 8px; }

/* Cards stats */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.stat-card.success { background: #e8f8ee; }
.stat-icon  { font-size: 28px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: #888; }

/* Números na tabela admin */
.numbers-mini-sm { display: flex; flex-wrap: wrap; gap: 3px; }
.numbers-mini-sm span {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 600;
}
.numbers-mini-sm .more {
  background: #eee;
  color: #888;
}

/* ─── Draw result ────────────────────────────────────────── */
.result-block { transition: all .2s; }

/* ─── Link "Consultar meus números" (rifa.php) ───────────── */
.consulta-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  opacity: .8;
  transition: opacity .2s;
}
.consulta-link:hover { opacity: 1; color: var(--primary-dark); }

/* ─── Página Meus Números ────────────────────────────────── */
.consulta-hero {
  background: linear-gradient(145deg, #f8c8cc 0%, #f0a0a8 40%, #e88090 100%);
  border-radius: 0 0 40px 40px;
  margin-bottom: 0;
  box-shadow: 0 8px 32px rgba(212,99,106,.25);
  position: relative;
}
.consulta-icon  { font-size: 48px; margin-bottom: 6px; }
.consulta-title { font-weight: 800; font-size: 28px; color: #fff; margin-bottom: 6px; }
.consulta-sub   { color: rgba(255,255,255,.9); font-size: 14px; max-width: 340px; margin: 0 auto; }

.back-link {
  display: inline-block;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 12px;
  transition: color .2s;
}
.back-link:hover { color: #fff; }

/* Card do formulário */
.consulta-form-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(212,99,106,.18);
}
.consulta-input-wrap {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--primary-light);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color .2s;
}
.consulta-input-wrap:focus-within { border-color: var(--primary); }

.consulta-input-icon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--primary);
  font-size: 16px;
  background: var(--primary-xlt);
}
.consulta-input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 8px;
  font-size: 15px;
  flex: 1;
  outline: none;
}
.consulta-btn {
  border-radius: 0 50px 50px 0 !important;
  padding: 0 22px;
  font-size: 14px;
  white-space: nowrap;
}

/* Cabeçalho dos resultados */
.results-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.results-greeting { font-size: 17px; font-weight: 700; }
.results-count    { font-size: 13px; color: #666; background: #f0f0f0; border-radius: 20px; padding: 3px 10px; }

/* Card de rifa nos resultados */
.result-rifa-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.result-rifa-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #f0e0e0;
  flex-wrap: wrap;
}
.result-rifa-img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}
.result-rifa-img--placeholder {
  background: var(--primary-xlt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.result-rifa-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-rifa-meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.min-w-0 { min-width: 0; }

.result-rifa-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f9f9f9;
  font-size: 13px;
  border-bottom: 1px solid #f0e0e0;
}

/* Cada pedido dentro do card */
.result-order {
  padding: 16px;
  border-bottom: 1px solid #f5eded;
}
.result-order:last-child { border-bottom: none; }
.result-order--paid    { background: #fff; }
.result-order--pending { background: #fffbf0; }

.result-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.result-order-total { font-weight: 800; font-size: 16px; color: var(--primary); }

/* Badges de número nos resultados */
.result-numbers { display: flex; flex-wrap: wrap; gap: 5px; }
.result-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
}
.result-num--paid    { background: var(--primary); color: #fff; }
.result-num--pending { background: #FFF3CD; color: #856404; border: 1px solid #FFE083; }

@media (max-width: 480px) {
  .result-rifa-header { gap: 8px; }
  .result-rifa-img { width: 44px; height: 44px; }
  .result-num { font-size: 12px; min-width: 30px; padding: 3px 6px; }
}

/* ─── Botão PIX grande (payment.php) ────────────────────── */
.btn-pix-big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .12s, box-shadow .2s;
  box-shadow: 0 6px 20px rgba(212,99,106,.45);
  letter-spacing: .2px;
}
.btn-pix-big:hover  { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,99,106,.5); }
.btn-pix-big:active { transform: scale(.97); }
.btn-pix-big.copied { background: #1a9e45; box-shadow: 0 6px 20px rgba(26,158,69,.4); }
.btn-pix-big .bi    { font-size: 20px; }

/* Área de referência do código PIX (leitura, não ação) */
.pix-code-ref {
  background: #f6f6f6;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 11px;
  color: #999;
  word-break: break-all;
  line-height: 1.5;
}
.pix-code-ref span  { display: block; margin-bottom: 3px; font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.pix-code-ref code  { color: #555; font-size: 11px; }

/* ─── Hero: fundo de imagem ──────────────────────────────── */
.rifa-hero--image {
  /* background é definido via inline style — aqui só fallback */
  background-color: #333 !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Overlay escuro para garantir legibilidade do texto */
.rifa-hero--image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .42);
  border-radius: 0 0 40px 40px;
  z-index: 0;
}

/* Garante que hearts e container fiquem acima do overlay */
.rifa-hero--image > .hearts-deco,
.rifa-hero--image > .container {
  position: relative;
  z-index: 1;
}

/* Corações mais sutis sobre foto */
.rifa-hero--image > .hearts-deco {
  opacity: .18;
}

/* ─── Hero: cor sólida — força contraste do texto ────────── */
.rifa-hero .rifa-label,
.rifa-hero .rifa-subtitle-font,
.rifa-hero .rifa-desc,
.rifa-hero .draw-date {
  /* texto sempre branco independente do fundo escolhido */
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}
