/* ============================================================
   IngressoMax — Estilo global (mobile-first, paleta roxa)
   ============================================================ */

:root {
  --purple-900: #2e1065;
  --purple-800: #3b0764;
  --purple-700: #4c1d95;
  --purple-600: #5b21b6;
  --purple-500: #7c3aed;
  --purple-400: #a855f7;
  --purple-300: #c4b5fd;
  --pink-500: #d946ef;
  --gray-50: #faf9fc;
  --gray-100: #f4f2f8;
  --gray-200: #e9e4f2;
  --gray-400: #9b94ae;
  --gray-500: #7a7290;
  --gray-700: #4a4260;
  --gray-900: #1e1630;
  --brand-gradient: linear-gradient(135deg, #4c1d95 0%, #7c3aed 45%, #a855f7 75%, #d946ef 100%);
  --brand-gradient-dark: linear-gradient(135deg, #1e0a3c 0%, #3b0764 40%, #5b21b6 75%, #7c3aed 100%);
  --radius: 0.9rem;
  --shadow-sm: 0 1px 3px rgba(46, 16, 101, 0.08);
  --shadow-md: 0 6px 20px rgba(91, 33, 182, 0.12);
  --shadow-lg: 0 14px 34px rgba(91, 33, 182, 0.18);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--purple-600); text-decoration: none; }
a:hover { color: var(--purple-800); }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1rem; }

main { flex: 1; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border: none; border-radius: 2rem;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
  text-decoration: none; line-height: 1.2;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { box-shadow: var(--shadow-lg); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--purple-500); color: var(--purple-600); }
.btn-outline:hover { background: var(--purple-500); color: #fff; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); color: var(--gray-900); }

/* ---------- Header ---------- */
.site-header {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 0; flex-wrap: wrap; }

.logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.35rem; font-weight: 800; color: var(--gray-900);
  text-decoration: none; white-space: nowrap;
}
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.1rem; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}
.logo span { background: linear-gradient(90deg, var(--purple-500), var(--pink-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.header-search { flex: 1 1 220px; order: 3; max-width: 480px; }
.search-box {
  display: flex; align-items: center; background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: 2rem; overflow: hidden;
}
.search-box input {
  flex: 1; border: none; background: transparent; padding: 0.6rem 1rem;
  font-size: 0.95rem; outline: none; font-family: var(--font);
}
.search-box button {
  border: none; background: transparent; padding: 0.6rem 0.9rem;
  color: var(--purple-500); cursor: pointer;
}

.header-nav { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.8rem; border-radius: 2rem; color: var(--gray-700);
  font-weight: 500; font-size: 0.92rem; white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.nav-link:hover { background: var(--gray-100); color: var(--purple-600); }
.nav-link .badge {
  background: var(--purple-500); color: #fff; font-size: 0.72rem;
  border-radius: 10px; padding: 0.1rem 0.45rem; font-weight: 700;
}

.menu-toggle { display: none; background: none; border: none; color: var(--purple-600); cursor: pointer; }

/* ---------- Hero / Banner carrossel ---------- */
.hero { position: relative; background: var(--gray-900); overflow: hidden; }
.carousel { position: relative; min-height: 420px; }
.carousel-track { display: flex; transition: transform 0.5s var(--ease); }
.carousel-slide { min-width: 100%; position: relative; }
.carousel-slide img { width: 100%; height: 420px; object-fit: cover; opacity: 0.85; }
.slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 6, 40, 0.85) 0%, rgba(20, 6, 40, 0.15) 55%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem;
}
.slide-overlay .tag {
  display: inline-block; background: var(--brand-gradient); color: #fff;
  padding: 0.25rem 0.9rem; border-radius: 2rem; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.6rem;
  align-self: flex-start;
}
.slide-overlay h2 { color: #fff; font-size: 2rem; margin-bottom: 0.8rem; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.9); color: var(--purple-700);
  font-size: 1.2rem; cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }
.carousel-dots {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.5rem; z-index: 2;
}
.carousel-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.45); cursor: pointer; padding: 0;
}
.carousel-dots button.active { background: #fff; width: 26px; border-radius: 5px; }

/* ---------- Categorias ---------- */
.section { padding: 3rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.section-head h2 { font-size: 1.5rem; display: flex; align-items: center; gap: 0.6rem; }
.section-head h2::before {
  content: ""; width: 12px; height: 24px; border-radius: 4px; background: var(--brand-gradient);
}
.section-head a { font-weight: 600; font-size: 0.95rem; }

.categories-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem;
}
.category-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 1.2rem 0.6rem; text-align: center; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.category-card .icon { font-size: 1.6rem; color: var(--purple-500); margin-bottom: 0.4rem; }
.category-card .name { font-weight: 600; font-size: 0.85rem; color: var(--gray-900); }

/* ---------- Cards de evento ---------- */
.events-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.event-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--gray-200); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.event-card .cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--gray-200); }
.event-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s var(--ease); }
.event-card:hover .cover img { transform: scale(1.05); }
.event-card .date-chip {
  position: absolute; top: 0.7rem; left: 0.7rem;
  background: var(--purple-600); color: #fff; font-weight: 700; font-size: 0.8rem;
  padding: 0.25rem 0.7rem; border-radius: 2rem;
}
.event-card .body { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.event-card h3 { font-size: 1.02rem; margin-bottom: 0.45rem; }
.event-card .meta { font-size: 0.82rem; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.7rem; }
.event-card .price-row { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; }
.event-card .price { font-weight: 800; color: var(--purple-600); font-size: 1.05rem; white-space: nowrap; }
.event-card .price small { font-weight: 500; color: var(--gray-500); font-size: 0.75rem; }

.event-list-item {
  display: flex; gap: 1rem; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 0.8rem; transition: box-shadow 0.2s var(--ease);
}
.event-list-item:hover { box-shadow: var(--shadow-md); }
.event-list-item img { width: 110px; height: 84px; border-radius: 0.6rem; object-fit: cover; flex-shrink: 0; }
.event-list-item .info { flex: 1; min-width: 0; }
.event-list-item h3 { font-size: 0.98rem; margin-bottom: 0.3rem; }
.event-list-item .meta { font-size: 0.8rem; color: var(--gray-500); }

/* ---------- Filtros ---------- */
.filters-bar {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
  padding: 1.2rem; display: grid; grid-template-columns: 1fr; gap: 0.8rem; margin-bottom: 1.5rem;
}
.filter-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-500); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-group select, .filter-group input {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--gray-200); border-radius: 0.7rem;
  font-family: var(--font); font-size: 0.95rem; background: #fff; color: var(--gray-900); outline: none;
}
.filter-group select:focus, .filter-group input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15); }

