/* Acabamento dos botões: relevo, sombra, resposta ao toque e foco.
   Carregado depois do styles.css, então sobrescreve os estilos base. */

:root {
  --transicao: 0.16s ease;
  --sombra-ouro: #c79a2e;
  --sombra-numero: #b98a3a;
}

/* Números da cartela */
.numero {
  background: linear-gradient(180deg, #ffffff 0%, #fff4d6 100%);
  box-shadow: 0 4px 0 var(--sombra-numero), 0 6px 12px rgba(90, 44, 10, 0.18), inset 0 1px 0 #ffffff;
  transition: transform var(--transicao), box-shadow var(--transicao);
}
.numero:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--sombra-numero), 0 12px 20px rgba(90, 44, 10, 0.22), inset 0 1px 0 #ffffff;
}
.numero:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--sombra-numero), 0 2px 4px rgba(90, 44, 10, 0.2), inset 0 1px 0 #ffffff;
}
.numero:disabled {
  cursor: not-allowed;
}
.numero.reservado {
  background: linear-gradient(180deg, #e9e3d6 0%, #d3ccbd 100%);
  box-shadow: inset 0 2px 4px rgba(90, 44, 10, 0.18);
}
.numero.pago {
  background: linear-gradient(180deg, #7a3d0e 0%, var(--marrom) 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Abas das cartelas */
.aba {
  background: linear-gradient(180deg, #fbe98f 0%, #efcb55 100%);
  box-shadow: 0 3px 0 var(--sombra-ouro), 0 4px 10px rgba(90, 44, 10, 0.12);
  transition: transform var(--transicao), box-shadow var(--transicao);
}
.aba:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--sombra-ouro), 0 8px 14px rgba(90, 44, 10, 0.16);
}
.aba:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--sombra-ouro);
}
.aba.ativa {
  background: linear-gradient(180deg, #7a3d0e 0%, var(--marrom) 100%);
  color: var(--ouro);
  box-shadow: 0 3px 0 var(--marrom-escuro), 0 6px 12px rgba(59, 27, 5, 0.3);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.aba:focus-visible {
  outline: 3px solid var(--marrom);
  outline-offset: 3px;
}

/* Botão principal (marrom) */
.botao {
  background: linear-gradient(180deg, #7a3d0e 0%, var(--marrom) 100%);
  color: var(--ouro);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 0 var(--marrom-escuro), 0 8px 16px rgba(59, 27, 5, 0.25);
  transition: transform var(--transicao), box-shadow var(--transicao), filter var(--transicao);
}
.botao:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.botao:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--marrom-escuro);
}
.botao:focus-visible {
  outline: 3px solid var(--ouro-escuro);
  outline-offset: 3px;
}

/* Botão secundário (dourado claro) */
.botao-secundario {
  background: linear-gradient(180deg, #fff3b8 0%, var(--ouro-claro) 100%);
  color: var(--marrom);
  box-shadow: 0 3px 0 var(--sombra-ouro), 0 6px 12px rgba(90, 44, 10, 0.18);
  transition: transform var(--transicao), box-shadow var(--transicao), filter var(--transicao);
}
.botao-secundario:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}
.botao-secundario:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--sombra-ouro);
}
.botao-secundario:focus-visible {
  outline: 3px solid var(--marrom);
  outline-offset: 3px;
}

/* Botão de atualizar (círculo com a seta) */
.atualizar-icone {
  background: linear-gradient(180deg, #7a3d0e 0%, var(--marrom) 100%);
  box-shadow: 0 4px 0 var(--marrom-escuro), 0 8px 16px rgba(59, 27, 5, 0.3);
  transition: transform var(--transicao), box-shadow var(--transicao);
}
.atualizar-icone:hover {
  transform: translateY(-2px);
}
.atualizar-icone:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--marrom-escuro);
}
/* Ao apertar, a seta dá uma volta completa antes da página recarregar */
.atualizar-icone.girando svg {
  animation: girar-uma-vez 0.6s var(--ease-out);
}
@keyframes girar-uma-vez {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Olho da senha */
.olho {
  transition: color var(--transicao), transform var(--transicao);
}
.olho:hover {
  color: var(--ouro-escuro);
  transform: translateY(-50%) scale(1.08);
}
.olho:active {
  transform: translateY(-50%) scale(0.94);
}

/* Sensação de app caro: movimento suave, entrada elegante e resposta ao toque */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--ouro-escuro);
  color: var(--marrom);
}

@keyframes subir {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes surgir {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: none; }
}
@keyframes entrar-modal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes escurecer {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Seções entram uma depois da outra */
.pagina > * {
  animation: subir 0.7s var(--ease-out) backwards;
}
.pagina > *:nth-child(2) { animation-delay: 0.06s; }
.pagina > *:nth-child(3) { animation-delay: 0.12s; }
.pagina > *:nth-child(4) { animation-delay: 0.18s; }
.pagina > *:nth-child(5) { animation-delay: 0.24s; }
.pagina > *:nth-child(6) { animation-delay: 0.3s; }
.pagina > *:nth-child(7) { animation-delay: 0.36s; }

/* Os números surgem em cascata quando a cartela abre */
.grade.entrar .numero {
  animation: surgir 0.5s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 16ms);
}

