/* Master Nutrição Animal · Ficha de cadastro (menu lateral, igual ao carrinho, só mais largo)
   Vem depois do a.css: usa .cart__cab, .cart__x, .cart__pe, .field, .select e os botões de lá. */

.ficha {
  position: fixed; inset: 0 0 0 auto; width: min(600px, 100vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--bg); color: var(--ink); box-shadow: -24px 0 60px -30px rgba(6, 27, 51, .55);
  flex-direction: column; overscroll-behavior: contain;
}
.ficha[open] { display: flex; animation: cart-entra .45s var(--ease-out); }
.ficha.saindo { animation: cart-sai .28s ease-in forwards; }
.ficha::backdrop { background: rgba(6, 27, 51, .42); animation: fundo .3s ease; }
@media (prefers-reduced-motion: reduce) { .ficha[open], .ficha.saindo, .ficha::backdrop, .ficha__ok { animation: none; } }

.ficha__cab { align-items: flex-start; }
.ficha__sub { font-size: .875rem; color: var(--muted); margin-top: 2px; }
.ficha__rola { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
.ficha__form { display: grid; gap: var(--s-5); padding: 20px 24px 28px; }
.ficha__form[hidden] { display: none; }
.ficha__intro { color: var(--text); }

/* física ou jurídica: dois cartões grandes */
.ficha__tipo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ficha__tipo legend { padding: 0; margin-bottom: 10px; font-weight: 600; font-size: 1.0625rem; color: var(--ink); }
.tipo { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--cinza-300); border-radius: 14px; background: var(--bg); cursor: pointer; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.tipo:hover { border-color: var(--cinza-400); }
.tipo input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tipo__ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--azul-50); color: var(--azul-600); transition: background-color .2s ease, color .2s ease; }
.tipo__ic .ic { width: 22px; height: 22px; }
.tipo__txt { display: grid; gap: 2px; min-width: 0; }
.tipo__txt strong { font-weight: 600; font-size: 1rem; }
.tipo__txt small { font-size: .8125rem; line-height: 1.35; color: var(--muted); }
.tipo.on, .tipo:has(input:checked) { border-color: var(--accent); background: var(--azul-50); box-shadow: inset 0 0 0 1px var(--accent); }
.tipo.on .tipo__ic, .tipo:has(input:checked) .tipo__ic { background: var(--accent); color: #fff; }
.tipo:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 479px) { .ficha__tipo { grid-template-columns: 1fr; } }

/* seções numeradas */
.fsec { display: grid; gap: 14px; padding-top: var(--s-5); border-top: 1px solid var(--line); }
.fsec__tit { display: flex; align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.fsec__n { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8125rem; font-weight: 600; }
.fsec__nota { font-size: .9375rem; color: var(--text); }
.fgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.fgrid .c1 { grid-column: span 1; } .fgrid .c2 { grid-column: span 2; } .fgrid .c3 { grid-column: span 3; }
.fgrid .c4 { grid-column: span 4; } .fgrid .c6 { grid-column: span 6; }
@media (max-width: 539px) {
  .fgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fgrid .c3, .fgrid .c4, .fgrid .c6 { grid-column: span 3; }
  .fgrid .c2 { grid-column: span 2; }
}
.ficha .field label { font-size: 14px; }
.ficha .field input, .ficha .field select { min-height: 46px; padding: 10px 12px; }
.ficha .select select { padding-right: 30px; }
.ficha .select::after { right: 12px; }
.ficha .opc { font-weight: 400; color: var(--muted); }
.field__dica { font-size: 13px; color: var(--muted); }
.field.achou input { border-color: #15803D; box-shadow: 0 0 0 3px #DCF2E3; }

.fend { display: grid; gap: 12px; margin-top: 6px; padding-top: 14px; border-top: 1px dashed var(--cinza-300); }
.fend__cab { display: flex; align-items: center; justify-content: space-between; font-weight: 500; color: var(--ink); }
.fend__tirar { min-height: 40px; border: 0; background: none; padding: 6px 4px; color: #B42318; font-size: .875rem; font-weight: 500; cursor: pointer; }
.fend__tirar:hover { text-decoration: underline; }
.fmais { display: inline-flex; align-items: center; justify-self: start; gap: 8px; height: 42px; padding: 0 16px; border: 1px dashed var(--cinza-400); border-radius: 999px; background: none; color: var(--azul-600); font-size: .9375rem; font-weight: 500; cursor: pointer; }
.fmais:hover { border-color: var(--accent); background: var(--azul-50); }
.fmais .ic { width: 18px; height: 18px; }

.fcheck { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 1rem; color: var(--ink); }
.fcheck input { appearance: none; width: 22px; height: 22px; flex: none; margin: 0; border: 1.5px solid var(--cinza-400); border-radius: 6px; background: var(--bg); cursor: pointer; display: grid; place-content: center; transition: background-color .15s ease, border-color .15s ease; }
.fcheck input::before { content: ""; width: 11px; height: 6px; margin-top: -3px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); transition: transform .15s ease; }
.fcheck input:checked { background: var(--accent); border-color: var(--accent); }
.fcheck input:checked::before { transform: rotate(-45deg) scale(1); }
.fcheck input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-cob][hidden] { display: none; }
.fdocs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 479px) { .fdocs { grid-template-columns: 1fr; } }

/* rodapé fixo da ficha */
.ficha__pe { gap: 10px; }
.ficha__pe[hidden] { display: none; }
.ficha__pe .btn { height: 52px; font-size: 1.0625rem; }
.ficha__status { font-size: .9375rem; color: #B42318; font-weight: 500; }
.ficha__status.info { color: var(--muted); font-weight: 400; }
.ficha__status:empty { display: none; }
.ficha__priv { font-size: .8125rem; color: var(--muted); text-align: center; }

/* pronto */
.ficha__pronto { display: grid; gap: var(--s-4); justify-items: center; text-align: center; padding: 40px 28px 32px; }
.ficha__pronto[hidden] { display: none; }
.ficha__ok { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #15803D; color: #fff; animation: ok-entra .5s var(--ease-out); }
.ficha__ok .ic { width: 32px; height: 32px; stroke-width: 2.5; }
@keyframes ok-entra { from { transform: scale(.6); opacity: 0; } }
.ficha__pronto h3 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.ficha__pronto h3:focus { outline: none; }
.ficha__dica { color: var(--text); max-width: 40ch; }
.ficha__arq { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); text-align: left; }
.ficha__arq-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 10px; background: #FDECEC; color: #B42318; }
.ficha__arq-ic .ic { width: 22px; height: 22px; }
.ficha__arq div { display: grid; min-width: 0; }
.ficha__arq strong { font-weight: 500; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha__arq span { font-size: .8125rem; color: var(--muted); }
.ficha__bts { display: grid; gap: 10px; width: 100%; max-width: 420px; }
.ficha__bts .btn { height: 52px; font-size: 1.0625rem; }
.ficha__bts [hidden] { display: none; }
.ficha__recep { font-size: .9375rem; color: var(--text); max-width: 42ch; }
.ficha__fim { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; margin-top: var(--s-2); }
.ficha__voltar { border: 0; background: none; padding: 8px 4px; color: var(--azul-600); font-size: .9375rem; font-weight: 500; cursor: pointer; }
.ficha__voltar:hover { text-decoration: underline; }
@media (max-width: 539px) {
  .ficha__form { padding: 16px 18px 24px; }
  .ficha__pronto { padding: 32px 20px 28px; }
}
