/* ====== Fonte ====== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ====== Tokens ====== */
:root {
  --laranja: #f97316;
  --laranja-escura: #ea580c;
  --verde: #22c55e;
  --creme: #fff8f0;
  --tinta: #292524;
  --cinza: #78716c;
  --linha: #ece7e1;
  --branco: #ffffff;
  --vermelho: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--creme);
  color: var(--tinta);
  line-height: 1.5;
}

/* ====== Hero ====== */
.hero {
  background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
  color: #fff;
  padding: 2.2rem 1.25rem 2rem;
  text-align: center;
}
.hero h1 { font-size: 2rem; font-weight: 900; letter-spacing: -0.5px; }
.hero .tagline { font-size: 1.05rem; font-weight: 700; margin-top: 0.2rem; }
.hero .desc { font-size: 0.9rem; opacity: 0.95; margin-top: 0.6rem; max-width: 480px; margin-inline:auto; }
.hero .desc strong { font-weight: 900; }

/* ====== Layout ====== */
.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 18px;
  padding: 1.15rem 1.15rem 1.3rem;
  box-shadow: 0 1px 3px rgba(41,37,36,0.05);
}
.card h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--laranja); color: #fff; font-size: 0.9rem; font-weight: 900;
  flex-shrink: 0;
}
.sempre { font-size: 0.7rem; background: var(--verde); color: #fff; padding: 0.15rem 0.55rem; border-radius: 50px; font-weight: 800; }
.obrig { font-size: 0.7rem; background: #fef2f2; color: var(--vermelho); padding: 0.15rem 0.55rem; border-radius: 50px; font-weight: 800; }
.hint { font-size: 0.85rem; color: var(--cinza); margin-bottom: 0.75rem; }

/* ====== Base ====== */
.base-box {
  background: #fff7ed; border: 2px dashed #fbbf24; border-radius: 14px;
  padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.base-name { font-weight: 800; font-size: 1.05rem; }
.base-desc { font-size: 0.85rem; color: var(--cinza); }
.base-incluida { align-self: flex-start; margin-top: 0.4rem; font-size: 0.78rem; font-weight: 800; color: var(--verde); background:#f0fdf4; padding:0.2rem 0.6rem; border-radius:50px; }

/* ====== Opções ====== */
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }

.opcao {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  border: 2px solid var(--linha); border-radius: 12px; padding: 0.8rem 0.9rem;
  background: #fff; cursor: pointer; transition: all 0.15s ease;
  min-height: 50px; user-select: none;
}
.opcao .nome { font-weight: 700; font-size: 0.95rem; }
.opcao .extra { font-size: 0.85rem; color: var(--cinza); font-weight: 600; flex-shrink: 0; }
.opcao:hover { border-color: #fdba74; }
.opcao.selecionada {
  border-color: var(--laranja); background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.18);
}
.opcao.selecionada .extra { color: var(--laranja-escura); }
.opcao:focus-visible { outline: 3px solid rgba(249,115,22,0.4); outline-offset: 1px; }

.check {
  width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid #d6d3d1;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; color: transparent; flex-shrink: 0; font-size: 0.8rem;
}
.check.multi { border-radius: 6px; }
.opcao.selecionada .check { background: var(--laranja); border-color: var(--laranja); color: #fff; }

/* ====== Resumo ====== */
.sub-titulo { font-weight: 800; font-size: 0.95rem; margin: 1rem 0 0.5rem; color: var(--tinta); }
.outros-bloco { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--linha); }
.sem-acomp { margin-top: 0.65rem; width: 100%; border-style: dashed; color: var(--cinza); justify-content: flex-start; }
.sem-acomp.selecionada { border-style: solid; color: var(--laranja-escura); }
.qtd-final { margin-top: 1rem; padding-top: 1rem; border-top: 2px dashed var(--linha); }
.grid-qtd { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem; }
.grid-qtd .opcao { justify-content: center; }
.campo-texto {
  width: 100%; padding: 0.8rem 0.9rem; font-family: inherit; font-size: 0.95rem;
  border: 2px solid var(--linha); border-radius: 12px; background: #faf7f4; color: var(--tinta);
}
.campo-texto:focus { outline: none; border-color: var(--laranja); background: #fff; }
.areatexto { resize: vertical; min-height: 70px; }

.caracteres { font-size: 0.75rem; color: var(--cinza); text-align: right; margin-top: 0.35rem; font-weight: 600; }

.contador { font-size: 0.85rem; font-weight: 800; color: var(--laranja-escura); margin-bottom: 0.6rem; }
.aviso { font-size: 0.8rem; font-weight: 700; color: var(--vermelho); background: #fef2f2; padding: 0.5rem 0.7rem; border-radius: 10px; margin-top: 0.7rem; }

/* ====== Plano ====== */
.plano .linha-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.campo-wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.campo-wrap label { font-size: 0.85rem; font-weight: 800; color: var(--cinza); }
.campo-wrap input[type=number] {
  width: 100%; padding: 0.8rem 0.9rem; font-family: inherit; font-size: 1.1rem; font-weight: 800;
  border: 2px solid var(--linha); border-radius: 12px; background: #faf7f4; color: var(--tinta);
}
.campo-wrap input[type=number]:focus { outline: none; border-color: var(--laranja); background: #fff; }
.info-divisao { margin-top: 0.8rem; font-size: 0.9rem; font-weight: 700; }
.info-divisao.ok { color: var(--verde); }
.info-divisao.erro { color: var(--vermelho); }

/* ====== Blocos de sabor ====== */
.tipo-seletor {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.9rem;
}
@media (max-width: 340px) { .tipo-seletor { grid-template-columns: 1fr; } }
.tipo-btn {
  padding: 0.7rem; font-family: inherit; font-size: 0.95rem; font-weight: 800;
  border: 2px solid var(--linha); border-radius: 12px; background: #fff; color: var(--cinza);
  cursor: pointer; transition: all 0.15s ease;
}
.tipo-btn:hover { border-color: #fdba74; }
.tipo-btn.ativo { background: var(--laranja); border-color: var(--laranja); color: #fff; }

.bloco-sabor {
  border: 2px solid var(--linha); border-radius: 16px; padding: 1rem; margin-bottom: 1rem;
  background: #fffdf9;
}
.bloco-sabor.incompleto { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.15); }
.cabecalho-sabor {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  margin-bottom: 0.9rem; padding-bottom: 0.7rem; border-bottom: 1px dashed var(--linha);
}
.cabecalho-sabor .titulo-sabor { flex: 1; min-width: 120px; }
.qtd-wrap { display: flex; align-items: center; gap: 0.5rem; }
.qtd-wrap label { font-size: 0.75rem; font-weight: 800; color: var(--cinza); }
.campo-qtd {
  width: 64px; padding: 0.45rem 0.55rem; font-family: inherit; font-size: 1rem; font-weight: 800;
  border: 2px solid var(--linha); border-radius: 10px; background: #fff; text-align: center; color: var(--tinta);
}
.campo-qtd:focus { outline: none; border-color: var(--laranja); }
.btn-remover {
  width: 34px; height: 34px; border: 2px solid var(--linha); border-radius: 50%;
  background: #fff; color: var(--cinza); font-size: 0.85rem; font-weight: 900; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s ease;
}
.btn-remover:hover { border-color: var(--vermelho); color: var(--vermelho); background: #fef2f2; }
.corpo-sabor .tipo-seletor { margin-bottom: 0.6rem; }
.bloco-sabor:last-child { margin-bottom: 0; }
.titulo-sabor {
  font-size: 1.05rem; font-weight: 900; display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.6rem; color: var(--tinta); flex-wrap: wrap;
}
.badge-unid { font-size: 0.78rem; font-weight: 800; color: var(--laranja-escura); background: #fff0e0; padding: 0.2rem 0.6rem; border-radius: 50px; }
.bloco-sabor .sub-titulo { margin-top: 0.9rem; }

.resumo-sabor {
  border-bottom: 1px dashed var(--linha); padding: 0.5rem 0; display: flex; flex-direction: column; gap: 0.15rem;
  font-size: 0.92rem;
}
.resumo-sabor:last-of-type { border-bottom: none; }
.resumo-sabor span { color: var(--cinza); font-weight: 600; }
.resumo-sabor small { color: var(--cinza); }
.total-row.linha-unid { font-size: 1rem; font-weight: 800; }

.resumo h2 { margin-bottom: 0.75rem; }

@media (max-width: 420px) { .plano .linha-campos { grid-template-columns: 1fr; } }
#resumo-itens { display: flex; flex-direction: column; gap: 0.45rem; padding-bottom: 0.9rem; border-bottom: 1px dashed var(--linha); margin-bottom: 0.9rem; }
.resumo-item { display: flex; justify-content: space-between; font-size: 0.95rem; }
.resumo-item .pi { font-weight: 600; }
.resumo-item.vazio { color: var(--cinza); font-style: italic; }

.total { display: flex; flex-direction: column; gap: 0.35rem; }
.total-row { display: flex; justify-content: space-between; font-size: 0.95rem; }
.total-row.grande { font-size: 1.3rem; font-weight: 900; margin-top: 0.4rem; }

.btn {
  width: 100%; margin-top: 1rem; padding: 1rem; border: none; border-radius: 14px;
  background: var(--verde); color: #fff; font-family: inherit; font-size: 1.05rem; font-weight: 900;
  cursor: pointer; transition: all 0.15s ease;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn:hover:not(:disabled) { background: #16a34a; transform: translateY(-1px); }
.btn:disabled { background: #d6d3d1; cursor: not-allowed; }

.btn-secundario {
  background: #fff; color: var(--laranja); border: 2px solid var(--laranja); margin-top: 0;
}
.btn-secundario:hover:not(:disabled) { background: #fff7ed; color: var(--laranja-escura); }
.btn-secundario:disabled { border-color: var(--linha); color: var(--cinza); background: #f5f5f4; }

.nota { font-size: 0.8rem; color: var(--cinza); text-align: center; margin-top: 0.6rem; font-weight: 600; }
.nota.fresca { color: var(--verde); }

/* ====== Footer ====== */
.footer { text-align: center; color: var(--cinza); font-size: 0.8rem; padding: 0.4rem 0 0; }

/* ====== Responsivo ====== */
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
}

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