/* Selo "modelo Mesa Própria" + modal explicativo. Camada de marca à parte: usa as cores da Mesa Própria
   (carvão, osso, brasa) pra ler como etiqueta de demonstração em qualquer modelo (escuro ou claro).
   Marcação criada por assets/js/selo.js. Classes sempre prefixadas com .selo-. */

.selo {
  --selo-ink: #0e0d0b;
  --selo-bone: #ede4d3;
  --selo-ember: #ff4a24;
  position: fixed;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.9rem 0.6rem 0.7rem;
  background: var(--selo-ink);
  color: var(--selo-bone);
  border: 1px solid rgba(237, 228, 211, 0.34);
  border-radius: 4px;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}
.selo.is-in { opacity: 1; transform: none; pointer-events: auto; }
.selo:hover { border-color: var(--selo-ember); }
.selo:focus-visible { outline: 2px solid var(--selo-ember); outline-offset: 3px; }

.selo__mark { width: 0.8rem; height: 0.8rem; background: var(--selo-ember); flex: none; }
.selo__txt { display: grid; line-height: 1.15; text-align: left; }
.selo__name { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.selo__name i { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: var(--selo-ember); }
.selo__hint { display: none; font-size: 0.7rem; color: rgba(237, 228, 211, 0.72); margin-top: 0.15rem; }

/* primeiro acesso: maior, com a pergunta visível e um anel que chama o olhar */
.selo.is-intro { padding: 0.8rem 1.1rem 0.8rem 0.9rem; gap: 0.8rem; border-color: var(--selo-ember); }
.selo.is-intro .selo__mark { width: 1rem; height: 1rem; }
.selo.is-intro .selo__name { font-size: 0.95rem; }
.selo.is-intro .selo__hint { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .selo { transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease; }
  .selo.is-intro.is-in::after {
    content: ""; position: absolute; inset: -1px; border: 2px solid var(--selo-ember); border-radius: 4px;
    animation: selo-ring 1.8s ease-out 0.6s 3 both; pointer-events: none;
  }
}
@keyframes selo-ring { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18, 1.5); } }

/* ---- modal ---- */
dialog.selo-dialog {
  border: 0; padding: 0; background: transparent; color: #ede4d3;
  width: min(560px, 94vw); max-height: 92vh; overflow: visible;
}
dialog.selo-dialog::backdrop { background: rgba(6, 5, 4, 0.78); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
@media (prefers-reduced-motion: no-preference) {
  dialog.selo-dialog[open] { animation: selo-in 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
}
@keyframes selo-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }

.selo-modal {
  position: relative; max-height: 90vh; overflow-y: auto;
  background: #0e0d0b; border: 1px solid rgba(237, 228, 211, 0.3); border-radius: 4px;
  padding: 2rem 1.75rem 1.75rem; font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.98rem; line-height: 1.6; color: #b7ad97;
  box-shadow: 0 50px 100px -30px #000;
}
.selo-modal__x {
  position: absolute; top: 0.5rem; right: 0.6rem; min-width: 44px; min-height: 44px;
  background: none; border: 0; color: #b7ad97; font-size: 1.7rem; line-height: 1; cursor: pointer;
}
.selo-modal__x:hover { color: #ede4d3; }
.selo-modal__kicker {
  display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.68rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: #ff4a24;
}
.selo-modal__kicker::before { content: ""; width: 1.2rem; height: 2px; background: currentColor; }
.selo-modal h2 {
  margin: 0 2rem 1rem 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400;
  font-size: clamp(1.45rem, 1.1rem + 1.6vw, 1.9rem); line-height: 1.15; letter-spacing: -0.015em; color: #ede4d3; text-transform: none;
}
.selo-modal p { margin: 0 0 0.9rem; max-width: none; }
.selo-modal strong { color: #ede4d3; font-weight: 700; }
.selo-modal ul { list-style: none; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.55rem; }
.selo-modal li { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; align-items: start; }
.selo-modal li::before { content: "✓"; color: #ff4a24; font-weight: 700; }
.selo-modal__cta { margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px solid rgba(237, 228, 211, 0.16); }
.selo-modal__cta p:last-child { margin-bottom: 0; }
.selo-modal__cta p:first-child { font-size: 1.05rem; margin-bottom: 0.3rem; }
.selo-modal__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; position: sticky; bottom: -1.75rem; margin: 1rem -1.75rem -1.75rem; padding: 0.9rem 1.75rem 1.75rem; background: #0e0d0b; border-top: 1px solid rgba(237, 228, 211, 0.16); }
.selo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6ch; min-height: 46px;
  padding: 0.95rem 1.5rem; border: 1px solid #ff4a24; border-radius: 2px; background: #ff4a24; color: #0e0d0b;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.selo-btn:hover { background: transparent; color: #ff4a24; }
.selo-btn--ghost { background: transparent; color: #ede4d3; border-color: rgba(237, 228, 211, 0.34); }
.selo-btn--ghost:hover { background: #ede4d3; color: #0e0d0b; border-color: #ede4d3; }
.selo-modal :focus-visible, .selo-btn:focus-visible { outline: 2px solid #ff4a24; outline-offset: 3px; }

@media (max-width: 560px) {
  .selo-modal { padding: 1.75rem 1.25rem 1.4rem; }
  .selo-modal__actions { bottom: -1.4rem; margin: 1rem -1.25rem -1.4rem; padding: 0.9rem 1.25rem 1.4rem; }
  .selo-modal__actions .selo-btn { flex: 1 1 100%; }
  .selo.is-intro .selo__name { font-size: 0.88rem; }
}

/* celular: sobe do rodapé (barra do navegador / home indicator) e ganha área de toque confortável */
@media (max-width: 720px) {
  .selo { bottom: max(5.25rem, calc(env(safe-area-inset-bottom) + 4.75rem)); min-height: 48px; padding: 0.7rem 1rem 0.7rem 0.85rem; }
  .selo.is-intro { min-height: 54px; }
  .selo--inapp { bottom: max(7rem, calc(env(safe-area-inset-bottom) + 6.5rem)); }
}