/* Movimento mais macio em todos os elementos tocáveis */
.numero,
.aba,
.botao,
.botao-secundario,
.atualizar-icone,
.olho {
  transition:
    transform 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    background 0.4s var(--ease-out),
    color 0.3s ease,
    filter 0.4s ease;
}
.numero:not(:disabled):active,
.aba:active,
.botao:active:not(:disabled),
.botao-secundario:active,
.atualizar-icone:active {
  transition-duration: 0.09s;
}
.numero:not(:disabled):active {
  transform: translateY(3px) scale(0.97);
}

/* Cartão do PIX com profundidade */
.pix {
  box-shadow: 0 12px 26px rgba(59, 27, 5, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Janela de reserva: entra deslizando e o fundo fica desfocado */
dialog[open] {
  animation: entrar-modal 0.45s var(--ease-out) backwards;
}
dialog::backdrop {
  animation: escurecer 0.3s ease backwards;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Quem prefere menos movimento não vê as animações */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Instruções para instalar como aplicativo */
.instrucoes-app {
  margin-top: 14px;
  background: rgba(255, 253, 247, 0.92);
  border-radius: 14px;
  box-shadow: 0 4px 0 rgba(90, 44, 10, 0.2);
  text-align: left;
}
.instrucoes-app summary {
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.instrucoes-app summary::-webkit-details-marker { display: none; }
.instrucoes-app summary::after { content: "  ▾"; }
.instrucoes-app[open] summary::after { content: "  ▴"; }
.instrucoes-corpo {
  padding: 0 16px 14px;
  font-size: 15px;
  line-height: 1.5;
}
.instrucoes-corpo p { margin: 10px 0 4px; }
.instrucoes-corpo ol { margin: 0; padding-left: 22px; }

/* Abas das cartelas: efeito de botão apertando */
.aba {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.aba:active {
  transform: translateY(4px) scale(0.95);
  box-shadow: 0 0 0 var(--sombra-ouro), inset 0 3px 6px rgba(90, 44, 10, 0.3);
  filter: brightness(0.93);
  transition-duration: 0.06s;
}
.aba.ativa:active {
  box-shadow: 0 0 0 var(--marrom-escuro), inset 0 3px 8px rgba(0, 0, 0, 0.45);
}
@keyframes assentar {
  0% { transform: translateY(4px) scale(0.93); }
  60% { transform: translateY(-2px) scale(1.04); }
  100% { transform: none; }
}
.aba.assentar {
  animation: assentar 0.45s var(--ease-out);
}

/* Números: efeito de aperto mais forte */
.numero:not(:disabled):active {
  transform: translateY(5px) scale(0.92);
  box-shadow: 0 0 0 var(--sombra-numero), inset 0 3px 7px rgba(90, 44, 10, 0.35);
  filter: brightness(0.92);
  transition-duration: 0.07s;
}

/* Janela de reserva: quem é o número */
.empresa-numero {
  margin: 4px 0 0;
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbe98f 0%, #efcb55 100%);
  color: var(--marrom);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 0 #c79a2e;
}

/* Campos: foco com brilho suave */
.form input:not([type="hidden"]) {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.form input:not([type="hidden"]):focus {
  outline: none;
  border-color: var(--marrom);
  background: #fffdf5;
  box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.35);
}

/* Conteúdo da janela entra em sequência */
.form > * {
  animation: subir 0.5s var(--ease-out) backwards;
}
.form > *:nth-child(2) { animation-delay: 0.05s; }
.form > *:nth-child(3) { animation-delay: 0.1s; }
.form > *:nth-child(4) { animation-delay: 0.15s; }
.form > *:nth-child(5) { animation-delay: 0.2s; }
.form > *:nth-child(6) { animation-delay: 0.25s; }
.form > *:nth-child(7) { animation-delay: 0.3s; }
.form > *:nth-child(8) { animation-delay: 0.35s; }

/* Saída suave da janela */
@keyframes sair-modal {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(16px) scale(0.97); }
}
dialog.saindo {
  animation: sair-modal 0.3s var(--ease-out) forwards;
}
dialog.saindo::backdrop {
  animation: escurecer 0.3s ease reverse forwards;
}

/* Detalhes do número pago */
.detalhes-corpo h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.detalhe-linha {
  margin: 6px 0;
  font-size: 16px;
}
.detalhe-imagem {
  display: block;
  width: 100%;
  border-radius: 14px;
  margin: 12px 0;
  box-shadow: 0 8px 20px rgba(59, 27, 5, 0.25);
}
.detalhe-acoes {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.detalhe-acoes a,
.detalhe-acoes button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}
