/* Casa Leve — app de rodízio. Paleta e fontes da página de vendas do produto. */
:root {
  --salvia: #7E9F85;
  --verde-claro: #AFC7A1;
  --azul: #A9C6D8;
  --areia: #E6D2B5;
  --sol: #F4D77A;
  --fundo: #F7F6F2;
  --escuro: #2D4535;
  --medio: #4A6B52;
  --texto: #1E2F22;
  --linha: #DCD8CC;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Inter', sans-serif;
  --nav-h: 76px;
  --raio: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  color: var(--texto);
  background: #ECE9DF;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--escuro); }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
p { color: var(--medio); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--escuro); outline-offset: 3px; border-radius: 12px; }

/* ── Estrutura ── */
.app {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--fundo);
  box-shadow: 0 0 0 1px rgba(45, 69, 53, .06), 0 10px 40px rgba(45, 69, 53, .12);
  display: flex;
  flex-direction: column;
}
.top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
}
.top .logo { height: 44px; width: auto; }
.top .titulo { font: 700 19px/1.2 var(--serif); color: var(--escuro); flex: 1; }
.back {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 48px; min-height: 48px; padding: 0 14px 0 8px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--escuro); font-weight: 700; font-size: 16px; cursor: pointer;
}
.back svg { width: 24px; height: 24px; }
.main { flex: 1; padding: 8px 20px 32px; outline: none; }
.main.com-nav { padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.lead { font-size: 18px; color: var(--medio); }
.peq { font-size: 14px; color: var(--medio); }
.centro { text-align: center; }

/* ── Botões ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 14px 22px;
  border: 0; border-radius: 999px;
  font-size: 18px; font-weight: 700; line-height: 1.2; text-align: center;
  cursor: pointer; transition: transform .1s ease, background-color .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn-primary { background: var(--medio); color: #fff; }
.btn-sol { background: var(--sol); color: var(--escuro); }
.btn-soft { background: #fff; color: var(--escuro); box-shadow: inset 0 0 0 2px var(--verde-claro); }
.btn-ghost { background: transparent; color: var(--medio); text-decoration: underline; text-underline-offset: 4px; min-height: 48px; }
.btn-perigo { background: #fff; color: #7D1A1A; box-shadow: inset 0 0 0 2px #E2B9B9; }
.btn-xl { min-height: 72px; font-size: 20px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
label.btn { cursor: pointer; }

/* Botões grandes do início */
.grande {
  display: flex; align-items: center; gap: 16px; width: 100%;
  min-height: 96px; padding: 14px 18px;
  background: #fff; border: 0; border-radius: var(--raio);
  box-shadow: 0 1px 0 rgba(45,69,53,.06), inset 0 0 0 2px var(--verde-claro);
  text-align: left; cursor: pointer; transition: transform .1s ease;
}
.grande:active { transform: scale(.985); }
.grande.destaque { background: var(--medio); box-shadow: none; }
.grande.destaque b, .grande.destaque small { color: #fff; }
.grande .ic { width: 60px; height: 60px; flex: none; display: grid; place-items: center; border-radius: 18px; background: var(--fundo); }
.grande.destaque .ic { background: rgba(255,255,255,.16); color: #fff; }
.grande .ic img { width: 48px; height: 48px; object-fit: contain; }
.grande .ic svg { width: 34px; height: 34px; }
.grande b { display: block; font: 700 21px/1.15 var(--serif); color: var(--escuro); }
.grande small { display: block; margin-top: 3px; font-size: 15px; color: var(--medio); }

/* ── Cartões e avisos ── */
.card { background: #fff; border-radius: var(--raio); padding: 18px; box-shadow: inset 0 0 0 1px var(--linha); }
.aviso {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: var(--raio); background: var(--sol); color: var(--escuro);
}
button.aviso { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.btn:focus-within { outline: 3px solid var(--escuro); outline-offset: 3px; }
.aviso b { font-size: 18px; display: block; }
.aviso span { font-size: 15px; }
.aviso.suave { background: #EAF1EA; }
.proxima { display: flex; align-items: center; gap: 14px; }
.proxima .data { font: 700 30px/1 var(--serif); color: var(--escuro); }
.proxima small { display: block; color: var(--medio); font-size: 14px; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.rola { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 8px; scrollbar-width: none; }
.chips.rola::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 48px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: #fff; box-shadow: inset 0 0 0 2px var(--linha);
  font-weight: 600; font-size: 16px; color: var(--escuro); cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"], .chip.on { background: var(--escuro); color: #fff; box-shadow: none; }
.chip .n { min-width: 24px; height: 24px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--fundo); color: var(--escuro); font-size: 14px; font-weight: 700; }
.chip[aria-pressed="true"] .n { background: rgba(255,255,255,.22); color: #fff; }
.chip .n.alerta { background: var(--sol); color: var(--escuro); }

/* ── Passos e progresso ── */
.prog { height: 10px; border-radius: 6px; background: #E4E1D6; overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 6px; background: var(--medio); transition: width .25s ease; }
.pergunta { padding-top: 8px; }
.pergunta h1 { font-size: 30px; }
.pergunta p { font-size: 18px; margin-top: 10px; }
.simnao { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.simnao .btn { min-height: 92px; font-size: 24px; }
.btn-sim { background: var(--medio); color: #fff; }
.btn-nao { background: var(--areia); color: #4A3515; }
.contador { font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--salvia); }

/* ── Categorias ── */
.cat {
  --c: var(--areia); --bg: #F5EBDB; --ink: #5B4326;
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px;
  padding: 10px 14px; border: 0; border-radius: var(--raio); background: var(--bg);
  text-align: left; cursor: pointer; box-shadow: inset 0 0 0 2px transparent; transition: transform .1s ease;
}
.cat:active { transform: scale(.985); }
.cat.sug { box-shadow: inset 0 0 0 3px var(--escuro); }
.cat .cat-ic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--c); color: var(--ink); }
.cat .cat-ic svg { width: 30px; height: 30px; }
.cat b { display: block; font: 700 20px/1.15 var(--serif); color: var(--ink); }
.cat small { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.3; color: var(--ink); opacity: .9; }
.cat .sugestao { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: var(--escuro); color: #fff; font: 700 12px var(--sans); vertical-align: middle; }
.c-construcao { --c: #F4D77A; --bg: #FBF0CB; --ink: #5E4608; }
.c-faz        { --c: #A9C6D8; --bg: #E3EEF4; --ink: #24506B; }
.c-jogos      { --c: #AFC7A1; --bg: #E6EFDF; --ink: #2F5434; }
.c-expressao  { --c: #E6D2B5; --bg: #F5EBDB; --ink: #5B4326; }
.c-movimento  { --c: #7E9F85; --bg: #DCE8DE; --ink: #1F3828; }

.foto-mini { display: flex; align-items: center; gap: 14px; }
.foto-mini .th { width: 72px; height: 72px; flex: none; }
.campo {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 0; border-radius: 16px; background: #fff; color: var(--texto);
  box-shadow: inset 0 0 0 2px var(--linha); font: inherit; font-size: 17px;
}
.campo:focus { outline: none; box-shadow: inset 0 0 0 3px var(--escuro); }
.rotulo { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--salvia); }

/* ── Miniaturas ── */
.th {
  position: relative; display: block; overflow: hidden; border-radius: 16px;
  background: var(--bg, #EDE7D8); aspect-ratio: 1; width: 100%;
}
.th img { width: 100%; height: 100%; object-fit: cover; }
.th .vazio { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink, #5B4326); }
.th .vazio svg { width: 44%; height: 44%; }
.th .tag {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
  padding: 3px 9px; border-radius: 10px; background: rgba(30, 47, 34, .82); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.th .selo { position: absolute; right: 6px; top: 6px; padding: 3px 9px; border-radius: 10px; background: var(--sol); color: var(--escuro); font-size: 12.5px; font-weight: 700; }
.th .selo.hoje { background: var(--escuro); color: #fff; }
.th.tela-cat { cursor: pointer; border: 0; padding: 0; }

/* ── Estante ── */
.estante-cat { padding: 14px; border-radius: var(--raio); background: var(--bg); }
.estante-cat header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.estante-cat .cat-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--c); color: var(--ink); flex: none; }
.estante-cat .cat-ic svg { width: 26px; height: 26px; }
.estante-cat h2 { font-size: 20px; color: var(--ink); }
.estante-cat .estado { font-size: 14px; font-weight: 600; color: var(--ink); }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { border: 0; padding: 0; background: none; cursor: pointer; text-align: left; }
.slot.livre {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 16px;
  border: 2.5px dashed var(--ink); background: rgba(255,255,255,.5); color: var(--ink);
  font-weight: 700; font-size: 15px; text-align: center; padding: 8px;
}
.slot.livre svg { width: 30px; height: 30px; display: block; margin: 0 auto 4px; }
.resumo-estante { display: flex; align-items: center; gap: 14px; }
.resumo-estante .num { font: 700 36px/1 var(--serif); color: var(--escuro); }

/* ── Caixas ── */
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vazia { padding: 28px 10px; text-align: center; color: var(--medio); }
.vazia img { width: 84px; margin: 0 auto 12px; }

/* ── Resultado ── */
.res { padding: 26px 20px; border-radius: 28px; text-align: center; }
.res h1 { font-size: 40px; }
.res p { color: inherit; font-size: 18px; margin-top: 10px; }
.res .selo-res { display: inline-grid; place-items: center; width: 76px; height: 76px; margin-bottom: 12px; border-radius: 50%; background: rgba(255,255,255,.6); }
.res .selo-res svg { width: 44px; height: 44px; }
.res.fica { background: #DDEBD6; color: #1F3C27; }
.res.transicao { background: var(--sol); color: #4B3A05; }
.res.doar { background: #D7E7F0; color: #1D4660; }
.res.apresentar { background: #EADFC8; color: #4A3515; }
.res.sai { background: #EADFC8; color: #4A3515; }
.res .pts { margin-top: 12px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }

/* ── Menu "Mais" ── */
.lista { display: flex; flex-direction: column; gap: 10px; }
.linha {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px;
  padding: 10px 16px; border: 0; border-radius: 18px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--linha); text-align: left; cursor: pointer; font-size: 18px; font-weight: 600; color: var(--escuro);
}
.linha img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.linha svg { width: 28px; height: 28px; flex: none; color: var(--medio); }
.linha small { display: block; font-size: 14px; font-weight: 400; color: var(--medio); }
.historico li { list-style: none; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.historico li:last-child { border-bottom: 0; }
.historico b { color: var(--escuro); }

/* Filhos */
.filho { padding: 14px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--linha); display: flex; flex-direction: column; gap: 12px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepper button { width: 56px; height: 56px; border: 0; border-radius: 50%; background: var(--areia); font-size: 30px; font-weight: 700; color: var(--escuro); cursor: pointer; }
.stepper button:active { transform: scale(.95); }
.stepper .val { flex: 1; text-align: center; font: 700 24px/1.1 var(--serif); color: var(--escuro); }
.stepper .val small { display: block; font: 600 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--salvia); }

/* ── Menu de baixo ── */
.nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 480px); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: 1fr 1fr 1.1fr 1fr 1fr; align-items: center;
  background: #fff; border-top: 1px solid var(--linha); z-index: 20;
}
.nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; border: 0; background: none; color: var(--medio);
  font-size: 12.5px; font-weight: 700; cursor: pointer; border-radius: 14px;
}
.nav button svg { width: 26px; height: 26px; }
.nav button[aria-current="page"] { color: var(--escuro); background: #EAF1EA; }
.nav .foto-btn { color: #fff; }
.nav .foto-btn span.bola {
  display: grid; place-items: center; width: 62px; height: 62px; margin-top: -26px;
  border-radius: 50%; background: var(--medio); color: #fff; box-shadow: 0 6px 16px rgba(45,69,53,.35), 0 0 0 5px #fff;
}
.nav .foto-btn span.bola svg { width: 30px; height: 30px; }
.nav .foto-btn { color: var(--escuro); }

/* ── Sheet e toast ── */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 47, 34, .5); animation: aparece .2s ease; }
.sheet-card {
  position: relative; width: min(100%, 480px); max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--fundo); border-radius: 28px 28px 0 0; animation: sobe .25s ease;
  display: flex; flex-direction: column; gap: 12px;
}
.sheet-card::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto 4px; border-radius: 3px; background: var(--linha); }
.sheet-card .foto-grande { width: 100%; max-height: 260px; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: var(--bg, #EDE7D8); display: grid; place-items: center; }
.sheet-card .foto-grande img { width: 100%; height: 100%; object-fit: cover; }
.sheet-card .foto-grande svg { width: 60px; height: 60px; color: var(--ink, #5B4326); }
.sheet-card textarea { width: 100%; min-height: 150px; padding: 14px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--linha); font: inherit; font-size: 16px; line-height: 1.45; color: var(--texto); resize: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(92vw, 440px); padding: 14px 20px; border-radius: 16px;
  background: var(--escuro); color: #fff; font-weight: 600; font-size: 16px; text-align: center; z-index: 60;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: sobe .2s ease;
}

@keyframes sobe { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { animation-name: aparece; }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
.entra { animation: entra .22s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .app { min-height: calc(100vh - 48px); border-radius: 32px; overflow: hidden; }
  .nav { bottom: 24px; border-radius: 0 0 32px 32px; }
  .toast { bottom: calc(var(--nav-h) + 42px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
