/*
 * Design system enxuto do TicketHub — sem framework CSS (Tailwind etc.),
 * para não exigir nenhum passo de build. Estilo de referência: Airbnb /
 * C6 Bank — clean, bordas arredondadas, sombras discretas, sem
 * gradientes, ícones em linha fina, mobile-first.
 *
 * A cor de destaque (--accent) é sobrescrita por tenant via uma tag
 * <style> inline no <head> (ver layouts/app.php), lida do campo
 * primary_color do tenant.
 */

:root {
  --accent: #111827;
  --accent-contrast: #ffffff;
  --bg: #ffffff;
  --bg-muted: #f7f7f8;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --danger: #dc2626;
  --success: #16a34a;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-modal: 0 -8px 30px rgba(16,24,40,.12);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-muted);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.25; font-weight: 700; }
p { margin: 0 0 12px; color: var(--text); }
.muted { color: var(--text-muted); }
.hidden { display: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; max-width: 1080px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand img { height: 40px; width: auto; max-width: 160px; object-fit: contain; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer;
  font-family: var(--font); font-weight: 600; font-size: 16px;
  padding: 14px 22px; border-radius: 999px;
  transition: transform .05s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { opacity: .92; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 14px; border-radius: 999px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 20px;
}
.card + .card { margin-top: 16px; }

.event-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
@media (min-width: 640px) { .event-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .event-grid { grid-template-columns: 1fr 1fr 1fr; } }

.event-card { border-radius: var(--radius-md); overflow: hidden; background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow-card); transition: transform .15s ease, box-shadow .15s ease; }
.event-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.06); }
.event-card-cover { aspect-ratio: 4/3; background: linear-gradient(135deg, var(--bg-muted), #eceef1); display: flex; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; }
.event-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 16px; }
.event-card-title { font-weight: 700; margin-bottom: 6px; }
.event-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 13px; color: var(--text-muted); }
.event-card-meta svg { width: 14px; height: 14px; flex: 0 0 auto; }
.event-card-meta-sep { color: var(--border); margin: 0 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg-muted); color: var(--text-muted); }
.badge-accent { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); color: var(--accent); }

/* ---------- Formulários ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.field .error { font-size: 13px; color: var(--danger); margin-top: 4px; }

/* ---------- Editor rich-text simples (descrição do evento) ---------- */
.rich-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.rich-toolbar button {
  border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--text);
}
.rich-toolbar button:hover { background: var(--bg-muted); }
.rich-editor {
  min-height: 140px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 16px; line-height: 1.5; background: var(--bg); color: var(--text);
}
.rich-editor:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.rich-editor p { margin: 0 0 10px; }
.rich-editor ul, .rich-editor ol { margin: 0 0 10px 20px; }
.rich-content { line-height: 1.6; }
.rich-content p { margin: 0 0 14px; }
.rich-content ul, .rich-content ol { margin: 0 0 14px 22px; }
.rich-content a { color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font-family: var(--font); font-size: 16px;
  padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.checkbox-row input { margin-top: 3px; }
.checkbox-row a { color: var(--accent); text-decoration: underline; }

/* Campo de senha com botão de "olho" pra mostrar/ocultar. */
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--text-muted); border-radius: 999px;
}
.password-toggle:hover { background: var(--bg-muted); }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-showing .icon-eye { display: none; }
.password-toggle.is-showing .icon-eye-off { display: block; }

.alert { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ---------- Bottom sheet (modal mobile-first, sobe de baixo pra cima) ---------- */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.45);
  display: none; align-items: flex-end; justify-content: center; z-index: 100;
}
.sheet-overlay.open { display: flex; }
.sheet {
  background: var(--bg); width: 100%; max-width: 560px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-modal); padding: 12px 20px 24px;
  max-height: 88vh; overflow-y: auto;
  animation: sheet-up .22s ease-out;
}
@media (min-width: 640px) { .sheet { border-radius: var(--radius-lg); margin-bottom: 40px; } }
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: 999px; margin: 6px auto 16px; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Sticky CTA mobile ---------- */
.sticky-cta {
  position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border);
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ---------- Tabelas estilo Stripe (linhas finas, neutro) ---------- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 12px; border-bottom: 1px solid var(--border); }
table.data-table tr:last-child td { border-bottom: none; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-cell { background: var(--bg); padding: 20px; }
.stat-cell .stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.stat-cell .stat-value { font-size: 26px; font-weight: 800; }

.sparkline { display: flex; align-items: flex-end; gap: 4px; height: 80px; }
.sparkline .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }

