/* Baita Sorte Sua - Estilos do site */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #ca8a04;
  --danger: #dc2626;
  --accent: #7c3aed;
  --accent-light: #ede9fe;
  --bg: #f0f4ff;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.1);
}

* {
  box-sizing: border-box;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}
input, textarea, select, button {
  max-width: 100%;
}

html {
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Layout - evita conteúdo fora da área visível em qualquer tela */
.layout-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}
.container {
  width: 100%;
  max-width: 1100px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 4vw, 1rem);
  padding-left: max(clamp(0.75rem, 4vw, 1rem), env(safe-area-inset-left, 0));
  padding-right: max(clamp(0.75rem, 4vw, 1rem), env(safe-area-inset-right, 0));
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}
.site-logo img {
  height: 40px;
  width: auto;
}
.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.site-nav a {
  color: var(--text);
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--primary);
}

/* Conteúdo principal */
.main-content {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding: 2rem 0;
  min-height: 60vh;
}

/* Filtro Disponíveis / Finalizadas (home – mobile first) */
.rifa-filter {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.rifa-filter-btn {
  flex: 1;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.rifa-filter-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}
.rifa-filter-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}
.rifa-filter-btn:focus {
  outline: none;
}
.rifa-filter-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Cards de rifa - responsivo: 1 coluna em telas pequenas, grid em maiores */
.rifas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  min-width: 0;
}
@media (min-width: 380px) {
  .rifas-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  }
}
.rifa-card {
  min-width: 0;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08), 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  transition: box-shadow .25s ease, transform .25s ease, border-color .2s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.rifa-card:hover {
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.25);
}
.rifa-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
}
.rifa-card:hover .rifa-card-title a {
  color: var(--primary);
}
/* Área da imagem no card: carrossel com transição */
.rifa-card-image-wrap {
  aspect-ratio: 4/3;
  width: 100%;
  min-height: 0;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  overflow: hidden;
  position: relative;
  display: block;
}
.rifa-card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.15) 0%, transparent 40%);
  pointer-events: none;
}
.rifa-card-track {
  display: flex;
  height: 100%;
  width: calc(100% * var(--card-n, 1));
  transform: translateX(calc(-100% * var(--card-idx, 0) / var(--card-n, 1)));
  transition: transform 0.4s ease-out;
  will-change: transform;
}
.rifa-card-slide {
  flex: 0 0 calc(100% / var(--card-n, 1));
  width: calc(100% / var(--card-n, 1));
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.rifa-card-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.rifa-card-image-wrap img.rifa-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.rifa-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.rifa-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.rifa-card-desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.rifa-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.rifa-card-value small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.rifa-card .btn {
  margin-top: auto;
  font-weight: 700;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  font-size: 1rem;
}
.rifa-card-meta {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}
.rifa-card-winners {
  margin: 0.75rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.rifa-card-winner-line {
  margin: 0.5rem 0;
  line-height: 1.5;
}
.rifa-card-winner-line:first-child {
  margin-top: 0;
}
.rifa-card-winner-item {
  display: block;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
}
.rifa-card-winner-item:first-of-type {
  margin-top: 0.35rem;
}
.rifa-card-winner-contact {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.rifa-card-disabled {
  cursor: not-allowed;
  opacity: 0.9;
  font-weight: 600;
  background: var(--secondary) !important;
  color: #fff !important;
}
.rifa-card-finalized .rifa-card-value small {
  color: var(--text-muted);
}

/* Card finalizada – visual diferenciado */
.rifa-card-finalized {
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1), 0 1px 3px rgba(0,0,0,.06);
}
.rifa-card-finalized:hover {
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15), 0 4px 12px rgba(0,0,0,.08);
  border-color: rgba(124, 58, 237, 0.35);
}
.rifa-card-finalized .rifa-card-image-wrap::after {
  background: linear-gradient(to top, rgba(124, 58, 237, 0.2) 0%, transparent 50%);
}
.rifa-card-finalized .status-badge.finalized {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
  color: #5b21b6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.rifa-card-finalized .rifa-card-winners {
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
  border-color: rgba(124, 58, 237, 0.2);
}
.rifa-card-finalized .rifa-card-winner-line strong {
  color: #5b21b6;
}
.rifa-card-finalized .rifa-card-value {
  color: var(--text-muted);
  font-weight: 700;
}

/* Página rifa - bloco encerrada e ganhadores */
.rifa-finalized-block {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.2);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.06);
}
.rifa-finalized-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #5b21b6;
}
.rifa-winners-list {
  margin-top: 1.25rem;
}
.rifa-winner-prize {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.rifa-winner-prize:last-child {
  margin-bottom: 0;
}
.rifa-winner-prize strong {
  color: #5b21b6;
  font-size: 1rem;
}
.rifa-winner-names {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
}
.rifa-winner-names br + br {
  display: none;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}
.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--secondary);
  color: #fff;
  text-decoration: none;
}
.btn-block {
  width: 100%;
}

