/* Componentes reutilizáveis */

/* Selo DEMO */
.badge-demo {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; white-space: nowrap;
  font: 600 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--demo); border: 1px dashed currentColor; padding: 4px 6px 3px; border-radius: var(--r);
}
.badge-demo::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Botões */
.btn {
  --h: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 20px; border: 1px solid transparent; border-radius: var(--r);
  font-size: 15px; font-weight: 600; letter-spacing: .005em; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.btn .ico { width: 18px; height: 18px; }
.btn .ico-arrow { transition: transform .25s var(--ease); }
.btn:hover .ico-arrow { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { --h: 38px; padding: 0 14px; font-size: 14px; }
.btn-lg { --h: 54px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-outline-light { color: var(--night-ink); border-color: rgba(238, 240, 237, .38); background: rgba(8, 10, 13, .12); backdrop-filter: blur(4px); }
.btn-outline-light:hover { border-color: var(--night-ink); background: rgba(238, 240, 237, .08); }
.btn-invert { background: var(--brand-ink); color: var(--brand); }
.btn-invert:hover { background: color-mix(in srgb, var(--brand-ink) 90%, var(--brand)); }
.btn.is-loading { position: relative; color: transparent; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--brand-ink); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 1px solid var(--line); border-radius: var(--r); background: transparent; color: var(--ink);
  transition: border-color .18s, background-color .18s;
}
.icon-btn:hover { border-color: var(--ink-3); }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn--sm .ico { width: 16px; height: 16px; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; display: inline-block; }
.live-dot.is-on { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Fotografia e espaço reservado */
.photo { position: relative; overflow: hidden; background: var(--ph-a); margin: 0; border: 0; padding: 0; display: block; width: 100%; }
.photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease), transform .8s var(--ease-out); }
.photo.is-loaded img, .photo img[loading="eager"] { opacity: 1; }
.photo.is-placeholder {
  background:
    linear-gradient(var(--ph-b) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, var(--ph-b) 1px, transparent 1px) 0 0 / 32px 100%,
    var(--ph-a);
}
.ph-label {
  position: absolute; left: 14px; bottom: 12px; right: 14px; display: flex; gap: 10px; align-items: flex-start;
  font: 500 11px/1.45 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ph-ink); text-align: left;
}
.ph-label .ico { width: 16px; height: 16px; margin-top: 1px; }
.ph-label b { display: block; font-weight: 600; color: var(--ink-2); }

/* Aviso do topo */
.notice { background: var(--night-3); color: var(--ink-2); font-size: 13px; border-bottom: 1px solid var(--line); }
.notice-row { display: flex; align-items: center; gap: 14px; min-height: 42px; padding-block: 6px; }
.notice-row p { flex: 1; min-width: 0; line-height: 1.45; }
.notice-tag { font: 600 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--demo); flex: none; }
.notice .icon-btn { border-color: transparent; }
@media (max-width: 640px) { .notice-tag { display: none; } }

/* Diálogo */
.modal {
  border: 0; padding: 0; margin: auto; background: transparent; color: var(--ink);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: visible;
}
.modal::backdrop { background: rgba(8, 10, 13, .62); backdrop-filter: blur(2px); animation: fade .2s var(--ease); }
.modal[open] .modal-panel { animation: pop .28s var(--ease-out); }
.modal.is-closing .modal-panel { animation: pop .18s var(--ease) reverse forwards; }
.modal.is-closing::backdrop { animation: fade .18s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; font-weight: 750; text-transform: uppercase; letter-spacing: .01em; font-variation-settings: "wdth" 110; }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--line); }
@media (max-width: 520px) {
  .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 92dvh; }
  .modal-panel { border-radius: 0; border-inline: 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal-actions { flex-direction: column-reverse; } .modal-actions .btn { width: 100%; }
}
.modal-note { display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.modal-note .ico { width: 17px; height: 17px; margin-top: 1px; color: var(--brand); }
.summary { display: grid; border: 1px solid var(--line); }
.summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 14px; align-items: baseline; }
.summary > div + div { border-top: 1px solid var(--line); }
.summary span { color: var(--ink-3); font-size: 14px; }
.summary b { font-weight: 600; text-align: right; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.summary b small { font-family: var(--f-sans); color: var(--ink-3); font-weight: 400; }
.steps { display: grid; gap: 12px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
.steps .ico { color: var(--brand); margin-top: 1px; }
.pay-methods { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.pay-methods legend { font: 500 var(--fs-xs)/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.pay-opt { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background-color .15s; }
.pay-opt:hover { border-color: var(--line-2); }
.pay-opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.pay-opt input { accent-color: var(--brand); margin: 0; }
.pay-opt b { display: block; font-weight: 600; font-size: 15px; }
.pay-opt small { color: var(--ink-3); font-size: 13px; }
.pay-ico { display: grid; place-items: center; width: 34px; height: 34px; background: var(--sunk); color: var(--ink-2); flex: none; }

/* Galeria ampliada */
.modal--lightbox { width: min(1200px, calc(100vw - 24px)); }
.modal--lightbox .modal-panel { background: var(--night); --ink: var(--night-ink); --ink-2: var(--night-ink-2); --ink-3: var(--night-ink-3); --line: var(--night-line); color: var(--ink); }
.modal--lightbox .modal-body { padding: 0; }
.lb { position: relative; }
.lb-stage .photo { aspect-ratio: 3 / 2; max-height: 76dvh; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(8, 10, 13, .55); border-color: rgba(238, 240, 237, .2); color: #fff; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-meta { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 520px) { .modal--lightbox { margin: auto; width: 100vw; } .modal--lightbox .modal-panel { border: 0; } }

/* Mensagens */
.toasts { position: fixed; z-index: 90; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer;
  background: var(--night); color: var(--night-ink); border-left: 3px solid var(--ok); font-size: 14px; line-height: 1.5;
  box-shadow: 0 10px 30px -12px rgba(8, 10, 13, .5); animation: toast-in .3s var(--ease-out);
}
.toast-info { border-left-color: var(--brand); } .toast-error { border-left-color: var(--full); }
.toast .ico { width: 18px; height: 18px; margin-top: 1px; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .22s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* Formulários */
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-row a { font-size: 13px; color: var(--ink-3); }
.field input {
  width: 100%; height: 48px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
.field input::placeholder { color: var(--ink-3); }
.field input:hover { border-color: var(--ink-3); }
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--full); }
.field-err { color: var(--full); font-size: 13px; min-height: 0; }
.field-err:empty { display: none; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 84px; }
.pass-toggle { position: absolute; right: 6px; top: 6px; bottom: 6px; padding: 0 10px; border: 0; background: transparent; font: 500 12px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pass-toggle:hover { color: var(--ink); }