/* ---------- Páginas de formulários (login/registro) ---------- */
.auth-page { padding: 2.5rem 0; display: flex; justify-content: center; }
.auth-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 1.2rem;
  padding: 2rem; max-width: 420px; width: 100%; box-shadow: var(--shadow-md);
}
.auth-card .logo-block { text-align: center; margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.4rem; margin: 0.8rem 0 0.3rem; }
.auth-card p.sub { color: var(--gray-500); font-size: 0.9rem; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.field input, .field select, .field textarea {
  padding: 0.7rem 0.9rem; border: 1px solid var(--gray-200); border-radius: 0.7rem;
  font-family: var(--font); font-size: 0.95rem; background: #fff; outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.input-hint { font-size: 0.8rem; color: var(--gray-500); }

/* ---------- Alertas / Flash ---------- */
.alert { padding: 0.85rem 1.1rem; border-radius: 0.7rem; font-size: 0.9rem; margin-bottom: 1rem; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6; }

/* ---------- Carrinho / checkout / detalhes ---------- */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.2rem; }
.page-hero {
  background: var(--brand-gradient-dark); color: #fff; padding: 2.2rem 0 2rem;
}
.page-hero h1 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.breadcrumb { font-size: 0.82rem; color: var(--purple-300); margin-bottom: 0.8rem; }
.breadcrumb a { color: var(--purple-300); }

.detail-grid { display: grid; gap: 1.5rem; }
.detail-cover img { border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.info-list { display: grid; gap: 0.6rem; margin: 1rem 0; }
.info-row { display: flex; gap: 0.7rem; font-size: 0.95rem; }
.info-row .ico { color: var(--purple-500); width: 1.4rem; text-align: center; flex-shrink: 0; }
.info-row strong { font-weight: 600; }
.description { color: var(--gray-700); font-size: 0.95rem; }

.ticket-option {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid var(--gray-200); border-radius: 0.8rem; padding: 0.9rem 1rem; margin-bottom: 0.7rem;
}
.ticket-option .t-name { font-weight: 600; font-size: 0.95rem; }
.ticket-option .t-sector { font-size: 0.8rem; color: var(--gray-500); }
.qty-control { display: flex; align-items: center; gap: 0.3rem; }
.qty-control button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gray-200);
  background: #fff; color: var(--purple-600); font-size: 1rem; cursor: pointer; font-weight: 700;
}
.qty-control button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-control input {
  width: 44px; text-align: center; border: 1px solid var(--gray-200); border-radius: 0.5rem;
  padding: 0.3rem; font-family: var(--font); font-size: 0.95rem;
}

.summary-card { position: sticky; top: 6rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.45rem 0; font-size: 0.95rem; border-bottom: 1px dashed var(--gray-200); }
.summary-total { display: flex; justify-content: space-between; padding: 0.8rem 0 0; font-size: 1.15rem; font-weight: 800; color: var(--purple-700); }

