:root {
  --bg: #14171d;
  --bg-deep: #101318;
  --surface: #1b1f27;
  --surface-2: #20242d;
  --text: #e8ebef;
  --muted: #a6afb9;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff6b2c;
  --accent-light: #ff8a4d;
  --white: #fff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.app-shell { min-height: 100vh; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--bg-deep);
  color: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 16px;
  padding: 14px 20px;
}
.brand-lockup { display: flex; align-items: center; gap: 11px; text-transform: uppercase; letter-spacing: .06em; }
.brand-lockup strong { display: block; font-size: 15px; font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.brand-lockup small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .17em; }
.brand-mark { display: block; height: 34px; width: auto; }
.live-status { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.live-status a { color: var(--accent-light); text-decoration: none; font-size: 11px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.pulse { display: inline-block; width: 8px; height: 8px; background: #4ade80; border-radius: 50%; margin-right: 7px; box-shadow: 0 0 0 5px #4ade8022; }

/* ---------- Hero ---------- */
.hero {
  max-width: 1240px;
  margin: auto;
  padding: 40px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.eyebrow { font-size: 10px; letter-spacing: .18em; font-weight: 800; color: var(--accent-light); margin: 0 0 14px; text-transform: uppercase; }
.hero h1 { font: 600 clamp(30px, 9vw, 64px)/1.02 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.04em; margin: 0; }
.hero h1 em { font-style: italic; color: var(--accent-light); }
.hero-copy { color: var(--muted); margin: 22px 0 0; max-width: 440px; line-height: 1.6; }
.hero-card { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 20px 24px; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.hero-card span, .hero-card small { display: block; color: var(--muted); font-size: 11px; }
.hero-card strong { display: block; margin: 8px 0; font-size: 15px; font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* ---------- Panels ---------- */
.control-panel, .moments-section { max-width: 1240px; margin: 0 auto; padding: 28px 20px; }
.control-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 18px 60px rgba(0,0,0,.45); }
.section-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { font: 600 26px 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; letter-spacing: -.03em; }
.section-heading .primary-button { width: 100%; }

/* ---------- Didactic step flow ---------- */
.step-block { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.step-block-last { padding-bottom: 4px; margin-bottom: 4px; border-bottom: 0; }
.step-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.step-badge { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,107,44,.16); border: 1px solid rgba(255,107,44,.35); color: var(--accent-light); font-size: 13px; font-weight: 800; font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.step-heading h2 { font: 600 19px 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0 0 4px; letter-spacing: -.02em; }
.step-copy { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.mode-select { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; width: 100%; }
.mode-select select { flex: 1; min-width: 140px; }
select, input[type="text"], input[type="number"], textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; min-height: 44px; }
textarea { width: 100%; resize: vertical; }

/* Mobile-first: 2-up desde a tela menor (facilita ver as câmeras de relance, sem rolar tudo),
   crescendo pra um grid de 4 no desktop (ver breakpoint "Desktop" mais abaixo). */
.camera-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.camera-card { position: relative; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(150deg, #1b1f27, #21252e); padding: 16px; min-height: 120px; text-align: left; cursor: pointer; transition: .2s; overflow: hidden; }
.camera-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 24px rgba(255,107,44,.15); }
.camera-card:active { transform: scale(.98); }
/* Com número ímpar de câmeras, a última fica sozinha na fileira — em vez de ficar torta
   ocupando só metade, estica pra fileira inteira. Reajustado pro grid de 4 no desktop. */
.camera-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.camera-number { color: var(--accent-light); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.camera-card strong { display: block; font-size: 15px; margin-top: 10px; color: var(--text); }
.camera-card small { display: block; color: var(--text); opacity: .68; font-size: 12px; line-height: 1.5; margin-top: 18px; }
.camera-card:after { content: '↗'; position: absolute; right: 15px; top: 14px; color: var(--muted); }

.camera-live { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: #0c0e12; margin-bottom: 6px; }
.camera-live-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.camera-live-img-error { opacity: .25; }
.camera-live-badge { position: absolute; left: 8px; bottom: 7px; background: rgba(220,38,38,.85); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 3px 7px; border-radius: 20px; }

.hint { color: var(--muted); font-size: 12px; }

.moments-section { padding-top: 44px; padding-bottom: 96px; }
.primary-button, .secondary-button { border: 0; border-radius: 11px; background: var(--bg-deep); color: #fff; padding: 13px 18px; font-weight: 700; cursor: pointer; }
.primary-button { background: var(--accent); box-shadow: 0 8px 18px rgba(255,107,44,.3); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.primary-button span { margin-left: 12px; }
.secondary-button { background: var(--surface-2); color: var(--text); margin-top: 14px; }

.moments-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.empty-state { grid-column: 1/-1; border: 1px dashed var(--line); border-radius: 18px; text-align: center; padding: 40px 24px; color: var(--muted); }
.empty-icon { display: block; font-size: 38px; color: var(--accent-light); margin-bottom: 12px; }
.empty-state strong { display: block; color: var(--text); }
.empty-state p { margin-bottom: 0; font-size: 13px; }

.moment-card { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; position: relative; }
.moment-thumb { width: 100%; height: 84px; border: 0; padding: 0; margin: 0; font: inherit; background: linear-gradient(135deg, #1b1f27, #2b2118); display: grid; place-items: center; color: var(--accent-light); position: relative; cursor: pointer; transition: .15s; }
.moment-thumb:hover { filter: brightness(1.2); }
.moment-thumb:active { transform: scale(.98); }
.moment-thumb:before { content: '▶'; position: absolute; right: 10px; top: 9px; font-size: 11px; color: var(--muted); }
.moment-thumb:after { content: '60s antes do clique'; position: absolute; bottom: 8px; left: 10px; background: rgba(16,19,24,.85); border-radius: 5px; padding: 3px 6px; color: var(--text); font-size: 10px; }
.thumb-icon { font-size: 24px; }
.moment-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.moment-thumb img ~ .thumb-icon { display: none; }
.moment-info { padding: 12px 14px; text-align: left; }
.moment-info strong { display: block; font-size: 13px; }
.moment-meta { color: var(--muted); font-size: 11px; margin: 5px 0 10px; }
.moment-footer { display: flex; align-items: center; justify-content: space-between; }
.tag { font-size: 10px; border-radius: 20px; background: rgba(255,107,44,.14); color: var(--accent-light); padding: 6px 8px; }
.check { width: 22px; height: 22px; accent-color: var(--accent); }
.moment-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.link-button { border: 0; background: none; color: var(--accent-light); padding: 6px 0; font-size: 12px; cursor: pointer; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--bg-deep); color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 13px 18px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); text-align: center; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sticky mobile cart bar ---------- */
.cart-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-deep);
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px 12px 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  transform: translateY(120%);
  opacity: 0;
  transition: transform .25s, opacity .25s;
}
.cart-bar.show { transform: translateY(0); opacity: 1; }
.cart-bar-info { display: flex; flex-direction: column; line-height: 1.3; }
.cart-bar-info strong { font-size: 14px; }
.cart-bar-info span { font-size: 11px; color: var(--muted); }
.cart-bar .primary-button { white-space: nowrap; }

/* ---------- Modals ---------- */
.modal { border: 0; border-radius: 22px; padding: 0; max-width: 520px; width: calc(100% - 24px); background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.6); max-height: calc(100% - 24px); }
.modal::backdrop { background: rgba(10,12,16,.8); }
.modal-content { padding: 22px; position: relative; }
.close-button { position: absolute; right: 16px; top: 12px; border: 0; background: none; font-size: 26px; color: var(--muted); cursor: pointer; }
.modal h2 { font: 600 24px 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0 26px 10px 0; }
.modal p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.preview-frame { background: #0c0e12; border-radius: 14px; height: 200px; margin: 22px 0; display: grid; place-items: center; overflow: hidden; position: relative; }
.ice-animation { display: grid; place-items: center; color: var(--accent-light); }
.ice-animation span { font-size: 42px; }
.ice-animation small { font-size: 11px; margin-top: 8px; color: var(--muted); }
#previewVideo { width: 100%; height: 100%; object-fit: contain; background: #000; }

.checkout-summary { background: var(--surface-2); border-radius: 12px; padding: 16px; margin: 18px 0; }
.checkout-summary-title { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.checkout-summary-title span { font-size: 11px; color: var(--accent-light); background: rgba(255,107,44,.14); border-radius: 20px; padding: 5px 8px; }
.checkout-items { display: grid; gap: 10px; padding: 13px 0; }
.checkout-item { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checkout-item-number { width: 24px; height: 24px; border-radius: 8px; background: rgba(255,107,44,.14); color: var(--accent-light); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.checkout-item-main strong, .checkout-item-main span { display: block; }
.checkout-item-main strong { font-size: 12px; }
.checkout-item-main span { font-size: 10px; color: var(--muted); margin-top: 3px; }
.checkout-item-price { font-size: 12px; white-space: nowrap; }
.checkout-total { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; font-size: 13px; }
.checkout-total strong { font-size: 18px; color: var(--accent-light); }
.checkout-note { font-size: 10px !important; margin: 12px 0 0 !important; }

.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.payment-option { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 11px 6px; cursor: pointer; color: var(--text); }
.payment-option.active { border-color: var(--accent); background: rgba(255,107,44,.12); }
.payment-option span { display: block; color: var(--accent-light); font-size: 20px; margin-bottom: 5px; }
/* Único método de pagamento hoje (cartão foi removido) — ocupa a fileira toda em vez de
   ficar espremido num grid pensado pra 3 opções lado a lado. */
.payment-methods:has(.payment-option:only-child) { grid-template-columns: 1fr; }
.payment-option:only-child { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 20px; font-size: 16px; }
.payment-option:only-child span { display: inline; font-size: 30px; margin-bottom: 0; }
.pix-box { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 13px; margin-bottom: 18px; }
.fake-qr, .download-qr { display: grid; place-items: center; background: var(--surface); color: var(--text); border: 6px solid var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: 58px; width: 84px; height: 84px; line-height: 1; }
.download-qr img { width: 100%; height: 100%; object-fit: contain; }
.pix-box p { font-size: 11px !important; margin: 5px 0; }
.pix-box code { font-size: 10px; color: var(--muted); word-break: break-all; }
.pix-countdown { display: flex; align-items: center; gap: 7px; font-size: 12px !important; font-weight: 700; color: var(--accent-light); margin-top: 9px !important; }
.pix-countdown-time { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: .03em; color: #ff5555; animation: pix-pulse 5s ease-in-out infinite; }
.pix-countdown.expired { color: #ff5555; }
@keyframes pix-pulse {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: .3; }
}
.hidden { display: none !important; }
.full { width: 100%; }

.support-flow .support-step h2 { margin-top: 6px; }
.support-back { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; margin-bottom: 10px; }
.support-options { display: grid; gap: 8px; margin-top: 16px; }
.support-option { border: 1px solid var(--line); background: var(--surface-2); border-radius: 11px; padding: 13px 15px; text-align: left; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.support-option:hover { border-color: var(--accent); }
.support-option.active { border-color: var(--accent); background: rgba(255,107,44,.12); }
.success { text-align: center; }
.success-icon { margin: auto auto 18px; width: 54px; height: 54px; border-radius: 50%; background: rgba(74,222,128,.14); color: #4ade80; display: grid; place-items: center; font-size: 28px; }
.download-qr { margin: 22px auto; width: 150px; height: 150px; font-size: 110px; }
.download-qr a { display: block; width: 100%; height: 100%; }
#downloadLink { display: block; margin: 0 auto 18px; text-decoration: underline; font-weight: 600; color: var(--accent-light); }
.success p:not(.eyebrow) { max-width: 370px; margin: 0 auto; }
.ticket-number { margin-top: 18px !important; padding: 14px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; }
.ticket-number strong { color: var(--accent-light); font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: .03em; }

/* ---------- Tablet and up ---------- */
@media (min-width: 640px) {
  .topbar-inner { min-height: 76px; padding: 0 clamp(20px, 5vw, 72px); flex-wrap: nowrap; }
  .hero { padding: 56px clamp(20px, 5vw, 72px) 40px; }
  .control-panel, .moments-section { padding: 35px clamp(20px, 5vw, 72px); }
  .section-heading { flex-direction: row; justify-content: space-between; align-items: end; }
  .section-heading h2 { font-size: 30px; }
  .section-heading .primary-button { width: auto; }
  .camera-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .moments-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .modal-content { padding: 34px; }
  .modal h2 { font-size: 29px; margin-right: 0; }
  .preview-frame { height: 220px; }

  .step-heading { align-items: center; }
  .step-badge { width: 34px; height: 34px; font-size: 14px; }
  .step-heading h2 { font-size: 21px; }

  /* header CTA is comfortably reachable on larger screens; the mobile cart bar would be redundant
     (the base padding-bottom: 96px on .moments-section is also overridden by the padding shorthand above) */
  .cart-bar { display: none; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .hero { flex-direction: row; justify-content: space-between; align-items: end; gap: 40px; padding-top: 70px; padding-bottom: 48px; }
  .hero-card { width: auto; min-width: 220px; }
  .camera-grid { grid-template-columns: repeat(4, 1fr); }
  .camera-card:last-child:nth-child(odd) { grid-column: auto; } /* desfaz a regra do grid de 2 */
  .camera-card:last-child:nth-child(4n+1) { grid-column: 1 / -1; }
  .moments-section { padding-top: 58px; }
  .moments-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Faixa de aviso de demonstração (igual aos demais ambientes de demo) ---------- */
.demo-banner {
  background: linear-gradient(90deg, rgba(255, 107, 44, 0.16), rgba(255, 107, 44, 0.05));
  background-color: var(--bg-deep);
  border-bottom: 1px solid rgba(255, 107, 44, 0.3);
  padding: 9px 16px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  text-align: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50; /* abaixo do drawer do admin (60) e do backdrop (55) */
}
.demo-banner strong { color: var(--accent-light); }
.demo-banner a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.demo-banner .tf-cta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 11.5px; text-decoration: none; white-space: nowrap;
}
.demo-banner .tf-cta:hover { filter: brightness(1.12); }
@supports (backdrop-filter: blur(10px)) {
  .demo-banner { background-color: color-mix(in srgb, var(--bg-deep) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}

/* ---------- Tour guiado (painel + admin) ---------- */
.tour-backdrop { position: fixed; inset: 0; background: rgba(8,9,12,.5); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.tour-backdrop.show { opacity: 1; pointer-events: auto; }
.tour-highlight { position: fixed; z-index: 71; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8,9,12,.72), 0 0 0 2px var(--accent); pointer-events: none; display: none; transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease; }
.tour-tooltip { position: fixed; z-index: 72; width: min(300px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.5); display: none; transition: top .2s ease, left .2s ease; }
.tour-tooltip .eyebrow { margin: 0 0 8px; }
.tour-tooltip h3 { font: 600 16px 'Space Grotesk', ui-sans-serif, system-ui, sans-serif; margin: 0 0 8px; }
.tour-tooltip p { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.tour-tooltip-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tour-tooltip-buttons { display: flex; gap: 8px; }
.tour-tooltip-buttons button { border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.tour-btn-next { background: var(--accent); color: #fff; }
.tour-btn-back { background: var(--surface-2); color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .tour-highlight, .tour-tooltip, .tour-backdrop { transition: none; }
}
.demo-banner .tf-tour-link { color: var(--muted); }
