.voltar { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-s); color: var(--luz-2); text-decoration: none; padding: 10px 4px; transition: color .3s, gap .4s var(--ease); }
.voltar svg { width: 18px; height: 18px; }
.voltar:hover { color: var(--luz); gap: 12px; }

/* Introdução */
.orc-intro { position: relative; overflow: hidden; isolation: isolate; padding: 140px 0 70px; background: radial-gradient(80% 100% at 90% 0%, #4b1c55 0%, var(--ameixa) 65%); }
.orc-intro .aura { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.orc-intro .aura i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.orc-intro .aura i:nth-child(1) { width: 36vmax; height: 36vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle, rgba(122, 36, 72, .9), transparent 65%); animation: flutua 22s ease-in-out infinite alternate; }
.orc-intro .aura i:nth-child(2) { width: 24vmax; height: 24vmax; right: -4vmax; bottom: -12vmax; background: radial-gradient(circle, rgba(255, 134, 207, .25), transparent 65%); animation: flutua 18s ease-in-out infinite alternate-reverse; }
@keyframes flutua { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(3vmax, 2vmax, 0) scale(1.1); } }
.orc-intro h1 { position: relative; font-size: var(--t-2xl); margin-bottom: 18px; background: linear-gradient(180deg, #ffe3f3, #ffb0de 50%, #e56fb8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.orc-intro p { position: relative; max-width: 52ch; color: var(--luz-2); font-size: var(--t-l); line-height: 1.5; }
.js .orc-intro h1, .js .orc-intro p { opacity: 0; transform: translateY(18px); animation: aparece 1s var(--ease) forwards; }
.js .orc-intro p { animation-delay: .12s; }
@keyframes aparece { to { opacity: 1; transform: none; } }

/* Grelha principal */
.orc { padding: 56px 0 120px; }
.orc-grelha { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.bloco + .bloco { margin-top: 72px; }
.bloco-cabeca { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.bloco-cabeca h2 { font-size: var(--t-xl); }
.passo { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ameixa); color: #ffd0ea; font-family: var(--f-display); font-size: 1.25rem; box-shadow: 0 0 0 4px rgba(255, 134, 207, .12); }

/* Filtros */
.filtros { position: sticky; top: 76px; z-index: 5; display: grid; gap: 12px; padding: 14px 0 12px; margin-bottom: 8px; background: linear-gradient(var(--perola) 82%, rgba(251, 242, 246, 0)); }
.procura { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--linha-clara); transition: border-color .3s, box-shadow .3s; }
.procura:focus-within { border-color: var(--vinho); box-shadow: 0 0 0 4px rgba(255, 134, 207, .18); }
.procura svg { width: 18px; height: 18px; color: var(--tinta-2); flex: none; }
.procura input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 var(--t-m) var(--f-texto); color: var(--tinta); outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--linha-clara); background: transparent; color: var(--tinta); font: 400 var(--t-s) var(--f-texto); cursor: pointer; white-space: nowrap; transition: background-color .35s var(--ease), color .35s, border-color .35s, box-shadow .35s; }
.chip:hover { border-color: var(--vinho); }
.chip[aria-current="true"] { background: var(--ameixa); color: #ffe3f3; border-color: var(--ameixa); box-shadow: 0 6px 18px -8px rgba(42, 16, 48, .6); }
.chip .cont { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--neon); color: #2a0c2a; font-size: .72rem; font-weight: 500; }

/* Grupos e itens */
.grupo { padding-top: 26px; scroll-margin-top: 190px; }
.grupo-cabeca { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--linha-clara); margin-bottom: 6px; }
.grupo-cabeca h3 { font-family: var(--f-display); font-size: 1.75rem; line-height: 1.1; }
.grupo-cabeca p { font-size: var(--t-xs); color: var(--tinta-2); text-align: right; max-width: 34ch; }
.itens { list-style: none; margin: 0; padding: 0; }
.item { position: relative; }
.item input { position: absolute; opacity: 0; pointer-events: none; }
.item label {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 14px; margin-inline: -14px; border-radius: 14px; cursor: pointer;
  transition: background-color .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.item label:hover { background: rgba(122, 36, 72, .05); }
.item .caixa { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(43, 22, 48, .3); display: grid; place-items: center; transition: background-color .35s var(--ease), border-color .35s, box-shadow .35s, transform .35s var(--ease); }
.item .caixa svg { width: 14px; height: 14px; color: #2a0c2a; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .4s var(--ease) .05s; }
.item .txt { display: grid; gap: 2px; }
.item .n { font-weight: 400; color: var(--tinta); }
.item .m { font-size: var(--t-xs); color: var(--tinta-2); }
.item .p { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--tinta); white-space: nowrap; text-align: right; }
.item .p small { display: block; font-weight: 400; font-size: .72rem; color: var(--tinta-2); }
.item input:checked + label { background: rgba(255, 134, 207, .12); }
.item input:checked + label .caixa { background: var(--neon); border-color: var(--neon); box-shadow: 0 0 12px rgba(255, 134, 207, .7); transform: scale(1.06); }
.item input:checked + label .caixa svg { stroke-dashoffset: 0; }
.item input:focus-visible + label { outline: 2px solid var(--vinho); outline-offset: 2px; }
.item.realce label { animation: realce 2.2s var(--ease); }
@keyframes realce { 0%, 40% { box-shadow: 0 0 0 2px var(--neon), 0 0 22px rgba(255, 134, 207, .45); } 100% { box-shadow: 0 0 0 0 transparent; } }
.vazio { padding: 40px 0; color: var(--tinta-2); }

/* Formulário */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; }
.campo { display: grid; gap: 8px; align-content: start; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo-largo, fieldset.campo { grid-column: 1 / -1; }
.campo label, .campo legend { font-size: var(--t-s); font-weight: 400; color: var(--tinta); padding: 0; margin-bottom: 0; }
fieldset.campo legend { margin-bottom: 8px; }
.campo input:not([type="radio"]), .campo select, .campo textarea {
  width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--linha-clara); background: #fff;
  font: 400 var(--t-m) var(--f-texto); color: var(--tinta); transition: border-color .3s, box-shadow .3s; -webkit-appearance: none; appearance: none;
}
.campo select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d5673' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat; padding-right: 44px; }
.campo textarea { resize: vertical; line-height: 1.5; }
.campo input::placeholder, .campo textarea::placeholder { color: #a894aa; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--vinho); box-shadow: 0 0 0 4px rgba(255, 134, 207, .18); }
.campo.invalido input { border-color: #c2366b; box-shadow: 0 0 0 4px rgba(194, 54, 107, .12); }
.erro { font-size: var(--t-xs); color: #b02a5e; min-height: 0; }
.erro:empty { display: none; }
.ajuda { font-size: var(--t-xs); color: var(--tinta-2); }
.segmento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 5px; border-radius: 16px; background: #fff; border: 1px solid var(--linha-clara); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.segmento input { position: absolute; opacity: 0; pointer-events: none; }
.segmento label { display: grid; place-items: center; min-height: 44px; padding: 6px 10px; border-radius: 11px; cursor: pointer; text-align: center; font-size: var(--t-s); color: var(--tinta-2); transition: background-color .35s var(--ease), color .35s, box-shadow .35s; }
.segmento label:hover { color: var(--tinta); }
.segmento input:checked + label { background: var(--ameixa); color: #ffe3f3; box-shadow: 0 6px 16px -8px rgba(42, 16, 48, .7); }
.segmento input:focus-visible + label { outline: 2px solid var(--neon); outline-offset: 2px; }

/* Resumo */
.resumo { position: sticky; top: 100px; }
.resumo-caixa { position: relative; padding: 28px; border-radius: 24px; background: var(--ameixa); color: var(--luz); box-shadow: 0 30px 60px -30px rgba(42, 16, 48, .7), 0 0 0 1px rgba(255, 170, 220, .14) inset; overflow: hidden; isolation: isolate; }
.resumo-caixa::before { content: ""; position: absolute; width: 260px; height: 260px; right: -110px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 134, 207, .3), transparent 65%); z-index: -1; }
.resumo h2 { font-size: 1.9rem; margin-bottom: 18px; }
.escolhidos { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
.escolhidos li { display: grid; grid-template-columns: 1fr auto 30px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--linha-escura); font-size: var(--t-s); animation: entra .45s var(--ease); }
@keyframes entra { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.escolhidos .v { font-variant-numeric: tabular-nums; color: #ffd0ea; white-space: nowrap; }
.escolhidos button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--luz-2); cursor: pointer; display: grid; place-items: center; transition: background-color .3s, color .3s; }
.escolhidos button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.escolhidos button svg { width: 14px; height: 14px; }
.sem-itens { color: var(--luz-2); font-size: var(--t-s); padding: 6px 0 4px; }
.nota-aval { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(199, 163, 242, .12); font-size: var(--t-xs); color: var(--luz-2); line-height: 1.5; }
.nota-aval strong { color: var(--luz); font-weight: 500; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 18px; }
.total span { color: var(--luz-2); font-size: var(--t-s); }
.total strong { font-family: var(--f-texto); font-weight: 500; letter-spacing: -.02em; font-size: 2.3rem; line-height: 1; color: #ffe3f3; text-shadow: 0 0 20px rgba(255, 134, 207, .4); font-variant-numeric: tabular-nums; transition: transform .4s var(--ease); }
.total strong.pulsa { animation: salta .5s var(--ease); }
@keyframes salta { 40% { transform: scale(1.08); } }
.erro-geral { display: block; margin-bottom: 12px; color: #ffb3cf; }
.erro-geral:empty { display: none; }
.enviar { width: 100%; min-height: 56px; }
.letra-miuda { margin-top: 14px; font-size: var(--t-xs); color: var(--luz-2); line-height: 1.5; }

/* Barra fixa no telemóvel */
.barra { display: none; }
@media (max-width: 960px) {
  .orc-grelha { grid-template-columns: 1fr; }
  .resumo { position: static; }
  .barra {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
    align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 20px; border-radius: 999px;
    background: rgba(42, 16, 48, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -14px rgba(20, 5, 25, .7), 0 0 0 1px rgba(255, 170, 220, .2) inset;
    transform: translateY(140%); transition: transform .6s var(--ease);
  }
  .barra.ativa { transform: none; }
  .barra-info { display: grid; line-height: 1.2; }
  .barra-info span { font-size: var(--t-xs); color: var(--luz-2); }
  .barra-info strong { font-family: var(--f-texto); font-weight: 500; letter-spacing: -.01em; font-size: 1.4rem; color: #ffe3f3; font-variant-numeric: tabular-nums; }
  .barra .btn { min-height: 48px; padding-inline: 1.3em; }
  .orc { padding-bottom: 140px; }
}
@media (max-width: 640px) {
  .form { grid-template-columns: 1fr; }
  .seg-4 { grid-template-columns: repeat(2, 1fr); }
  .grupo-cabeca { flex-direction: column; align-items: flex-start; gap: 4px; }
  .grupo-cabeca p { text-align: left; }
  .orc-intro { padding: 116px 0 52px; }
  .filtros { top: 76px; }
}

.rodape-curto { padding: 0 0 30px; }
.rodape-curto .fim { margin-top: 0; }

.pag-orc .topo.solido { background: var(--ameixa); }
