/* Telas de conta, rastreio e painel - herdam a paleta da loja */
[hidden] { display: none !important; }

#resultado { scroll-margin-top: 90px; }

.conta-tela {
  width: min(560px, 100% - 28px);
  margin: 26px auto 60px;
}

.painel-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.painel-titulo h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.abas {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  border-radius: 14px;
}

.abas button {
  flex: 1;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--texto-suave);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.abas button.ativo {
  background: var(--dourado);
  color: #3a2a00;
}

.caixa-clara {
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  color: #14361f;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.caixa-clara h2 {
  margin-bottom: 14px;
  color: var(--verde);
  font-size: 1.2rem;
}

.campo {
  display: block;
  margin-bottom: 14px;
}

.campo span {
  display: block;
  margin-bottom: 5px;
  color: #3c5a48;
  font-size: 0.85rem;
  font-weight: 700;
}

.campo input,
.campo select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #cfe3d5;
  border-radius: 10px;
  background: #f7fcf8;
  color: #14361f;
  font: inherit;
  font-size: 1rem;
}

.campo input:focus,
.campo select:focus {
  border-color: #2e7d4f;
  background: #fff;
  outline: none;
}

.campo input.erro,
.campo select.erro {
  border-color: #d84343;
  background: #fff4f4;
}

.msg {
  margin: 10px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.msg.erro {
  border: 1px solid #d84343;
  background: #fdf0f0;
  color: #a11f1f;
}

.msg.ok {
  border: 1px solid #2e7d4f;
  background: #ecf9f1;
  color: #1d5c38;
}

.btn-verde {
  display: inline-block;
  width: 100%;
  min-height: 48px;
  padding: 13px 22px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(180deg, #f7d449, #e0a800);
  color: #3a2a00;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.btn-verde:disabled {
  opacity: 0.6;
  cursor: wait;
}

.linha-conta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.linha-conta strong { color: var(--verde); }

/* cartoes de pedido */
.pedido-cartao {
  padding: 16px;
  border: 1px solid #d7e5db;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
}

.pedido-cartao header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pedido-cartao .cod {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--verde);
}

.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ecf9f1;
  color: #1d5c38;
  font-size: 0.8rem;
  font-weight: 700;
}