.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-track { height: 8px; background: var(--bg-muted); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.bar-fill-full { background: var(--success); }

/* ---------- Cartão animado no checkout ---------- */
.card-visual { perspective: 1000px; width: 100%; max-width: 340px; height: 190px; margin: 0 auto 20px; }
.card-visual-inner {
  position: relative; width: 100%; height: 100%; transition: transform .5s;
  transform-style: preserve-3d;
}
.card-visual-inner.is-flipped { transform: rotateY(180deg); }
.card-visual-front, .card-visual-back {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; padding: 22px;
  color: #fff; background: linear-gradient(135deg, var(--accent), #1f2937);
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; justify-content: space-between;
}
.card-visual-back { transform: rotateY(180deg); justify-content: flex-start; padding: 0; }
.card-visual-chip { width: 42px; height: 30px; border-radius: 6px; background: linear-gradient(135deg,#e5c158,#b8912f); }
.card-visual-number { font-family: 'Courier New', monospace; font-size: 20px; letter-spacing: 2px; margin: 18px 0; }
.card-visual-row { display: flex; justify-content: space-between; align-items: flex-end; }
.card-visual-label { font-size: 10px; opacity: .7; text-transform: uppercase; letter-spacing: 1px; }
.card-visual-value { font-size: 14px; font-weight: 600; margin-top: 2px; font-family: 'Courier New', monospace; }
.card-visual-stripe { width: 100%; height: 44px; background: #1a1a1a; margin-top: 24px; }
.card-visual-ccv-box { margin: 16px 20px 0; background: #fff; color: #111; border-radius: 4px; padding: 8px 12px; text-align: right; font-family: 'Courier New', monospace; font-size: 14px; }

.pix-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto; animation: pix-spin .8s linear infinite; }
@keyframes pix-spin { to { transform: rotate(360deg); } }

/* ---------- Indicador de progresso do checkout ---------- */
.checkout-steps { display: flex; align-items: center; justify-content: center; margin-bottom: 28px; gap: 4px; }
.checkout-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.checkout-step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--bg-muted); color: var(--text-muted); border: 2px solid var(--border);
  transition: all .2s ease;
}
.checkout-step.active .checkout-step-dot { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.checkout-step.done .checkout-step-dot { background: var(--success); color: #fff; border-color: var(--success); }
.checkout-step-label { font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.checkout-step.active .checkout-step-label { color: var(--text); }
.checkout-step-line { width: 40px; height: 2px; background: var(--border); margin: 0 2px 20px; }
.checkout-step-line.done { background: var(--success); }
@media (max-width: 480px) {
  .checkout-step-label { display: none; }
  .checkout-step-line { width: 24px; }
}

/* ---------- Toggle de forma de pagamento (segmented, estilo Stripe) ---------- */
.pay-method-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.pay-method-option {
  border: 2px solid var(--border); border-radius: var(--radius-md); padding: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; transition: all .15s ease; background: var(--bg);
}
.pay-method-option:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.pay-method-option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.pay-method-option input { accent-color: var(--accent); }
.pay-method-option svg { width: 22px; height: 22px; flex: 0 0 22px; color: var(--accent); }

/* ---------- Badge de modo demonstração ---------- */
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a; border-radius: 999px; padding: 5px 12px; margin-bottom: 12px;
}

.pix-qr-wrap { width: 220px; height: 220px; margin: 16px auto; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); }
.pix-qr-wrap svg { width: 100%; height: 100%; display: block; }

@keyframes pop-in { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pop-in { animation: pop-in .3s ease; }
.success-check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; animation: pop-in .35s ease;
}

/* ---------- Painel admin "estilo banco" (denso, analítico) ---------- */
.admin-filters {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.admin-filters select, .admin-filters input[type=date] {
  width: auto; padding: 8px 12px; font-size: 13px; border-radius: 8px;
}
.admin-filters .btn-sm { padding: 7px 14px; font-size: 13px; }
.admin-filters form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-pills {
  display: flex; gap: 2px; background: var(--bg-muted); padding: 3px; border-radius: 999px;
  overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
}
.period-pills::-webkit-scrollbar { display: none; }
.period-pill { padding: 6px 13px; font-size: 12px; font-weight: 700; border-radius: 999px; color: var(--text-muted); white-space: nowrap; }
.period-pill.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.admin-filters-sep { width: 1px; height: 22px; background: var(--border); }

.kpi-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.stat-cell { background: var(--bg); padding: 16px 18px; border-left: 3px solid transparent; }
.stat-cell .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat-cell .stat-value-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.stat-cell .stat-value { font-size: 22px; font-weight: 800; }
.stat-cell--accent { border-left-color: var(--accent); }
.stat-cell--success { border-left-color: var(--success); }
.stat-cell--muted { border-left-color: var(--border); }

.kpi-delta { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.kpi-delta-up { background: #f0fdf4; color: #166534; }
.kpi-delta-down { background: #fef2f2; color: #991b1b; }
.kpi-delta-flat { background: var(--bg-muted); color: var(--text-muted); }
.kpi-delta-new { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); color: var(--accent); }

.insight-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .insight-grid { grid-template-columns: 1fr 1fr; } }
.insight-grid .card { margin-top: 0 !important; }

.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { border-radius: 50%; position: relative; flex-shrink: 0; }
.donut-hole { position: absolute; inset: 20%; background: var(--bg); border-radius: 50%; }
.donut-legend { flex: 1; min-width: 140px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--bg-muted); }
.donut-legend-row:last-child { border-bottom: none; }
.donut-legend-row strong { margin-left: auto; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.funnel-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bg-muted); }
.funnel-bar span { height: 100%; }
.funnel-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; }
.funnel-legend-item { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.funnel-legend-item strong { color: var(--text); }

.progress-ring-row { display: flex; align-items: center; gap: 16px; }
.progress-ring { position: relative; width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.progress-ring-hole { position: absolute; inset: 12%; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }

/* ---------- Layout admin (sidebar) ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--bg); border-right: 1px solid var(--border); padding: 20px 12px; flex-shrink: 0; }
.admin-sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.admin-sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 18px; }
.admin-sidebar-brand img { height: 32px; width: auto; max-width: 150px; object-fit: contain; }
.admin-sidebar-brand span { font-weight: 800; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--bg-muted); color: var(--text); }
.admin-main { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1680px; }
@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .admin-sidebar a { white-space: nowrap; }
}

/* ---------- Portaria (leitor QR em tela cheia) ---------- */
.portaria-scan { min-height: 100vh; background: #0b0f19; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.portaria-result { font-size: 24px; font-weight: 800; padding: 24px; border-radius: var(--radius-lg); margin-top: 20px; width: 100%; max-width: 420px; }
.portaria-result.ok { background: #052e1a; color: #4ade80; }
.portaria-result.fail { background: #340a0a; color: #f87171; }

/* Ficha grande exibida depois de ler o QR (item 2 do backlog) — some só
   quando a portaria aperta "Ok, próximo", nunca sozinha num timer. */
.portaria-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(11,15,25,.97);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: #fff;
}
.portaria-overlay.hidden { display: none; }
.portaria-overlay-status { font-size: 30px; font-weight: 800; padding: 18px 24px; border-radius: var(--radius-lg); width: 100%; max-width: 460px; margin-bottom: 16px; }
.portaria-overlay-status.ok { background: #052e1a; color: #4ade80; }
.portaria-overlay-status.fail { background: #340a0a; color: #f87171; }
.portaria-overlay-status small { display: block; font-size: 16px; font-weight: 600; margin-top: 6px; opacity: .9; }
.portaria-ticket-card { background: #151b2c; border-radius: var(--radius-lg); padding: 20px 24px; width: 100%; max-width: 460px; text-align: left; }
.portaria-ticket-name { font-size: 28px; font-weight: 800; margin-bottom: 4px; word-break: break-word; }
.portaria-ticket-row { font-size: 18px; margin-top: 10px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; }
.portaria-ticket-row span:first-child { color: rgba(255,255,255,.55); font-weight: 600; }
.portaria-ticket-row span:last-child { font-weight: 700; text-align: right; }
.portaria-overlay .btn-confirm { margin-top: 20px; font-size: 20px; font-weight: 800; padding: 16px 40px; border-radius: 999px; }

/* ---------- Utilitários ---------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px} .mt-32{margin-top:32px}
.mb-8{margin-bottom:8px} .mb-16{margin-bottom:16px} .mb-24{margin-bottom:24px}
.text-center { text-align: center; }
.section { padding: 40px 0; }
.hero { padding: 56px 0 32px; }
.hero h1 { font-size: 32px; }
.hero h1 .accent-dot { color: var(--accent); }
@media (min-width: 720px) { .hero h1 { font-size: 48px; } }
/* Busca + chips de categoria ficam dentro do mesmo .container dos
   eventos (1080px, padding 16px) — mesmo alinhamento de borda. */
.search-form { width: 100%; margin-top: 24px; }

/* ---------- Glow decorativo atrás do banner + hero (referência de design fornecida) ----------
   Envolve o carrossel de banners (quando existe) e o hero, pra o efeito de fundo
   cobrir os dois blocos como uma coisa só, não só o hero isolado. */
.home-glow-wrap { position: relative; overflow: hidden; }
.hero-glow {
  position: absolute; z-index: 0; border-radius: 50%; pointer-events: none;
  filter: blur(60px); opacity: .55;
}
.hero-glow-a { top: -160px; left: -120px; width: 620px; height: 620px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent) 0%, transparent 70%); }
.hero-glow-b { top: -80px; right: -160px; width: 520px; height: 520px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 28%, transparent) 0%, transparent 72%); }
.hero > .container, .banner-carousel-wrap { position: relative; z-index: 1; }
@media (max-width: 720px) { .hero-glow-a, .hero-glow-b { opacity: .4; } }

/* ---------- Barra de busca em pílula (referência de design fornecida) ---------- */
.search-bar-pill {
  display: flex; align-items: stretch; gap: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow-modal); padding: 6px;
}
.search-segment { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 18px; min-width: 0; }
.search-segment-icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--text-muted); }
.search-segment-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-segment-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 1px; }
.search-segment input, .search-segment select {
  border: none !important; padding: 0 !important; font-size: 14px; color: var(--text-muted);
  background: transparent !important; width: 100%; border-radius: 0 !important;
}
.search-segment input:focus, .search-segment select:focus { outline: none; }
.search-segment input::placeholder { color: var(--text-muted); }
.search-divider { width: 1px; background: var(--border); margin: 6px 0; flex: 0 0 1px; }
.search-bar-submit { flex: 0 0 auto; border-radius: 999px; padding: 0 26px; white-space: nowrap; }
.search-bar-submit svg { width: 18px; height: 18px; }
@media (max-width: 860px) {
  .search-bar-pill { flex-direction: column; border-radius: var(--radius-lg); align-items: stretch; padding: 8px; }
  .search-divider { display: none; }
  .search-segment { padding: 12px 10px; border-bottom: 1px solid var(--border); }
  .search-bar-submit { margin-top: 6px; width: 100%; padding: 14px; justify-content: center; }
}

/* ---------- Menu do avatar (topbar, comprador logado) ---------- */
.avatar-menu { position: relative; }
.avatar-trigger { display: flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; border-radius: 999px; font-family: var(--font); }
.avatar-trigger:hover { background: var(--bg-muted); }
.avatar-circle {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: color-mix(in srgb, var(--accent) 15%, var(--bg)); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}
.avatar-chevron { width: 16px; height: 16px; color: var(--text-muted); }
.avatar-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 50;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal); padding: 6px; display: none;
}
.avatar-dropdown.open { display: block; }
.avatar-dropdown a, .avatar-dropdown button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text);
  background: none; border: none; cursor: pointer; font-family: var(--font);
}
.avatar-dropdown a:hover, .avatar-dropdown button:hover { background: var(--bg-muted); }
.avatar-dropdown svg { width: 16px; height: 16px; color: var(--text-muted); }

