/*
 * base/10-modal-toast.css
 * Toast, modal e menu inferior do celular.
 */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom,0px));
  transform: translate(-50%,20px);
  opacity: 0;
  pointer-events: none;
  background: #141414;
  color: #f1ead9;
  border: 1px solid #3a2f17;
  padding: 12px 18px 12px 14px;
  border-radius: 12px;
  z-index: 200;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  transition: .25s;
  max-width: calc(100% - 32px);
}

#toast.on {
  opacity: 1;
  transform: translate(-50%,0);
}

#toast svg {
  width: 18px;
  height: 18px;
  color: #fdb621;
  flex: none;
}

#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.66);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

#modal.on {
  display: flex;
}

#mbox {
  background: var(--sf);
  border: 1px solid var(--ln2);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100% - 20px);
  overflow: auto;
  box-shadow: var(--shadow);
}

#mbox.w {
  max-width: 760px;
}

.mh {
  padding: 20px 22px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mh h2 {
  font-size: 24px;
}

.mb {
  padding: 16px 22px;
}

.mf {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--ln);
  position: sticky;
  bottom: 0;
  background: var(--sf);
}

.sheet {
  display: none;
}

.bnav {
  display: none;
}

*:focus-visible {
  outline: 2px solid var(--gd);
  outline-offset: 2px;
}

@media (prefers-reduced-motion:reduce) {
  * {
    animation: none!important;
    transition: none!important;
  }
}

/* ---------- Situação da sincronização com o servidor ---------- */
#sync {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 190;
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  font: 600 12.5px/1.3 var(--ui, system-ui, sans-serif);
  background: #1b1b1b;
  color: #d9d1c0;
  border: 1px solid #333;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

#sync.offline {
  opacity: 1;
  border-color: #e8795e;
  color: #ffd9cf;
}

/* "Salvando…" só aparece se o envio demorar. */
#sync.salvando {
  opacity: 1;
  transition-delay: 1.2s;
}

@media (max-width: 760px) {
  #sync {
    bottom: 84px;
  }
}

/* ---------- Carregando (primeira tela, enquanto os dados chegam do servidor) ---------- */
.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: #958d7c;
  font-size: 14px;
}

.boot i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid #333;
  border-top-color: #fdb621;
  animation: boot .8s linear infinite;
}

@keyframes boot {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot i {
    animation-duration: 2.4s;
  }
}

@media print {
  #sync {
    display: none;
  }
}
