/* Site dos pais: feito para o celular, com as cores quentes do totem. */
:root {
  --creme: #f5ebdc;
  --creme-claro: #fcf8f2;
  --marrom: #502314;
  --marrom-medio: #85655a;
  --marrom-claro: #e9dccb;
  --laranja: #ff8732;
  --vermelho: #d62300;
  --amarelo: #ffaa00;
  --verde: #1f7a45;
  --titulo: "Lilita One", "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--creme); }
body { margin: 0; min-height: 100dvh; background: var(--creme); color: var(--marrom); font-family: var(--fonte); -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea {
  font: inherit; width: 100%; padding: .8rem .9rem; border-radius: 12px; border: 1.5px solid var(--marrom-claro);
  background: #fff; color: var(--marrom); font-size: 1.05rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--laranja); outline-offset: 0; border-color: transparent; }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font-family: var(--titulo); font-weight: 400; font-size: 2rem; line-height: 1.05; }
h2 { font-size: 1.1rem; font-weight: 800; }

.topo {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(.8rem + env(safe-area-inset-top)) 1rem .8rem; background: var(--marrom); color: var(--creme);
}
.marca { font-family: var(--titulo); font-size: 1.45rem; color: var(--amarelo); }
.link-topo { color: var(--creme); font-weight: 700; padding: .4rem .6rem; }

#tela { max-width: 560px; margin: 0 auto; padding: 1.2rem 1rem 3rem; display: grid; gap: 1rem; }

.cartao { background: #fff; border-radius: 20px; padding: 1.1rem; box-shadow: 0 4px 16px rgba(80, 35, 20, .08); }
.vazio { text-align: center; color: var(--marrom-medio); }
.ajuda { margin: 0; color: var(--marrom-medio); line-height: 1.45; }
.pequena { font-size: .88rem; }
.centro { text-align: center; }

.principal, .secundario, .perigo, .valor {
  padding: .9rem 1.2rem; border-radius: 14px; font-weight: 800; font-size: 1.02rem; text-align: center;
}
.principal { background: var(--vermelho); color: #fff; box-shadow: 0 6px 16px rgba(214, 35, 0, .22); }
.principal:active { background: #b51e00; }
.secundario { background: var(--creme-claro); border: 1.5px solid var(--marrom-claro); color: var(--marrom); }
.perigo { background: #fff; border: 1.5px solid var(--vermelho); color: var(--vermelho); }
.largo { width: 100%; }
.link { color: var(--marrom-medio); font-weight: 700; text-decoration: underline; padding: .5rem; justify-self: center; }
.voltar { justify-self: start; font-weight: 700; color: var(--marrom-medio); padding: .2rem 0; }

/* Entrar */
.entrar { display: grid; gap: .9rem; margin-top: 1.5rem; padding: 1.5rem 1.2rem; }
.entrar label { display: grid; gap: .4rem; font-weight: 700; }
.entrar .logo { width: 72px; height: 72px; display: grid; place-items: center; font-size: 2.3rem; border-radius: 50%; background: var(--creme); justify-self: center; }
.entrar h1 { text-align: center; }
.codigo { font-size: 2rem; letter-spacing: .5em; text-align: center; font-weight: 800; padding: .8rem .4rem .8rem 1rem; }
.simulado { display: grid; gap: .3rem; padding: .8rem 1rem; border: 2px dashed var(--marrom-claro); border-radius: 14px; font-weight: 700; }
.simulado small, .simulado-pix small { color: var(--marrom-medio); font-weight: 600; }

/* Início */
.ola { margin-top: .2rem; }
.alerta { padding: .9rem 1rem; border-radius: 14px; font-weight: 700; background: #fff4df; border-left: 5px solid var(--amarelo); }
.alerta.zerado { background: #ffe9e3; border-color: var(--vermelho); }
.alerta.cartao { background: #fff; border-color: var(--marrom-medio); }

.filho { display: grid; gap: 1rem; }
.filho-topo { display: flex; align-items: center; gap: .8rem; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--creme); font-weight: 800; flex-shrink: 0; }
.filho-nome h2 { font-size: 1.2rem; }
.filho-nome span { color: var(--marrom-medio); font-size: .92rem; font-weight: 600; }
.saldo { display: grid; gap: .1rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--marrom); color: var(--creme); }
.saldo small { font-weight: 700; opacity: .8; }
.saldo strong { font-size: 2.4rem; font-weight: 800; color: var(--amarelo); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.saldo strong.zerado { color: #ff9a85; }
.saldo span { font-size: .9rem; opacity: .85; }
.acoes { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: .5rem; }
.acoes > button { padding: .85rem .5rem; font-size: .95rem; }

.cardapio-hoje { display: grid; gap: .6rem; margin-top: .4rem; }
.lista-cardapio { padding: .3rem 1rem; }
.lista-cardapio details { border-bottom: 1px solid var(--creme); }
.lista-cardapio details:last-child { border-bottom: 0; }
summary { display: flex; align-items: center; gap: .5rem; padding: .85rem 0; font-weight: 800; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '›'; margin-left: auto; font-size: 1.4rem; color: var(--marrom-medio); transition: transform .15s; }
details[open] > summary::after { transform: rotate(90deg); }
summary small { color: var(--marrom-medio); font-weight: 600; }
.lista-cardapio ul { list-style: none; margin: 0; padding: 0 0 .6rem; display: grid; gap: .5rem; }
.lista-cardapio li { display: flex; align-items: center; gap: .7rem; }
.mini { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: var(--creme); font-size: 1.3rem; flex-shrink: 0; }
.lista-cardapio .nome { flex: 1; font-weight: 600; }
.lista-cardapio .preco { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lista-cardapio s { color: var(--marrom-medio); font-weight: 600; font-size: .85rem; margin-right: .35rem; }
.promo { margin-left: .4rem; padding: .1rem .5rem; border-radius: 999px; background: var(--vermelho); color: #fff; font-size: .72rem; font-style: normal; font-weight: 800; }

/* Recarga */
.valores { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.valor { padding: 1.3rem .5rem; font-size: 1.35rem; background: #fff; border: 2px solid var(--marrom-claro); box-shadow: 0 4px 12px rgba(80, 35, 20, .06); }
.valor:active { border-color: var(--laranja); }
.valor-outro { display: flex; gap: .6rem; }
.valor-outro button { white-space: nowrap; }
.pix { display: grid; gap: .9rem; text-align: center; }
.qr { width: min(260px, 70vw); justify-self: center; padding: .6rem; border-radius: 16px; border: 2px solid var(--creme); }
.qr svg { display: block; width: 100%; height: auto; }
.copia-e-cola { font-family: ui-monospace, monospace; font-size: .78rem; resize: none; word-break: break-all; background: var(--creme-claro); }
.esperando { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: 0; font-weight: 700; }
.girando { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--marrom-claro); border-top-color: var(--laranja); animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.simulado-pix { display: grid; gap: .5rem; padding-top: .8rem; border-top: 2px dashed var(--marrom-claro); }
.sucesso { display: grid; gap: .7rem; justify-items: center; text-align: center; padding: 2rem 1.2rem; }
.sucesso p { margin: 0; font-size: 1.1rem; }
.selo { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--verde); color: #fff; font-size: 2.8rem; font-weight: 800; }
.saldo-novo { font-weight: 800; font-size: 1.4rem !important; }

/* Extrato e semana */
.segmentos { display: flex; padding: .25rem; gap: .25rem; border-radius: 14px; background: #fff; }
.segmentos button { flex: 1; padding: .7rem; border-radius: 11px; font-weight: 800; color: var(--marrom-medio); }
.segmentos button.ativo { background: var(--marrom); color: var(--creme); }
.extrato { list-style: none; margin: 0; padding: .2rem 1rem; }
.extrato li { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; padding: .8rem 0; border-bottom: 1px solid var(--creme); }
.extrato li:last-child { border-bottom: 0; }
.extrato .quando { grid-column: 1; font-size: .8rem; color: var(--marrom-medio); font-weight: 600; }
.extrato .descricao { grid-column: 1; font-size: .95rem; line-height: 1.35; }
.extrato .valor { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 0; font-size: 1rem; font-weight: 800; background: none; border: 0; box-shadow: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.extrato .valor.entrada { color: var(--verde); }
.semana { display: grid; gap: 1rem; }
.rotulo { color: var(--marrom-medio); font-weight: 700; }
.total-semana { display: block; font-size: 2rem; font-weight: 800; margin: .1rem 0 1rem; font-variant-numeric: tabular-nums; }
.barras { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; height: 150px; align-items: end; }
.barra { height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: .25rem; min-width: 0; }
.barra .coluna { align-self: end; width: 70%; max-width: 32px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--laranja); }
.valor-barra { font-size: .66rem; font-weight: 700; color: var(--marrom-medio); white-space: nowrap; }
.dia { font-size: .78rem; font-weight: 700; color: var(--marrom-medio); text-transform: capitalize; }
.mais-comprados { margin: .6rem 0 0; padding-left: 1.3rem; display: grid; gap: .5rem; }
.mais-comprados li span:first-child { font-weight: 700; }
.mais-comprados li span:last-child { float: right; color: var(--marrom-medio); font-variant-numeric: tabular-nums; }

/* Controles */
.formulario { display: grid; gap: .7rem; }
.formulario label { display: grid; gap: .35rem; font-weight: 700; }
.linha { display: flex; align-items: center; gap: .5rem; }
.linha input { flex: 1; }
.prefixo { font-weight: 800; color: var(--marrom-medio); }
.bloqueios { border: 1.5px solid var(--creme); border-radius: 14px; padding: 0 .9rem; }
.contagem { margin-left: auto; color: var(--vermelho) !important; font-weight: 700 !important; }
.bloqueios summary::after { margin-left: .5rem; }
.opcoes { display: grid; gap: .2rem; padding-bottom: .7rem; }
.opcao { display: grid !important; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem !important; padding: .45rem 0; font-weight: 600 !important; }
.opcao input { width: 1.3rem; height: 1.3rem; accent-color: var(--vermelho); }
.opcao small { color: var(--marrom-medio); font-variant-numeric: tabular-nums; }
.cartao.perigo { border: 1.5px solid #f3c9bf; box-shadow: none; padding: 1.1rem; text-align: left; font-weight: inherit; }

/* Janela de confirmação e avisos */
.janela { border: 0; border-radius: 20px; padding: 1.4rem; width: min(400px, calc(100% - 2rem)); color: var(--marrom); display: grid; gap: .8rem; }
.janela[open] { display: grid; }
.janela::backdrop { background: rgba(40, 15, 5, .5); }
.janela p { margin: 0; line-height: 1.45; }
.janela .acoes { grid-template-columns: 1fr 1fr; }
#aviso {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  max-width: calc(100% - 2rem); padding: .85rem 1.2rem; border-radius: 14px; background: var(--marrom); color: #fff; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
#aviso.erro { background: var(--vermelho); }
