/* Base layout */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #ffffff; color: #1f1f1f; }

.header { display: flex; align-items: center; justify-content: center; padding: 16px 24px; border-bottom: 1px solid #ddd; position: relative; }
.header h1 { font-size: 20px; margin: 0; text-align: center; width: 100%; color: #1f5db8; }
.header-actions { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; align-items: center; }
.user { font-size: 14px; color: #555; }

.container { max-width: 900px; margin: 24px auto; padding: 0 16px; text-align: center; }
.container.narrow { max-width: 420px; }

.card { border: 1px solid #eee; border-radius: 8px; padding: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.card h2 { margin-top: 0; }

.form { display: grid; gap: 10px; }
.form label { font-size: 14px; color: #2b2d33; display: block; margin-bottom: 10px; font-weight: 600; }
.form label input,
.form label select,
.form label textarea { margin-top: 6px; }
.form input[type="text"], .form input[type="password"], .form select { padding: 10px 12px; border: 1px solid #e5eaf3; border-radius: 8px; font-size: 14px; width: 100%; height: 42px; background: #fff; }
.form textarea { padding: 10px 12px; border: 1px solid #e5eaf3; border-radius: 8px; font-size: 14px; width: 100%; min-height: 110px; background: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: #6a8bd3; box-shadow: 0 0 0 3px rgba(106,139,211,0.15); }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid #ccc; background: #f7f7f7; color: #222; border-radius: 6px; text-decoration: none; cursor: pointer; }
.btn.primary { background: #2ecc71; border-color: #28a745; color: #fff; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:hover { filter: brightness(0.98); }

/* Ações na lista do modal */
.list-actions { display: flex; gap: 8px; margin-top: 6px; }

/* Cores suaves para ações específicas */
.btn-pay { background: #e7f1ff; border-color: #a3c8ff; color: #0b5ed7; }
.btn-pay:hover { background: #d9eaff; }
.btn-danger-soft { background: #ffe7e7; border-color: #ffb3b3; color: #b42318; }
.btn-danger-soft:hover { background: #ffdcdc; }

.muted { color: #4a4a4a; font-size: 14px; }
.alert { padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.alert-error { background: #fdecea; color: #9b1c1c; border: 1px solid #f7c5c0; }
.hidden { display: none; }

/* Conteúdo público */
.lead { font-size: 19px; font-weight: 700; text-align: center; margin: 8px 0; color: #1f1f1f; }
.sublead { font-size: 16px; color: #2c2c2c; text-align: center; margin: 6px 0 12px; }
.prize-title { font-size: 20px; font-weight: 800; text-align: center; margin: 16px 0 12px; color: #1f5db8; }
.prizes { display: grid; grid-template-columns: repeat(2, 300px); gap: 16px; align-items: start; justify-content: center; }
.prizes.one-column { grid-template-columns: 1fr; }
.prizes.one-column .prize-list { text-align: center; }
.prize-list { list-style: none; margin: 0; padding: 12px; display: grid; gap: 8px; text-align: left; background: #ffffff; border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.info-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; text-align: center; }
.cta { font-weight: 700; text-align: center; margin: 8px 0 14px; color: #1f1f1f; }
.pix-box { border: 1px solid #d5eefc; background: #f0f9ff; padding: 12px; border-radius: 8px; font-weight: 700; display: grid; gap: 6px; max-width: 480px; margin: 0 auto 18px; text-align: center; color: #0c4a6e; }

/* Grid de cotas */
.grid { display: grid; grid-template-columns: repeat(10, 60px); grid-auto-rows: 60px; gap: 10px; justify-content: center; }
.cota { position: relative; width: 60px; height: 60px; border-radius: 8px; border: 1px solid #cfcfcf; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.cota.livre { background: #28a745; color: #fff; }
.cota.pago { background: #7f8c8d; color: #fff; }
.cota.reservado { background: #ffc107; color: #212529; }

/* Inteira (pago/reservado) */
.cota.inteira-pago { background: #7f8c8d; color: #fff; }
.cota.inteira-reservado { background: #ffc107; color: #212529; }

/* Meia única (lado vendido à esquerda por padrão) */
.cota.meia-left-pago { background: linear-gradient(to right, #7f8c8d 50%, #28a745 50%); color: #fff; }
.cota.meia-left-reservado { background: linear-gradient(to right, #ffc107 50%, #28a745 50%); color: #212529; }
.cota.meia-right-pago { background: linear-gradient(to right, #28a745 50%, #7f8c8d 50%); color: #fff; }
.cota.meia-right-reservado { background: linear-gradient(to right, #28a745 50%, #ffc107 50%); color: #212529; }

/* Duas meias (ambas pagas/reservadas ou mix) */
.cota.duas-meias-pago { background: #7f8c8d; color: #fff; }
.cota.duas-meias-reservado { background: #ffc107; color: #212529; }
.cota.duas-meias-misto-left-pago { background: linear-gradient(to right, #7f8c8d 50%, #ffc107 50%); color: #fff; }
.cota.duas-meias-misto-left-reservado { background: linear-gradient(to right, #ffc107 50%, #7f8c8d 50%); color: #212529; }
.footer { text-align: center; font-size: 13px; color: #5a5a5a; padding: 14px 16px; border-top: 1px solid #e5e5e5; margin-top: 24px; }
.footer a { color: #1f5db8; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.cota.pago:disabled,
.cota.inteira-pago:disabled,
.cota.duas-meias-pago:disabled { opacity: 1; }
.cota:hover { filter: brightness(0.97); }

/* Tooltip leve */
.cota.pago:hover::after,
.cota.reservado:hover::after,
.cota.meia-left-pago:hover::after,
.cota.meia-left-reservado:hover::after,
.cota.meia-right-pago:hover::after,
.cota.meia-right-reservado:hover::after,
.cota.duas-meias-pago:hover::after,
.cota.duas-meias-reservado:hover::after,
.cota.duas-meias-misto-left-pago:hover::after,
.cota.duas-meias-misto-left-reservado:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-content { background: #fff; border-radius: 10px; padding: 18px; width: 100%; max-width: 520px; margin: 0 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.modal-content h3 { margin-top: 0; }
.form-row { display: grid; gap: 6px; margin-bottom: 10px; }
.radio-group { display: grid; gap: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* Paleta de cores suaves e ajustes visuais */
:root {
  --bg-soft: #f7f9fc;
  --card-bg: #ffffff;
  --border-soft: #e5eaf3;
  --accent: #6a8bd3;
  --accent-dark: #5574b8;
  --text: #2b2d33;
  --muted: #6b7280;
}

body { background: var(--bg-soft); color: var(--text); }
.container.narrow { max-width: 760px; }
.card { background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06); }
.card h2 { color: var(--text); font-weight: 700; }
.section { padding-top: 4px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--accent); margin: 4px 0 8px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.modal-actions { border-top: 1px solid var(--border-soft); padding-top: 12px; }

/* Modal padrão do site */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,0.35); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-backdrop.show { display: flex; }
.modal-card { width: 100%; max-width: 520px; background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: 0 10px 30px rgba(17,24,39,0.15); padding: 16px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.modal-body { color: var(--muted); margin-bottom: 12px; }
.btn.btn-danger-soft { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.btn.btn-danger-soft:hover { background: #fecaca; border-color: #fca5a5; }
/* Layout para página de configurações */
.settings { display: grid; gap: 16px; }
.section { display: grid; gap: 10px; }
.section-title { font-size: 16px; font-weight: 700; color: #1f5db8; margin: 2px 0 4px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

@media (max-width: 700px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
/* Garantir que o modal de confirmação sobreponha o modal principal */
.modal.confirm { z-index: 1000; }

/* Travar scroll quando modal aberto */
.no-scroll { overflow: hidden; }

/* Responsivo */
@media (max-width: 1024px) {
  .prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(8, 56px); grid-auto-rows: 56px; gap: 9px; }
  .cota { width: 56px; height: 56px; font-size: 13px; }
}

@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(6, 52px); grid-auto-rows: 52px; gap: 8px; }
  .cota { width: 52px; height: 52px; font-size: 13px; }
  .prizes { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(5, 48px); grid-auto-rows: 48px; gap: 7px; }
  .cota { width: 48px; height: 48px; font-size: 12px; }
  .container { padding: 0 12px; }
  .header h1 { font-size: 18px; }
  .pix-box { margin: 0 auto 14px; }
  .modal { padding: 12px; }
  .modal-content { max-width: 95vw; }
}

/* Header responsivo: empilhar ações abaixo do título em tablets/celulares */
@media (max-width: 900px) {
  .header { flex-direction: column; padding: 12px 16px; }
  .header-actions { position: static; transform: none; margin-top: 8px; justify-content: center; flex-wrap: wrap; }
  .user { text-align: center; }
}
.titlebar { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.titlebar h2 { margin: 0; text-align: center; width: 100%; }
.admin-actions { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-actions .btn { min-width: 120px; height: 36px; font-size: 14px; }

/* Uniformizar altura dos botões no header */
.header-actions .btn { height: 36px; font-size: 14px; }

/* Switch (liga/desliga) */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #e5eaf3; border: 1px solid var(--border-soft); border-radius: 12px; cursor: pointer; transition: 0.2s ease; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 50%; transform: translateY(-50%); background: #fff; border: 1px solid #cfd8e3; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.08); transition: 0.2s ease; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translate(20px, -50%); border-color: var(--accent-dark); }

/* Botão flutuante WhatsApp */
.whatsapp-float { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,0.18); z-index: 1100; text-decoration: none; border: 1px solid #1db954; }
.whatsapp-float:hover { filter: brightness(0.97); }
.whatsapp-float svg { width: 26px; height: 26px; display: block; }
/* Grupo de botões no formulário de usuário */
.btn-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.btn-group .btn {
  flex: 1 1 0;
  text-align: center;
}

.inline-form { display: inline; }
.mb-10 { margin-bottom: 10px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.text-center { text-align: center; }
.img-fluid { max-width: 100%; height: auto; }
.img-rounded { border-radius: 8px; }
.img-bordered { border: 1px solid #e5e5e5; }
.img-block-center { display: block; margin: 0 auto; }
.img-qr { max-width: 240px; }
.grid-center { display: grid; gap: 8px; justify-items: center; }
.fw-700 { font-weight: 700; }
.mb-8 { margin-bottom: 8px; }
.section-title.center { position: relative; text-align: center; }
.section-title-actions { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }

/* Botões menores e de mesmo tamanho */
.btn.btn-sm {
  padding: 8px 12px;
  font-size: 0.9rem;
}