/* ---------- Carrossel de banners (cartão flutuante, estilo Sympla) ---------- */
.banner-carousel-wrap { padding-top: 20px; }
.banner-carousel { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-muted); box-shadow: var(--shadow-card); }
.banner-track { display: flex; }
.banner-slide { flex: 0 0 100%; display: none; position: relative; aspect-ratio: 16/9; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-caption { position: absolute; left: 16px; bottom: 16px; background: rgba(17,24,39,.65); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; }
.banner-dot { width: 8px; height: 8px; border-radius: 999px; border: none; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; }
.banner-dot.active { background: #fff; }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 40px; height: 40px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255,255,255,.9); color: var(--text); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.banner-arrow svg { width: 20px; height: 20px; }
.banner-arrow-prev { left: 12px; }
.banner-arrow-next { right: 12px; }
@media (min-width: 640px) { .banner-slide { aspect-ratio: 32/9; } }
@media (max-width: 640px) {
  .banner-arrow { display: none; }
  /* No mobile o cartão do carrossel ficava colado nas bordas da tela —
     mesmo respiro lateral dos outros blocos (.container já dá 16px; aqui
     reforçamos pra garantir, já que o cartão tem sombra/borda arredondada
     que acentua a proximidade da borda). */
  .banner-carousel-wrap { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Busca com filtros ---------- */
.search-form select, .search-form input[type=date] { flex: 1; }

/* ---------- Chips de categoria em pílula horizontal (referência de design fornecida) ---------- */
.category-chips { display: flex; align-items: center; justify-content: center; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; margin-top: 16px; -ms-overflow-style: none; scrollbar-width: none; }
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 10px 18px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap;
}
.category-chip svg { width: 18px; height: 18px; }
.category-chip.active { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); color: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ---------- Fileiras horizontais de eventos por categoria (estilo Sympla) ---------- */
.category-row-section { padding-top: 24px; padding-bottom: 0; }
.event-scroll-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -ms-overflow-style: none; scrollbar-width: none; }
.event-scroll-row::-webkit-scrollbar { display: none; }
.event-scroll-row .event-card { flex: 0 0 240px; scroll-snap-align: start; }
@media (max-width: 640px) {
  /* Mesmo ajuste do carrossel de banners: dá um respiro extra pro primeiro/
     último card da fileira horizontal não ficar colado na borda da tela. */
  .category-row-section { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Preço "a partir de" no card do evento ---------- */
.event-card-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.event-card-price { font-weight: 700; font-size: 15px; }
.event-card-price-row svg { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Links com ícone no topo (Meus ingressos / Minhas compras) ---------- */
.topbar-icon-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); padding: 8px 10px; border-radius: 999px; }
.topbar-icon-link:hover { background: var(--bg-muted); }
.topbar-icon-link svg { width: 18px; height: 18px; }
@media (max-width: 720px) { .topbar-icon-link span { display: none; } }

/* ---------- Navbar mobile (ícones em linha fina) ---------- */
.navbar-mobile { display: none; }
@media (max-width: 720px) {
  .navbar-mobile {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; background: var(--bg); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .navbar-mobile a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--text-muted); font-size: 11px; font-weight: 600; }
  .navbar-mobile svg { width: 22px; height: 22px; }
  body { padding-bottom: 64px; }
  /* A barra de "comprar ingresso" (sticky-cta, na página do evento) senão
     fica escondida atrás da navbar mobile fixa — sobe ela pra ficar
     encostada em cima da navbar em vez de atrás dela. */
  .sticky-cta { bottom: 64px; z-index: 39; }
}

/* deploy40-responsive: respiro lateral nas telas estreitas (login/cadastro) */
.container-narrow { box-sizing: border-box; padding-left: 16px; padding-right: 16px; }
.container-narrow > h1 { margin-top: 0; margin-bottom: 16px; }
@media (max-width: 480px) {
  .container-narrow.section { padding-top: 24px; padding-bottom: 32px; }
  .container-narrow .card { padding: 20px 16px; }
  .sheet { padding-left: 16px; padding-right: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* deploy49: banner picture */
.banner-slide picture { display: block; width: 100%; height: 100%; }

/* ===== deploy57: tema escuro + busca em modal + hero/rodapé centralizados ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17171c;
  --bg-muted: #0e0e11;
  --border: #2a2a32;
  --text: #f5f2ec;
  --text-muted: #a1a1ac;
  --shadow-card: 0 1px 2px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
  --shadow-modal: 0 -8px 30px rgba(0,0,0,.55);
}
html[data-theme="dark"] .topbar { background: rgba(14,14,17,.92); backdrop-filter: blur(8px); }
html[data-theme="dark"] .event-card-cover { background: linear-gradient(135deg, #1d1d24, #15151a); }
html[data-theme="dark"] .event-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.55); }
html[data-theme="dark"] .banner-carousel { background: var(--bg); }
html[data-theme="dark"] .hero-glow { opacity: .35; }
html[data-theme="dark"] .alert-error { background: #3b1414; color: #fecaca; border-color: #7f1d1d; }
html[data-theme="dark"] .alert-success { background: #0f2e1c; color: #bbf7d0; border-color: #166534; }
html[data-theme="dark"] .demo-badge { background: #3a2e0b; color: #fde68a; border-color: #6b5310; }
html[data-theme="dark"] #reservation-timer { background: #3a2412 !important; border-color: #9a5b1f !important; color: #fdba74 !important; }

/* hero centralizado (home) */
.hero { padding: 44px 0 16px; }
.hero-title { text-align: center; }
.hero-sub { text-align: center; margin: 0 auto 8px; max-width: 560px; font-size: 18px; }

/* título de seção com barra de cor (cor por seção via --section-accent) */
.section-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.section-title::before { content: ''; width: 22px; height: 4px; border-radius: 2px; background: var(--section-accent, var(--accent)); flex: 0 0 auto; }

/* rodapé centralizado */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; text-align: center; }
.site-footer p { margin: 0 0 4px; color: var(--text-muted); }
.site-footer-copy { font-size: 13px; }
.site-footer-made { font-size: 11px; opacity: .8; }
.site-footer-made a { color: inherit; text-decoration: underline; }

/* botão de busca no topo */
button.topbar-icon-link { background: none; border: 0; cursor: pointer; font-family: var(--font); color: var(--text); }

/* busca em modal */
html.sm-lock { overflow: hidden; }
.search-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 72px 16px 16px; background: rgba(8,8,12,.6); backdrop-filter: blur(4px); }
.search-modal.open { display: flex; }
.search-modal-panel { width: 100%; max-width: 720px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); overflow: hidden; animation: sheet-up .18s ease-out; }
.sm-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sm-head > svg { width: 20px; height: 20px; color: var(--text-muted); flex: 0 0 auto; }
.sm-head input { flex: 1; min-width: 0; border: none !important; outline: none !important; background: transparent !important; padding: 6px 0 !important; font-size: 18px; color: var(--text); }
.sm-head input::-webkit-search-cancel-button, .sm-head input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.sm-close { width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--bg-muted); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sm-close svg { width: 18px; height: 18px; }
.sm-filters { padding: 12px 18px 4px; display: flex; flex-direction: column; gap: 10px; }
.sm-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.sm-chips::-webkit-scrollbar { display: none; }
.sm-chip { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 600 13px var(--font); cursor: pointer; }
.sm-chip.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.sm-results { overflow-y: auto; padding: 8px 10px 14px; flex: 1; min-height: 120px; }
.sm-item { display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: var(--radius-sm); }
.sm-item:hover { background: var(--bg-muted); }
.sm-thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--bg-muted); flex: 0 0 auto; }
.sm-body { min-width: 0; }
.sm-title { font-weight: 700; font-size: 15px; }
.sm-meta { font-size: 12.5px; color: var(--text-muted); }
.sm-price { margin-left: auto; font-size: 13px; font-weight: 700; white-space: nowrap; padding-left: 8px; }
.sm-empty { padding: 28px 12px; text-align: center; color: var(--text-muted); }
.sm-foot { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.sm-foot a { font-weight: 700; color: var(--accent); }
@media (max-width: 640px) {
  .search-modal { padding: 0; }
  .search-modal-panel { max-width: none; height: 100%; max-height: none; border-radius: 0; border: none; }
  .sm-price { display: none; }
}

/* ===== deploy58: secoes da home (banner, carrossel de cards, destaque com ingresso) ===== */
.home-banner { padding-top: 24px; }
.home-banner-link { display: block; position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); background: var(--bg); }
.home-banner-link img { width: 100%; height: auto; display: block; aspect-ratio: 32/9; object-fit: cover; }
@media (max-width: 639px) { .home-banner { padding-left: 20px; padding-right: 20px; } .home-banner-link img { aspect-ratio: auto; } }