.selo.extraviado { background: #fff3e0; color: #9a4b00; }
.selo.entregue { background: #e8f5e9; color: #1b5e20; }
.selo.cancelado { background: #fdecea; color: #a11f1f; }
.selo.aguardando_pix { background: #f3f4f6; color: #4b5563; }

.pedido-cartao .mini {
  color: #57705f;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* rastreio */
.rastreio-caixa {
  width: min(720px, 100% - 28px);
  margin: 26px auto 60px;
}

.timeline {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 22px 42px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 2px;
  background: #cfe3d5;
}

.timeline li:last-child::before { display: none; }

.timeline .marca {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2e7d4f;
  color: #fff;
  font-size: 0.95rem;
}

.timeline li.futuro .marca { background: #cfd8d2; color: #6b7a71; }
.timeline li.extravio .marca { background: #d97706; }
.timeline li.entregue .marca { background: #15803d; }

.timeline .titulo-evento {
  font-weight: 700;
  color: #14361f;
}

.timeline .data-evento {
  display: block;
  color: #6b7a71;
  font-size: 0.82rem;
}

.timeline .desc-evento {
  color: #35543f;
  font-size: 0.92rem;
  line-height: 1.5;
}

.timeline .local-evento {
  display: block;
  margin-top: 3px;
  color: #57705f;
  font-size: 0.85rem;
}

.info-prazo {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #cfe3d5;
  background: #f3faf5;
  color: #14361f;
  font-size: 0.92rem;
  line-height: 1.55;
}

.info-prazo strong { color: var(--verde); }

.info-prazo.alerta {
  border-color: #f0b26b;
  background: #fff6e8;
}

/* painel admin */
.painel-admin {
  width: min(1180px, 100% - 24px);
  margin: 22px auto 60px;
}

.barra-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.abas-admin {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.abas-admin button {
  min-height: 42px;
  padding: 10px 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.abas-admin button.ativo {
  background: var(--dourado);
  border-color: var(--dourado);
  color: #3a2a00;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.9rem;
  color: #14361f;
}

.tabela th,
.tabela td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e3eee7;
  vertical-align: middle;
}

.tabela th {
  background: #ecf9f1;
  color: var(--verde);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tabela tr:last-child td { border-bottom: none; }

.tabela .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

.tabela-scroll { overflow-x: auto; border-radius: 12px; }

.btn-mini {
  min-height: 32px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: #2e7d4f;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-mini.claro { background: #e8f5e9; color: #1d5c38; }
.btn-mini.perigo { background: #d84343; }
.btn-mini.ouro { background: #e0a800; color: #3a2a00; }

.linha-acoes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-admin {
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  color: #14361f;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.grade-admin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 20, 11, 0.85);
}

.modal-fundo[hidden] { display: none; }

.modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  color: #14361f;
}

.modal h3 {
  margin-bottom: 14px;
  color: var(--verde);
}

.vazio-admin {
  padding: 30px;
  text-align: center;
  color: #57705f;
  background: #fff;
  border-radius: 12px;
}

@media (max-width: 620px) {
  .caixa-clara { padding: 16px; }
  .modal { padding: 16px; }
}

/* Trajeto do rastreio: cidades por onde o objeto passou */
.rota-rastreio {
  margin-top: 8px;
  font-size: .86rem;
  line-height: 1.8;
  color: #1d5c38;
  font-weight: 600;
}
.rota-rastreio span { color: #7aa98b; font-weight: 400; }

/* ---------------------------------------------------------------- etapas do pedido */
.etapas-pedido {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 16px 0 4px;
  padding: 0;
  list-style: none;
  counter-reset: etapa;
}

.etapas-pedido li {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: .72rem;
  line-height: 1.25;
  color: #8a998f;
}

/* linha de ligacao entre as bolinhas */
.etapas-pedido li::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: #d9e4dd;
}

.etapas-pedido li:first-child::before { display: none; }

.etapas-pedido .bolinha {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #d9e4dd;
  background: #fff;
  font-size: .76rem;
  font-weight: 800;
  color: #8a998f;
}

.etapas-pedido .nome-etapa { font-weight: 600; }

.etapas-pedido li.concluida { color: #1d5c38; }
.etapas-pedido li.concluida::before { background: #2e7d4f; }
.etapas-pedido li.concluida .bolinha {
  border-color: #2e7d4f;
  background: #2e7d4f;
  color: #fff;
}

.etapas-pedido li.atual { color: #0b2f1d; }
.etapas-pedido li.atual::before { background: #2e7d4f; }
.etapas-pedido li.atual .bolinha {
  border-color: #2e7d4f;
  background: #fff;
  color: #2e7d4f;
  box-shadow: 0 0 0 4px #d9efe2;
}
.etapas-pedido li.atual .nome-etapa { font-weight: 800; }

/* ---------------------------------------------------------------- rota ate a cidade */
.rota-pedido {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #d9e4dd;
  border-radius: 12px;
  background: #f7fbf8;
}

.rota-titulo {
  display: block;
  margin-bottom: 14px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #1d5c38;
}

.rota-trilha {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  padding-bottom: 4px;
}

.rota-trilha li {
  position: relative;
  flex: 1 1 0;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

/* trilha horizontal entre os pontos */
.rota-trilha li::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: #d9e4dd;
}

.rota-trilha li:first-child::before { display: none; }

.rota-trilha .ponto {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #d9e4dd;
  background: #fff;
}

.rota-trilha .cidade {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6em;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.25;
  color: #6b7a71;
  word-break: break-word;
}

.rota-trilha .legenda {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9aa8a0;
}

/* trecho ja percorrido */
.rota-trilha li.feito::before { background: #2e7d4f; }
.rota-trilha li.feito .ponto {
  border-color: #2e7d4f;
  background: #2e7d4f;
}
.rota-trilha li.feito .cidade { color: #0b2f1d; }
.rota-trilha li.feito .legenda { color: #2e7d4f; font-weight: 700; }

/* trecho em andamento: pacote a caminho do proximo ponto */
.rota-trilha li.atual::before { background: #2e7d4f; }
.rota-trilha li.atual .ponto {
  border-color: #2e7d4f;
  background: #2e7d4f;
  box-shadow: 0 0 0 0 rgba(46, 125, 79, .55);
  animation: pulso-rota 2s ease-out infinite;
}
.rota-trilha li.atual .cidade { color: #0b2f1d; font-weight: 800; }
.rota-trilha li.atual .legenda { color: #2e7d4f; font-weight: 800; }

@keyframes pulso-rota {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 79, .55); }
  70% { box-shadow: 0 0 0 9px rgba(46, 125, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 79, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .rota-trilha li.atual .ponto { animation: none; }
}

/* trecho previsto */
.rota-trilha li.futuro .ponto {
  border-color: #b9c9c0;
  background: repeating-linear-gradient(45deg, #eef3f0, #eef3f0 3px, #dfe8e3 3px, #dfe8e3 6px);
}
.rota-trilha li.futuro .cidade { color: #6b7a71; font-weight: 600; }
.rota-trilha li.futuro .legenda { color: #9aa8a0; }

/* no celular a rota vira vertical, para caber todos os trechos sem rolagem lateral */
@media (max-width: 560px) {
  .etapas-pedido .nome-etapa { font-size: .62rem; }

  .rota-pedido { padding: 14px; }
  .rota-trilha {
    display: block;
    overflow: visible;
    padding-bottom: 0;
  }
  .rota-trilha li {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0 12px;
    min-width: 0;
    padding: 0 0 18px 32px;
    text-align: left;
  }
  .rota-trilha li::before {
    content: '';
    position: absolute;
    left: 8px;
    right: auto;
    top: 20px;
    bottom: 2px;
    width: 3px;
    height: auto;
    background: #d9e4dd;
  }
  .rota-trilha li:first-child::before { display: block; }
  .rota-trilha li:last-child::before { display: none; }
  .rota-trilha li:last-child { padding-bottom: 0; }
  .rota-trilha .ponto {
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
  }
  .rota-trilha .cidade {
    display: block;
    min-height: 0;
    font-size: .82rem;
    text-align: left;
  }
  .rota-trilha .legenda { margin-left: auto; font-size: .62rem; }
  /* no trilho vertical a linha verde fica no trecho ja percorrido, nao no que sai do ponto atual */
  .rota-trilha li.atual::before { background: #d9e4dd; }
}
.timeline li.extravio .titulo-evento { color: #b3261e; }
.timeline li.extravio .marca { background: #fdecea; border-color: #f5c2be; }

/* Codigo de pedido / rastreio nunca quebra no meio */
.tabela td.mono { white-space: nowrap; }