/* Formulários */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Cards de página - não ultrapassam a área visível */
.page-card {
  width: 100%;
  max-width: min(520px, 100%);
  min-width: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin: 0 auto 2rem;
}

/* Carousel - detalhe da rifa (slide horizontal + bolinhas) */
.rifa-detail-gallery {
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 420px;
  min-height: 200px;
  background: #fff;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
}
.rifa-detail-gallery .carousel-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.rifa-detail-gallery .slide-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease-out;
  will-change: transform;
}
.rifa-detail-gallery .slide-item {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.rifa-detail-gallery .slide-item img,
.rifa-detail-gallery .rifa-detail-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}
.rifa-detail-gallery .gallery-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  z-index: 2;
}
.rifa-detail-gallery .gallery-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.rifa-detail-gallery .gallery-dots span:hover {
  background: rgba(255,255,255,0.95);
}
.rifa-detail-gallery .gallery-dots span.active {
  background: var(--primary);
  transform: scale(1.2);
}
.rifa-detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.rifa-detail-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}
.rifa-detail-regulation {
  white-space: pre-wrap;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
}
.rifa-regulation-wrap {
  margin-bottom: 1rem;
}
.rifa-regulation-wrap .rifa-detail-regulation {
  margin-top: 0.5rem;
  max-height: 20rem;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
}
.rifa-regulation-wrap .rifa-detail-regulation.regulation-content-collapsed {
  margin-top: 0;
  margin-bottom: 0;
}