/* carrossel de cards (rolagem horizontal com setas) */
.cc-wrap { position: relative; }
.cc-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px 10px; }
.cc-row::-webkit-scrollbar { display: none; }
.cc-row .event-card { flex: 0 0 min(300px, 78vw); scroll-snap-align: start; }
.fc-arrow { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-card); }
.fc-arrow svg { width: 20px; height: 20px; }
.cc-arrow { position: absolute; top: 40%; z-index: 3; }
.cc-prev { left: -14px; } .cc-next { right: -14px; }
@media (max-width: 640px) { .cc-arrow { display: none; } }

/* destaque: capa grande + cartão de ingresso */
.fc { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--border); }
.fc-track { display: flex; transition: transform .55s ease; }
.fc-slide { flex: 0 0 100%; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .fc-slide { grid-template-columns: 1fr 340px; } }
.fc-cover { display: block; background: var(--bg-muted); min-height: 220px; aspect-ratio: 16/9; overflow: hidden; }
@media (min-width: 900px) { .fc-cover { aspect-ratio: auto; min-height: 340px; } }
.fc-cover img { width: 100%; height: 100%; object-fit: cover; }
.fc-ticket { background: #f5f2ec; color: #111; padding: 22px 24px; display: flex; flex-direction: column; position: relative; }
.fc-ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fc-eyebrow { font: 700 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .14em; text-transform: uppercase; color: #3b3b3b; }
.fc-barcode { width: 64px; height: 22px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px); opacity: .85; }
.fc-date { display: flex; align-items: flex-end; gap: 10px; margin: 18px 0 10px; }
.fc-day { font-size: 64px; line-height: .9; font-weight: 800; letter-spacing: -.04em; }
.fc-mon { font-size: 22px; font-weight: 800; line-height: 1; display: flex; flex-direction: column; gap: 4px; }
.fc-mon small { font: 700 10px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: #555; }
.fc-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 8px; }
.fc-loc { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #444; }
.fc-loc svg { width: 15px; height: 15px; flex: 0 0 auto; }
.fc-perf { border-top: 2px dashed rgba(0,0,0,.25); margin: 18px -24px 16px; position: relative; }
.fc-perf::before, .fc-perf::after { content: ''; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); }
.fc-perf::before { left: -8px; } .fc-perf::after { right: -8px; }
.fc-price { font-size: 13px; color: #444; margin-bottom: 8px; }
.fc-price strong { color: #111; font-size: 15px; }
.fc-btn { margin-top: auto; background: var(--section-accent, var(--accent)); color: #fff; border-radius: 12px; font-size: 15px; padding: 14px 16px; }
.fc-controls { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.fc-dots { display: flex; gap: 8px; }
.fc-dot { width: 26px; height: 4px; border-radius: 2px; border: 0; padding: 0; cursor: pointer; background: var(--border); }
.fc-dot.active { background: var(--section-accent, var(--accent)); }
.fc-arrows { display: flex; gap: 8px; }
.fc-arrows .fc-arrow { width: 36px; height: 36px; box-shadow: none; }
/* efeito esmaecer: slides empilhados, só o ativo aparece */
.fc[data-effect="fade"] .fc-track { display: grid; transition: none; }
.fc[data-effect="fade"] .fc-slide { grid-area: 1 / 1; opacity: 0; pointer-events: none; transition: opacity .7s ease; }
.fc[data-effect="fade"] .fc-slide.active { opacity: 1; pointer-events: auto; }
