/* =========================================================
   TDPN Ingressos — identidade visual (clara, estilo app)
   Cores tiradas do banner: vermelho natalino, dourado, quase-preto.
   ========================================================= */
:root {
    --brand: #d3121b;          /* vermelho do banner */
    --brand-dark: #a10d14;
    --brand-soft: #fde8e7;
    --gold: #f2b705;           /* dourado "Lençóis Paulista" */
    --gold-soft: #fff6d6;
    --ink: #1c1414;            /* texto principal */
    --ink-soft: #6b5b58;       /* texto secundário */
    --night: #120503;          /* fundo escuro do banner */
    --bg: #faf6f5;             /* fundo claro levemente quente */
    --card: #ffffff;
    --line: #efe3e1;
    --success: #12805c;
    --radius: 18px;
    --shadow: 0 6px 24px rgba(60, 10, 10, .08);
    --bottom-nav-h: 64px;

    --bs-primary: var(--brand);
    --bs-primary-rgb: 211, 18, 27;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-color-rgb: 211, 18, 27;
    --bs-link-hover-color-rgb: 161, 13, 20;
    --bs-border-radius: 12px;
}

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 16px);
}

a { text-decoration: none; }

/* ---------- Barra superior ---------- */
.app-topbar {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.app-topbar .inner {
    max-width: 960px; margin: 0 auto; height: 56px;
    display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
}
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 900; letter-spacing: .5px; font-size: 1.15rem; }
.app-brand img { width: 34px; height: 34px; border-radius: 10px; }
.app-brand span em { color: var(--brand); font-style: normal; }
.topbar-links { display: none; gap: 4px; align-items: center; }
.topbar-links a, .topbar-links button {
    color: var(--ink); font-weight: 600; padding: 8px 12px; border-radius: 10px; border: 0; background: none; font-size: .95rem;
}
.topbar-links a:hover, .topbar-links button:hover { background: var(--brand-soft); color: var(--brand); }
.topbar-links a.top-cta { background: var(--brand); color: #fff; }
.topbar-links a.top-cta:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Barra inferior (estilo app) ---------- */
.app-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line);
    display: flex; justify-content: space-around; align-items: stretch;
    box-shadow: 0 -4px 20px rgba(60, 10, 10, .06);
}
.app-bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--ink-soft); font-size: .72rem; font-weight: 600;
}
.app-bottom-nav a svg { width: 24px; height: 24px; }
.app-bottom-nav a.active { color: var(--brand); }

@media (min-width: 768px) {
    .topbar-links { display: flex; }
    .app-bottom-nav { display: none; }
    body { padding-bottom: 32px; }
}

.app-main { max-width: 960px; margin: 0 auto; padding: 16px; }
.app-narrow { max-width: 480px; margin: 0 auto; }

/* ---------- Cartões ---------- */
.card-app {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
}
.card-app + .card-app { margin-top: 14px; }
.section-title { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 24px 4px 10px; }

/* ---------- Página do evento ---------- */
.event-hero {
    position: relative; margin: -16px -16px 0; background: var(--night);
    display: flex; justify-content: center; overflow: hidden;
}
.event-hero img { width: 100%; max-width: 560px; height: auto; display: block; }
@media (min-width: 768px) {
    .event-hero { margin: 0; border-radius: 24px; }
    .event-hero::before {
        content: ""; position: absolute; inset: 0; background: var(--hero-bg) center/cover; filter: blur(40px) brightness(.55); transform: scale(1.2);
    }
    .event-hero img { position: relative; max-height: 640px; width: auto; }
}

.event-header { margin-top: -28px; position: relative; z-index: 2; }
@media (min-width: 768px) { .event-header { margin-top: 16px; } }
.event-header .card-app { padding: 22px 20px; }
.event-name { font-size: 2rem; font-weight: 900; letter-spacing: .02em; line-height: 1; margin: 0; }
.event-tagline { color: var(--brand); font-weight: 800; font-size: .95rem; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }

.badge-18 {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 30px; padding: 0 10px; border-radius: 999px;
    background: var(--night); color: #fff; font-weight: 900; font-size: .85rem;
}