/* Página do pedido - mobile-first, destaque copia e cola */
.pedido-page .pedido-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 0 0 1.5rem;
  text-align: center;
}
.pedido-page .pedido-hero h1 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.pedido-page .pedido-hero .order-total-display {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0.5rem 0 0;
}
.pedido-page .pedido-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.95;
}
.pedido-page .pix-card {
  background: linear-gradient(180deg, #fff 0%, var(--accent-light) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}
.pedido-page .pix-card h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 1.125rem;
}
.pedido-page .pix-qr-wrap {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  display: inline-block;
  margin: 1rem 0;
  min-height: 240px;
  box-shadow: var(--shadow);
}
.pedido-page .pix-qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
  max-width: min(220px, 100%);
  max-height: min(220px, 50vw);
  object-fit: contain;
  margin: 0 auto;
  background: #fff;
}
.pedido-page .pix-qr-wrap .pix-qr-fallback {
  display: none;
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.pedido-page .pix-qr-wrap.img-failed .pix-qr-fallback {
  display: block;
}
.pedido-page .pix-qr-wrap.img-failed img {
  display: none;
}
.pedido-page .pix-copy-section {
  margin-top: 1.25rem;
}
.pedido-page .pix-copy-section .label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: block;
}
.pedido-page .pix-copy-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
@media (min-width: 480px) {
  .pedido-page .pix-copy-area {
    flex-direction: row;
    align-items: stretch;
  }
}
.pedido-page .pix-copy-area input {
  flex: 1;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.pedido-page .btn-copy-pix {
  min-height: 48px;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  background: var(--success) !important;
  color: #fff !important;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.pedido-page .btn-copy-pix:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, .4);
}
.pedido-page .btn-copy-pix.copied {
  background: var(--primary) !important;
}

/* Comprovante (pedido pago) – tipografia otimizada para PDF/imagem */
.pedido-page .comprovante-wrap {
  margin-top: 1.5rem;
}
.pedido-page .comprovante {
  background: #fff;
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.15);
  width: 100%;
  max-width: min(420px, 100%);
  min-width: 0;
  margin: 0 auto 1.5rem;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
.pedido-page .comprovante-header {
  background: linear-gradient(135deg, var(--success) 0%, #15803d 100%);
  color: #fff;
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.pedido-page .comprovante-logo {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  word-spacing: 0.08em;
}
.pedido-page .comprovante-tipo {
  display: block;
  font-size: 0.8125rem;
  opacity: 0.95;
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
  word-spacing: 0.05em;
}
.pedido-page .comprovante-body {
  padding: 1.5rem 1.5rem 1.25rem;
  line-height: 1.6;
  word-spacing: 0.03em;
  letter-spacing: 0.01em;
}
.pedido-page .comprovante-rifa {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
  line-height: 1.4;
  word-spacing: 0.02em;
}
.pedido-page .comprovante-status {
  color: var(--success);
  font-size: 0.9375rem;
  margin: 0 0 1rem;
  word-spacing: 0.04em;
}
.pedido-page .comprovante-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  word-spacing: 0.04em;
  line-height: 1.4;
}
.pedido-page .comprovante-value {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  word-spacing: 0.02em;
  letter-spacing: 0.02em;
}
.pedido-page .comprovante-auth {
  margin-bottom: 1rem;
}
.pedido-page .comprovante-numeros {
  margin-bottom: 1rem;
}
.pedido-page .comprovante-numeros-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.pedido-page .numero-badge {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}
.pedido-page .comprovante-total {
  margin-bottom: 0.5rem;
}
.pedido-page .comprovante-data,
.pedido-page .comprovante-sorteio {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  line-height: 1.55;
  word-spacing: 0.03em;
}
.pedido-page .comprovante-caixa-link {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  word-spacing: 0.03em;
}
.pedido-page .comprovante-caixa-link a {
  color: var(--primary);
  font-weight: 600;
}
.pedido-page .comprovante-print-regulamento {
  display: none;
  margin-top: 1rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.55;
  word-spacing: 0.04em;
  letter-spacing: 0.01em;
}
.pedido-page .comprovante-wrap.include-regulamento .comprovante-print-regulamento {
  display: block;
}
.pedido-page .comprovante-regulamento-text {
  white-space: pre-wrap;
  word-break: break-word;
  word-spacing: 0.06em;
  letter-spacing: 0.02em;
  font-family: inherit;
  margin: 0.6rem 0 0;
  padding: 0.5rem 0;
  font-size: 0.7rem;
  line-height: 1.6;
  max-width: 100%;
}
.pedido-page .comprovante-footer {
  padding: 0.875rem 1.5rem;
  background: var(--bg);
  font-size: 0.875rem;
  text-align: center;
  word-spacing: 0.03em;
  line-height: 1.5;
}
.pedido-page .comprovante-footer a {
  font-weight: 600;
}
/* Comprovante – botões de baixar/compartilhar (mobile-first, layout moderno e uniforme) */
.pedido-page .comprovante-share {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 0;
}
.pedido-page .comprovante-share-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 1rem;
  text-align: center;
  letter-spacing: 0.02em;
}
.pedido-page .comprovante-share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  width: 100%;
}
.pedido-page .comprovante-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 52px;
  padding: 0.5rem 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  min-width: 0;
}
.pedido-page .comprovante-share-btn:hover {
  transform: translateY(-1px);
}
.pedido-page .comprovante-share-btn:active {
  transform: scale(0.97);
}
.pedido-page .comprovante-share-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}
.pedido-page .comprovante-share-btn-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}
.pedido-page .comprovante-share-btn-icon-wa svg {
  width: 26px;
  height: 26px;
}
.pedido-page .comprovante-share-btn-label {
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  opacity: 0.95;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pedido-page .comprovante-share-pdf,
.pedido-page .comprovante-share-img {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.pedido-page .comprovante-share-pdf:hover,
.pedido-page .comprovante-share-img:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.pedido-page .comprovante-share-print {
  background: linear-gradient(160deg, #64748b 0%, #475569 100%);
  color: #fff;
}
.pedido-page .comprovante-share-print:hover {
  box-shadow: 0 6px 16px rgba(100, 116, 139, 0.35);
}
.pedido-page .comprovante-share-copy,
.pedido-page .comprovante-share-share {
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.pedido-page .comprovante-share-copy:hover,
.pedido-page .comprovante-share-share:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.pedido-page .comprovante-share-copy.copied {
  background: linear-gradient(160deg, var(--success-light) 0%, #bbf7d0 100%);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.3);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}
.pedido-page .comprovante-share-whatsapp {
  background: linear-gradient(160deg, #25D366 0%, #20bd5a 100%);
  color: #fff;
}
.pedido-page .comprovante-share-whatsapp:hover {
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}
.pedido-page .comprovante-share-btn .btn-comprovante-icon {
  font-size: 1.1rem;
  line-height: 1;
}

@media print {
  body * { visibility: hidden; }
  .pedido-page .comprovante-wrap,
  .pedido-page .comprovante-wrap * { visibility: visible; }
  .pedido-page .comprovante-print-regulamento { display: block !important; visibility: visible !important; }
  .pedido-page .comprovante-wrap {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    box-shadow: none;
    border: none;
  }
  .pedido-page .comprovante-body,
  .pedido-page .comprovante-print-regulamento {
    word-spacing: 0.04em;
    letter-spacing: 0.02em;
    line-height: 1.6;
  }
  .pedido-page .comprovante-regulamento-text {
    word-spacing: 0.06em;
    line-height: 1.6;
  }
  .pedido-page .comprovante-share { display: none !important; }
  .site-header, .site-footer, .main-content > .container > a,
  #loading, #alert, #pix-box, #expired-box, #not-found, .pedido-hero { display: none !important; }
}

.pix-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}
.pix-box img {
  max-width: 100%;
  height: auto;
  max-height: 260px;
  margin: 0 auto 1rem;
  display: block;
}
.pix-copy-area {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.pix-copy-area input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pix-copy-area .btn {
  flex-shrink: 0;
}
.order-status {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.order-status.pending { background: #fef3c7; color: #92400e; }
.order-status.paid { background: var(--success-light); color: #065f46; }
.order-status.cancelled,
.order-status.expired { background: #fee2e2; color: #991b1b; }

/* Contador de cotas (acima dos botões) */
.quotas-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.quotas-counter .qty-minus,
.quotas-counter .qty-plus {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.quotas-counter .qty-minus:hover,
.quotas-counter .qty-plus:hover {
  border-color: var(--primary);
  background: var(--accent-light);
}
.quotas-counter .quotas-value {
  min-width: 3rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

/* Botões +1, +5, +10, +20 - 2 em cima, 2 em baixo */
.quotas-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.quotas-buttons .qty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem 1rem;
  min-height: 64px;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid #a67c00;
  border-radius: var(--radius);
  background: #ffdc6b;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.quotas-buttons .qty-btn .qty-num {
  display: block;
  line-height: 1;
}
.quotas-buttons .qty-btn .qty-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--success);
  color: #fff;
  line-height: 1;
}
.quotas-buttons .qty-btn.selected .qty-badge {
  background: rgba(255,255,255,0.9);
  color: var(--success);
}
.quotas-buttons .qty-btn:hover {
  border-color: #c49a00;
  background: #fada64;
  color: #1a1a1a;
}
@keyframes bestseller-pulse {
  0%, 100% { background-color: #00843D; border-color: #006b31; }
  50%      { background-color: #00C853; border-color: #00A651; }
}

.quotas-buttons .qty-btn.qty-btn-bestseller {
  border-color: #00843D;
  background: #00A651;
  color: #fff;
  animation: bestseller-pulse 2.5s ease-in-out infinite;
}
.quotas-buttons .qty-btn.qty-btn-bestseller .qty-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.quotas-buttons .qty-btn.qty-btn-bestseller:hover {
  border-color: #006b31;
  background: #00C853;
  color: #fff;
}
.quotas-buttons .qty-btn.selected {
  border-color: #c49a00;
  background: #FFE566;
  color: #1a1a1a;
}
.quotas-buttons .qty-btn.qty-btn-bestseller.selected {
  border-color: #006b31;
  background: #00843D;
  color: #fff;
  animation: bestseller-pulse 2.5s ease-in-out infinite;
}
.quotas-buttons .qty-btn.qty-btn-bestseller.selected .qty-badge {
  background: rgba(255,255,255,0.3);
  color: #fff;
}
.quotas-buttons .qty-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .25);
}
.form-group .quotas-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Meus bilhetes */
.tickets-section {
  margin-bottom: 2rem;
}
.tickets-section h3 {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  color: var(--text-muted);
}
.ticket-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ticket-item .rifa-name { font-weight: 600; }
.ticket-item .ticket-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.ticket-item .status-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}
.ticket-item .status-badge.paid { background: #d1fae5; color: #065f46; }
.ticket-item .status-badge.reserved { background: #fef3c7; color: #92400e; }
.ticket-item-order { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ticket-item-with-regulation { display: flex; flex-direction: column; gap: 0.5rem; }
.ticket-item-with-regulation .ticket-item-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ticket-item-regulation-wrap { margin-top: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.btn-regulation-toggle-inline {
  font-size: 0.8125rem;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0;
  text-decoration: underline;
}
.btn-regulation-toggle-inline:hover { opacity: 0.85; }
.regulation-content-inline {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.5rem 0 0;
  max-height: 12rem;
  overflow-y: auto;
  transition: max-height 0.25s ease, padding 0.2s ease, opacity 0.2s ease;
}
.regulation-content-inline.regulation-content-collapsed {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  opacity: 0;
}
.regulation-content,
.tickets-section-regulation .regulation-content {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: 20rem;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
}
.regulation-content-collapsed {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  overflow: hidden !important;
  border: none !important;
  opacity: 0;
}
.tickets-section-regulation > div:first-of-type {
  margin-bottom: 0.5rem;
}
.tickets-section-regulation h3 {
  margin: 0;
  font-size: 1.125rem;
}
/* Página de consulta de bilhetes (tela separada para mobile) */
.main-content-consultar .consultar-back {
  margin-bottom: 1rem;
}
.main-content-consultar .link-back {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9375rem;
}
.main-content-consultar .link-back:hover {
  text-decoration: underline;
}
.consultar-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.consultar-loading p {
  margin: 0;
}

.btn-comprovante-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn-comprovante-download:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

/* Mensagens */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
}
.alert-success {
  background: #d1fae5;
  color: #065f46;
}
.alert-warning {
  background: #fef3c7;
  color: #92400e;
}
.alert-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Loading / empty */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state.empty-state-red-bar {
  position: relative;
  border-radius: var(--radius, 8px);
  overflow: hidden;
}
.empty-state-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #c0392b;
}

/* Notificação no topo: nenhum bilhete encontrado */
.empty-tickets-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #c0392b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.empty-tickets-notification-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.empty-tickets-notification-title {
  font-weight: 700;
  font-size: 1rem;
}
.empty-tickets-notification-msg {
  font-size: 0.9375rem;
  opacity: 0.95;
}
.empty-tickets-notification-close {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.9;
  border-radius: 4px;
}
.empty-tickets-notification-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}

.empty-state h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 1.125rem;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Modal - janela para participar (mobile-first, colorido e alegre) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 480px) {
  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }
}
.modal-overlay.is-open {
  display: flex;
  animation: modalOverlayIn 0.25s ease-out;
}
@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-box {
  background: #f8f7f5;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  border-top: 3px solid #2563eb;
  animation: modalBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (min-width: 480px) {
  .modal-box {
    border-radius: 24px;
    border-top: none;
    border: 3px solid #2563eb;
    max-height: 90vh;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  }
}
@keyframes modalBoxIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.modal-box .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.25rem 1.25rem;
  background: #2563eb;
  border-radius: 24px 24px 0 0;
  position: relative;
}
.modal-box .modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.modal-box .modal-close {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.modal-box .modal-close:hover {
  background: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.modal-box .modal-close:active {
  transform: scale(0.95);
}
.modal-box .modal-body {
  padding: 1.5rem 1.25rem 2rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
.modal-box .modal-body .form-group input,
.modal-box .modal-body .form-group textarea {
  border-radius: 14px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  min-height: 48px;
  border: 2px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-box .modal-body .form-group input:focus,
.modal-box .modal-body .form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.modal-box .modal-body .form-group label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
}
.modal-box .modal-body .alert {
  margin-bottom: 1rem;
  border-radius: 14px;
}
.modal-box .modal-body .btn-primary {
  margin-top: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: 16px;
  background: #16a34a;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
  border: none;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.modal-box .modal-body .btn-primary:hover {
  background: #15803d;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}
.modal-box .modal-body .btn-primary:active {
  transform: scale(0.98);
}
/* Cotas no modal - toques maiores no mobile */
.modal-box .quotas-counter .qty-minus,
.modal-box .quotas-counter .qty-plus {
  min-width: 48px;
  min-height: 48px;
  border-radius: 14px;
  font-size: 1.5rem;
}
.modal-box .quotas-buttons .qty-btn {
  min-height: 56px;
  padding: 0.875rem;
  border-radius: 14px;
}
.modal-box .quotas-value {
  font-size: 1.75rem;
}

/* Área gerencial (estilos legados; painel de gestão em app separado) */
.gerencial-page .page-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.gerencial-actions {
  margin-bottom: 1.5rem;
}
.gerencial-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gerencial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.gerencial-card-body {
  flex: 1;
  min-width: 200px;
}
.gerencial-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
}
.gerencial-card-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.gerencial-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
  text-decoration: none;
}
.status-badge.active { background: #d1fae5; color: #065f46; }
.status-badge.inactive { background: #e2e8f0; color: #475569; }
.status-badge.finalized { background: #ddd6fe; color: #5b21b6; }
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.gerencial-card-winner {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.gerencial-card-winner strong {
  color: var(--text);
}

.gerencial-section {
  margin-bottom: 2rem;
}
.gerencial-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}
.draws-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.draw-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.draw-item-info {
  flex: 1;
  min-width: 180px;
}
.draw-item-prize {
  font-weight: 600;
  display: block;
}
.draw-item-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.draw-winners {
  font-size: 0.875rem;
  color: var(--text);
  width: 100%;
  margin-top: 0.5rem;
}
.draw-winners .winner {
  display: inline-block;
  margin-right: 0.5rem;
}
.draw-winners .winner-block {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
}
.draw-winners .winner-block:first-child {
  margin-top: 0.5rem;
}
.draw-winners .winner-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.draw-winners .winner-details span {
  color: var(--text);
}

/* Formulário - checkbox como label */
.form-group .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}
.form-group .checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.readonly-field {
  background: var(--bg);
  color: var(--text-muted);
}

/* Página Participar - 3 passos: 1 Selecionar | 2 Dados | 3 QR Code */
.participar-page {
  min-height: 100dvh;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: #f8f7f5;
}
.participar-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  background: #2563eb;
  color: #fff;
}
.participar-back {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  text-decoration: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  -webkit-tap-highlight-color: transparent;
}
.participar-back:hover { color: #fff; background: rgba(255,255,255,0.3); }
.participar-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

/* Indicador de passos (1 - 2 - 3) */
.participar-steps {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.participar-steps .step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
  cursor: default;
}
.participar-steps .step-dot.active {
  background: var(--success);
  color: #fff;
}
.participar-steps .step-dot[data-step]:not(.active) {
  cursor: pointer;
}
.participar-steps .step-dot[data-step]:not(.active):hover {
  background: #e2e8f0;
  color: var(--text);
}
.participar-steps .step-line {
  width: 24px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}
.participar-content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 200px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0));
  padding-right: max(1rem, env(safe-area-inset-right, 0));
}
.participar-step {
  display: none !important;
}
.participar-step.active {
  display: block !important;
  opacity: 1;
  visibility: visible;
  animation: stepIn 0.25s ease-out forwards;
  min-height: 280px;
  width: 100%;
}
@keyframes stepIn {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .participar-step.active {
    animation: none;
  }
}

/* Cards de cada passo - step 1 sempre visível */
.participar-page .step-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  border: 1px solid var(--border);
  width: 100%;
  max-width: min(420px, 100%);
  min-width: 0;
  margin: 0 auto;
  min-height: 220px;
  visibility: visible !important;
  opacity: 1 !important;
}
.participar-page .participar-step.active .step-card {
  visibility: visible !important;
  opacity: 1 !important;
}
#step-1.participar-step.active {
  visibility: visible !important;
  display: block !important;
}
.participar-page .step-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.participar-page .step-card-sub {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Step 1: cotas - contador + botões amarelo/verde */
.participar-page .step1-quotas {
  margin-bottom: 1.25rem;
}
.participar-page .step1-quotas .quotas-counter {
  margin-bottom: 1rem;
}
.participar-page .step1-quotas .quotas-buttons {
  margin-bottom: 0.5rem;
}
.participar-page .step1-quotas .quotas-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.participar-page .step1-regulation-wrap {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.btn-regulation-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-regulation-toggle:hover {
  background: var(--primary);
  color: #fff;
}
.participar-page .step1-regulation-content {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.75rem 0 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  transition: margin-top 0.2s ease;
}
.participar-page .step1-regulation-content[hidden] {
  display: none;
}
.participar-page .step1-caixa-link a {
  font-weight: 600;
}

/* Botões verde e amarelo (como antes) */
.btn-participar-green {
  background: #16a34a !important;
  color: #fff !important;
  border: none;
  font-weight: 700;
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-participar-green:hover {
  background: #15803d !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}
.btn-participar-green:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.btn-participar-yellow {
  background: #ffdc6b !important;
  color: #1a1a1a !important;
  border: 2px solid #a67c00;
  font-weight: 700;
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-participar-yellow:hover {
  background: #fada64 !important;
  border-color: #c49a00;
}

/* Step 2: formulário + ações */
.participar-page .participar-form .form-group {
  margin-bottom: 1rem;
}
.participar-page .participar-form label {
  font-size: 0.875rem;
  font-weight: 500;
}
.participar-page .participar-form input {
  font-size: 16px;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  border: 2px solid var(--border);
}
.participar-page .participar-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.participar-page .step-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.participar-page .step-actions .btn-participar-yellow {
  flex: 0 0 auto;
}
.participar-page .step-actions .btn-participar-green {
  flex: 1;
}

/* Step 3: QR Code PIX */
.participar-page .step-card-pix .step3-top-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.participar-page .step-card-pix .step3-top-buttons .btn {
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}
.participar-page .step-card-pix .step3-top-buttons .btn-step3-home {
  text-decoration: none;
}
.participar-page .step-card-pix .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.participar-page .step-card-pix .step-card-sub {
  margin-bottom: 0.75rem;
}
.participar-page .step3-resumo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.participar-page .step3-valor {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}
.participar-page .step3-qtd {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
/* Aguardando pagamento + countdown regressivo (mm:ss) */
.participar-page .step3-await {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: 2px solid var(--primary-dark);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.participar-page .step3-await-label {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.participar-page .step3-countdown {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
  letter-spacing: 0.08em;
}
.participar-page .step3-countdown-urgent {
  color: var(--danger);
  animation: step3-countdown-pulse 1s ease-in-out infinite;
}
@keyframes step3-countdown-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.03); }
}

.participar-page .step3-status {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.participar-page .step3-status-success {
  color: var(--success);
  font-weight: 600;
}
.participar-page .step3-status-warning {
  color: var(--warning);
}
.participar-page .pix-qr-wrap {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  display: block;
  margin: 0 auto 1rem;
  width: fit-content;
  max-width: 100%;
  min-height: 240px;
  box-shadow: var(--shadow);
}
.participar-page .pix-qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
  max-width: min(220px, 100%);
  max-height: min(220px, 50vw);
  object-fit: contain;
  margin: 0 auto;
  background: #fff;
}
.participar-page .pix-qr-wrap .pix-qr-fallback {
  display: none;
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.participar-page .pix-qr-wrap.img-failed .pix-qr-fallback {
  display: block;
}
.participar-page .pix-qr-wrap.img-failed img {
  display: none;
}
.participar-page .pix-copy-section .label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: block;
}
.participar-page .pix-copy-section input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 0.5rem;
  display: block;
  box-sizing: border-box;
}
.participar-page .pix-copy-section .btn-copy-pix {
  width: 100%;
  margin-top: 0;
}
.participar-page .btn-copy-pix.copied {
  background: var(--primary) !important;
}

/* Alerta na página participar */
.participar-alert {
  margin-bottom: 0.75rem;
}
.participar-alert .alert {
  margin-bottom: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

/* Modal tempo expirado (mesmo estilo da página participar) */
.expired-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.expired-modal-overlay.is-open {
  display: flex;
  animation: expiredModalOverlayIn 0.25s ease-out;
}
@keyframes expiredModalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.expired-modal-box {
  background: #f8f7f5;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  max-width: 420px;
  width: 100%;
  overflow: hidden;
  border-top: 3px solid #16a34a;
  animation: expiredModalBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (min-width: 480px) {
  .expired-modal-overlay {
    align-items: center;
    padding: 1rem;
  }
  .expired-modal-box {
    border-radius: 20px;
    border-top: none;
    border: 3px solid #16a34a;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  }
}
@keyframes expiredModalBoxIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.expired-modal-header {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  padding: 1.25rem 1.25rem 1rem;
  text-align: center;
}
.expired-modal-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.expired-modal-body {
  padding: 1.5rem 1.25rem 1.5rem;
}
.expired-modal-text {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}
.expired-modal-body .btn-participar-green {
  width: 100%;
}

/* Utilitários */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