/* ---------- Checkout: métodos de pagamento ---------- */
.payment-methods { display: grid; gap: 0.7rem; }
.pm-option {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1rem;
  border: 2px solid var(--gray-200); border-radius: 0.8rem; cursor: pointer; transition: border-color 0.15s var(--ease);
}
.pm-option input { accent-color: var(--purple-600); width: 1.1rem; height: 1.1rem; }
.pm-option.selected { border-color: var(--purple-500); background: #f5f3ff; }
.pm-option .pm-name { font-weight: 600; }
.pm-option .pm-desc { font-size: 0.8rem; color: var(--gray-500); }

/* ---------- Minha conta / tabs ---------- */
.account-tabs { display: flex; gap: 0.4rem; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; overflow-x: auto; }
.account-tab {
  padding: 0.7rem 1rem; border: none; background: none; cursor: pointer;
  font-family: var(--font); font-weight: 600; color: var(--gray-500); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.account-tab.active { color: var(--purple-600); border-bottom-color: var(--purple-500); }

.ticket-pass {
  background: linear-gradient(135deg, #3b0764 0%, #7c3aed 60%, #a855f7 100%);
  color: #fff; border-radius: 1rem; padding: 1.2rem; margin-bottom: 1rem;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.ticket-pass::after {
  content: ""; position: absolute; right: -20px; top: 50%; width: 40px; height: 40px;
  background: var(--gray-50); border-radius: 50%; transform: translateY(-50%);
}
.ticket-pass .tp-name { font-size: 0.8rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.06em; }
.ticket-pass .tp-event { font-size: 1.15rem; font-weight: 700; margin: 0.3rem 0; padding-right: 1.5rem; }
.ticket-pass .tp-meta { font-size: 0.85rem; opacity: 0.9; }
.ticket-pass .qr { margin: 0.8rem auto 0; background: #fff; border-radius: 0.6rem; padding: 0.5rem; width: fit-content; }
.ticket-pass .qr img { width: 110px; height: 110px; }
.ticket-pass .tp-code { text-align: center; font-weight: 700; letter-spacing: 0.12em; margin-top: 0.5rem; font-size: 0.95rem; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border-radius: 0.8rem; border: 1px solid var(--gray-200); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--gray-100); color: var(--gray-700); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.7rem 0.9rem; text-align: left; }
td { padding: 0.75rem 0.9rem; border-top: 1px solid var(--gray-200); }
tbody tr:hover { background: var(--gray-50); }
.status-pill { display: inline-block; padding: 0.15rem 0.65rem; border-radius: 2rem; font-size: 0.75rem; font-weight: 700; }
.status-approved { background: #ecfdf5; color: #065f46; }
.status-pending { background: #fffbeb; color: #92400e; }
.status-cancelled { background: #fef2f2; color: #991b1b; }

.actions-cell { white-space: nowrap; display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-gradient-dark); color: #ddd6fe; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.8rem; padding: 2.5rem 0 1.5rem; }
.footer-brand .logo { color: #fff; margin-bottom: 0.7rem; }
.footer-brand p { font-size: 0.9rem; opacity: 0.85; max-width: 300px; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; display: grid; gap: 0.55rem; }
.footer-col a { color: #ddd6fe; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.1rem 0; font-size: 0.82rem; opacity: 0.75; text-align: center; }
.social-links { display: flex; gap: 0.9rem; margin-top: 0.7rem; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.1); color: #fff; font-size: 0.9rem; }
.social-links a:hover { background: var(--purple-500); color: #fff; }

/* ---------- Admin ---------- */
.admin-layout { display: grid; gap: 1.2rem; }
.admin-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.2rem; }
.admin-card h2 { font-size: 1.15rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.mini-thumb { width: 56px; height: 40px; border-radius: 0.4rem; object-fit: cover; background: var(--gray-200); }
.file-input-wrap { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(30, 6, 60, 0.6); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 1rem; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 1.5rem; position: relative;
}
.modal h2 { margin-bottom: 1rem; font-size: 1.2rem; }
.modal-close {
  position: absolute; top: 0.8rem; right: 0.8rem; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--gray-100); color: var(--gray-700); cursor: pointer; font-size: 1rem;
}

/* ---------- Confirmação de pagamento ---------- */
.success-box { text-align: center; padding: 2rem 1rem; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%; background: #ecfdf5;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem;
  color: #059669; font-size: 1.8rem;
}
.code-display { font-family: ui-monospace, "Cascadia Code", monospace; font-weight: 700; letter-spacing: 0.08em; color: var(--purple-700); background: var(--gray-100); padding: 0.5rem 1rem; border-radius: 0.6rem; display: inline-block; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-nav { order: 4; width: 100%; justify-content: center; }
  .nav-link { font-size: 0.82rem; padding: 0.45rem 0.6rem; }
  .carousel, .carousel-slide img { min-height: 260px; height: 260px; }
  .slide-overlay h2 { font-size: 1.4rem; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .events-grid { grid-template-columns: 1fr; }
  .section { padding: 2rem 0; }
  .carousel-btn { width: 36px; height: 36px; }
}

@media (min-width: 641px) {
  .filters-bar { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
  .form-grid.two { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .detail-grid { grid-template-columns: 1.6fr 1fr; align-items: start; }
  .categories-grid { grid-template-columns: repeat(6, 1fr); }
  .menu-toggle { display: none; }
}

@media (min-width: 1024px) {
  .events-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Utilitários */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