.info-row { display: flex; gap: 14px; align-items: flex-start; }
.info-row + .info-row { margin-top: 16px; }
.info-icon {
    flex: 0 0 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand);
}
.info-icon svg { width: 22px; height: 22px; }
.info-label { font-size: .75rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.info-value { font-weight: 700; font-size: 1.02rem; }
.info-sub { color: var(--ink-soft); font-size: .9rem; }

.map-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-map {
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px;
    font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap;
}
.btn-map:hover { border-color: var(--brand); color: var(--brand); }
.btn-map svg { width: 20px; height: 20px; }

.event-description { white-space: pre-line; color: var(--ink); line-height: 1.6; }

/* ---------- Lotes ---------- */
.lot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff;
}
.lot + .lot { margin-top: 10px; }
.lot-name { font-weight: 800; }
.lot-status { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.lot-price { font-weight: 900; font-size: 1.2rem; white-space: nowrap; }
.lot.current { border: 2px solid var(--brand); background: linear-gradient(0deg, #fff, #fff), var(--brand-soft); box-shadow: 0 4px 18px rgba(211, 18, 27, .12); }
.lot.current .lot-status { color: var(--brand); }
.lot.soldout { opacity: .55; }
.lot.soldout .lot-price { text-decoration: line-through; }
.pill { display: inline-block; font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.pill-brand { background: var(--brand); color: #fff; }
.pill-gold { background: var(--gold); color: var(--night); }
.pill-muted { background: #eee; color: #777; }

/* ---------- Botões ---------- */
.btn { font-weight: 700; border-radius: 14px; padding: 12px 18px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-lg { padding: 15px 22px; font-size: 1.08rem; }

/* CTA fixo acima da barra inferior no celular */
.buy-bar {
    position: fixed; left: 0; right: 0; z-index: 1029;
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    padding: 10px 16px; display: flex; align-items: center; gap: 12px;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.buy-bar .price-label { font-size: .75rem; color: var(--ink-soft); font-weight: 700; line-height: 1; }
.buy-bar .price { font-weight: 900; font-size: 1.25rem; line-height: 1.1; }
.buy-bar .btn { flex: 1; }
.has-buy-bar { padding-bottom: 90px; }
@media (min-width: 768px) {
    .buy-bar { display: none; }
    .has-buy-bar { padding-bottom: 0; }
}

/* ---------- Formulários ---------- */
.form-control, .form-select { border-radius: 12px; padding: 12px 14px; border-color: #e4d6d4; font-size: 1rem; background-color: #fff; }
.form-control:disabled { background-color: #f3eeed; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(211, 18, 27, .15); }
.form-label { font-weight: 700; font-size: .9rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-title { font-weight: 900; font-size: 1.6rem; margin: 8px 0 4px; }
.page-subtitle { color: var(--ink-soft); margin-bottom: 20px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--ink-soft); }
.field-validation-error, .text-danger { font-size: .85rem; }

/* ---------- Conta ---------- */
.empty-state { text-align: center; padding: 32px 16px; color: var(--ink-soft); }
.empty-state svg { width: 56px; height: 56px; color: var(--brand); opacity: .8; margin-bottom: 10px; }
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.order-row + .order-row { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.status { font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.status-paid { background: #e3f6ee; color: var(--success); }
.status-pending { background: var(--gold-soft); color: #8a6500; }
.status-off { background: #eee; color: #777; }
.menu-list a {
    display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; color: var(--ink); font-weight: 600;
    border-bottom: 1px solid var(--line);
}
.menu-list a:last-child { border-bottom: 0; }
.menu-list a::after { content: "›"; color: var(--ink-soft); font-size: 1.4rem; line-height: 1; }

/* ---------- Páginas legais ---------- */
.legal h2 { font-size: 1.1rem; font-weight: 800; margin-top: 24px; }
.legal p, .legal li { line-height: 1.65; color: #3b302e; }
.legal .highlight { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 8px; }

.site-footer { text-align: center; color: var(--ink-soft); font-size: .82rem; padding: 28px 16px 8px; }
.site-footer a { color: var(--ink-soft); text-decoration: underline; }

/* ---------- Painel administrativo ---------- */
.event-header.no-hero { margin-top: 0; }
.admin-wrap { max-width: 860px; margin: 0 auto; }
.admin-back { display: inline-block; color: var(--ink-soft); font-weight: 700; font-size: .9rem; margin: 4px 0 6px; }
.admin-back:hover { color: var(--brand); }
.admin-tabs {
    display: flex; gap: 6px; overflow-x: auto; margin: 14px -16px 18px; padding: 0 16px 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a {
    flex: 0 0 auto; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem;
    background: #fff; border: 1px solid var(--line); color: var(--ink);
}
.admin-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (min-width: 768px) { .admin-tabs { margin-left: 0; margin-right: 0; padding: 0; } }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat-label { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.stat-value { font-size: 1.7rem; font-weight: 900; line-height: 1.15; margin-top: 2px; }
.stat-value small { font-size: .95rem; color: var(--ink-soft); font-weight: 700; }
.stat-value.stat-text { font-size: 1.15rem; padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }

.meter { height: 8px; border-radius: 999px; background: #f1e7e5; overflow: hidden; margin-top: 8px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ef4a2f); border-radius: 999px; }

.control-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.control-row form { flex: 0 0 auto; margin: 0; }

.lot-mini + .lot-mini { margin-top: 14px; }
.lot-mini.current .fw-bold { color: var(--brand); }

.lot-admin.current { border: 2px solid var(--brand); }
.lot-admin.inactive { opacity: .6; }
.lot-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.lot-actions form { margin: 0; }
.btn-sm { padding: 7px 12px; border-radius: 10px; font-size: .85rem; }
.btn-light { background: #f6efee; border-color: #f6efee; color: var(--ink); }
.btn-light:hover { background: var(--brand-soft); color: var(--brand); }

.event-card { display: block; color: var(--ink); }
.event-card:hover { border-color: var(--brand); color: var(--ink); }

.admin-banner-preview { display: block; max-width: 180px; border-radius: 12px; border: 1px solid var(--line); }
.admin-savebar { background: linear-gradient(180deg, rgba(250,246,245,0), var(--bg) 35%); padding-top: 14px; position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 8px); margin-top: 18px; z-index: 5; }
@media (min-width: 768px) { .admin-savebar { bottom: 16px; } }
.min-w-0 { min-width: 0; }
.text-none { text-decoration: none; text-transform: none; letter-spacing: 0; }

/* ---------- Promoções ---------- */
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff; }
.choice input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; flex: 0 0 auto; }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--ink-soft); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.promo-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.promo-facts span { font-size: .78rem; font-weight: 700; background: #f6efee; color: var(--ink-soft); border-radius: 999px; padding: 3px 10px; }
.promo-facts span:empty { display: none; }
.coupon-code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: .06em; font-size: 1.05rem; }
.coupon-code.off { text-decoration: line-through; color: var(--ink-soft); }
.promo-banner { background: var(--gold); color: var(--night); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; font-size: .95rem; box-shadow: 0 4px 16px rgba(242, 183, 5, .3); }
.stepper { display: flex; align-items: center; gap: 4px; background: #f6efee; border-radius: 999px; padding: 4px; }
.stepper-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--brand); font-size: 1.4rem; font-weight: 800; line-height: 1; box-shadow: 0 1px 4px rgba(60,10,10,.1); }
.stepper-btn:disabled { color: #c9bcba; box-shadow: none; }
.stepper-value { min-width: 34px; text-align: center; font-weight: 900; font-size: 1.25rem; }
.promo-applied { margin-top: 14px; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: .92rem; }
.summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px !important; font-weight: 900; font-size: 1.2rem; }
.validation-summary-valid { display: none; }
.btn-primary:disabled, .btn-primary.disabled { background: var(--brand); border-color: var(--brand); color: #fff; opacity: .45; }
.text-uppercase::placeholder { text-transform: none; }
