/* ============================================================
   Familiar draft — protótipo da Área do Responsável Solidário
   Isolado do site: NÃO usa site.css / familias.css.
   Norte de design: hospitalidade + saúde + confiança.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
    --fd-page: #EAE5DF;
    --fd-bg: #F6F4F1;
    --fd-surface: #FFFFFF;
    --fd-surface-2: #FBFAF8;
    --fd-ink: #2A2A2E;
    --fd-muted: #71717A;
    --fd-faint: #A7A7AE;

    --fd-brand: #E63888;      /* rosa Bela Idade */
    --fd-brand-ink: #B31E63;
    --fd-brand-soft: #FCE7F0;

    --fd-teal: #1D9E75;       /* saúde / positivo */
    --fd-teal-ink: #0F6E56;
    --fd-teal-soft: #E3F4EC;

    --fd-amber: #C9852A;
    --fd-amber-soft: #FBEEDA;
    --fd-red: #C9483F;
    --fd-red-soft: #FBE9E8;

    --fd-line: #ECE8E2;
    --fd-line-strong: #E0DBD3;

    --fd-b1: #C2D69B;         /* Antonio Barbosa */
    --fd-b2: #9BC2E6;         /* Octaviano de Freitas */
    --fd-b3: #D1B2E8;         /* Alvarenga */

    --fd-radius: 18px;
    --fd-radius-sm: 12px;
    --fd-shadow: 0 1px 2px rgba(40, 30, 20, .04), 0 6px 20px rgba(40, 30, 20, .05);
    --fd-shadow-sm: 0 1px 2px rgba(40, 30, 20, .05);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--fd-page);
    color: var(--fd-ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ---------- App shell ---------- */
.fd-app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--fd-bg);
    position: relative;
    padding-bottom: 92px;
    overflow-x: hidden;
}

.fd-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 12px;
    background: var(--fd-bg);
    backdrop-filter: saturate(1.2);
}
.fd-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.fd-brand .fd-mark {
    width: 30px; height: 30px; border-radius: 9px;
    background: var(--fd-brand); color: #fff;
    display: grid; place-items: center; font-size: 17px;
}
.fd-brand small { display: block; font-weight: 600; font-size: 11px; color: var(--fd-muted); letter-spacing: 0; margin-top: -3px; }
.fd-iconbtn {
    width: 40px; height: 40px; border-radius: 50%;
    border: none; background: var(--fd-surface); color: var(--fd-ink);
    display: grid; place-items: center; font-size: 20px; cursor: pointer;
    box-shadow: var(--fd-shadow-sm); position: relative; text-decoration: none;
}
.fd-iconbtn .fd-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--fd-brand); border: 2px solid var(--fd-surface); }

.fd-content { padding: 4px 16px 24px; }

/* ---------- Bottom nav ---------- */
.fd-nav {
    position: fixed;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    width: 100%; max-width: 480px;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--fd-line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
}
.fd-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: var(--fd-faint); font-size: 10.5px; font-weight: 700;
    padding: 4px 0; border-radius: 12px;
}
.fd-nav a i { font-size: 22px; }
.fd-nav a.active { color: var(--fd-brand); }

/* ---------- Greeting / resident selector ---------- */
.fd-greet { padding: 2px 2px 10px; }
.fd-greet .hi { font-size: 15px; color: var(--fd-muted); font-weight: 600; }
.fd-selector {
    margin-top: 8px;
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--fd-surface); border: 1px solid var(--fd-line);
    border-radius: 999px; padding: 6px 14px 6px 6px; cursor: pointer;
    box-shadow: var(--fd-shadow-sm); text-decoration: none; color: var(--fd-ink);
}
.fd-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #4a3a55;
    background: var(--fd-b3);
}
.fd-selector .who b { font-weight: 800; font-size: 14px; display: block; line-height: 1.1; }
.fd-selector .who span { font-size: 11.5px; color: var(--fd-muted); font-weight: 600; }
.fd-selector .chev { color: var(--fd-faint); font-size: 18px; }

/* ---------- Cards ---------- */
.fd-card {
    background: var(--fd-surface);
    border-radius: var(--fd-radius);
    box-shadow: var(--fd-shadow);
    padding: 16px 16px;
    margin-bottom: 14px;
}
.fd-card.tint-teal { background: var(--fd-teal-soft); box-shadow: none; }
.fd-card.tint-brand { background: var(--fd-brand-soft); box-shadow: none; }

.fd-section { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 8px; }

/* ⚠️ O respiro ACIMA do título de um bloco é PADDING do .fd-group, não margem do título —
   e o último filho do grupo perde a margem de baixo, para o total não somar duas vezes.
   Duas razões, ambas custaram uma rodada (dono 12/08):
   1. o título é o primeiro filho de um .fd-group sem padding/borda, então a margem do topo
      COLAPSA para fora e se funde com a do card anterior (vale a MAIOR, não a soma) — com
      18/10 sobrava 18 acima e 10 abaixo e o título parecia ser do bloco de CIMA;
   2. no masonry do desktop, margem no topo de uma coluna é TRUNCADA pelo navegador — a
      coluna da esquerda ganhava os 26px e a da direita ficava com ZERO ("Pendências" com
      respiro e "Saídas agendadas" colada nos atalhos). Padding não é truncado.
   Resultado medido: 26 acima × 8 abaixo, igual nas duas colunas e no celular. */
.fd-group { padding-top: 26px; }
.fd-group .fd-section:first-child { margin-top: 0; }
/* Padding não colapsa: quem vem ANTES de um grupo tem de largar a própria margem de baixo,
   senão soma (14 + 26 = 40) e aquele bloco respira mais que os vizinhos.
   ⚠️ Só quando o PRÓXIMO bloco traz o respiro dele. A regra era `.fd-group > *:last-child`
   sem condição e colava o que viesse depois: foi o "Recibos e Imposto de Renda" grudado na
   "Evolução do ano" no Financeiro (dono 12/08). Card solto depois de um grupo é sempre
   suspeito — o certo é envolvê-lo num .fd-group. */
.fd-group:has(+ .fd-group) > *:last-child,
.fd-content > *:has(+ .fd-group) { margin-bottom: 0; }
.fd-hgroup:has(+ .fd-group) p { margin-bottom: 0; }
.fd-section h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.fd-section a { text-decoration: none; color: var(--fd-brand); font-weight: 700; font-size: 13px; }

.fd-cardhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fd-cardhead .lbl { font-size: 13px; color: var(--fd-muted); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.fd-cardhead .lbl i { font-size: 17px; }

/* ---------- Pills / badges ---------- */
.fd-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 999px; }
.fd-pill.ok { background: var(--fd-teal-soft); color: var(--fd-teal-ink); }
.fd-pill.warn { background: var(--fd-amber-soft); color: var(--fd-amber); }
.fd-pill.danger { background: var(--fd-red-soft); color: var(--fd-red); }
.fd-pill.neutral { background: #F0EEE9; color: var(--fd-muted); }

/* ---------- Buttons ---------- */
.fd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: none; cursor: pointer; text-decoration: none;
    font-family: inherit; font-weight: 800; font-size: 14px;
    padding: 12px 18px; border-radius: 13px; color: var(--fd-ink);
    background: #F0EEE9; transition: transform .06s ease;
}
.fd-btn:active { transform: scale(.98); }
.fd-btn i { font-size: 18px; }
.fd-btn.primary { background: var(--fd-brand); color: #fff; }
.fd-btn.teal { background: var(--fd-teal); color: #fff; }
.fd-btn.ghost { background: transparent; border: 1px solid var(--fd-line-strong); }
.fd-btn.block { width: 100%; }
.fd-btn.sm { padding: 9px 14px; font-size: 13px; border-radius: 11px; }

/* ---------- Hero financeiro ---------- */
.fd-hero-fin .top { display: flex; align-items: center; justify-content: space-between; }
.fd-hero-fin .value { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin: 6px 0 2px; }
.fd-hero-fin .due { font-size: 13.5px; color: var(--fd-muted); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.fd-hero-fin .actions { display: flex; gap: 10px; margin-top: 14px; }
.fd-hero-fin .actions .fd-btn { flex: 1; }

/* ---------- Quick actions ---------- */
.fd-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fd-quick a {
    text-decoration: none; color: var(--fd-ink);
    background: var(--fd-surface); border-radius: var(--fd-radius-sm);
    box-shadow: var(--fd-shadow-sm);
    padding: 13px 4px 10px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 700; line-height: 1.15;
}
.fd-quick a .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: var(--fd-brand-soft); color: var(--fd-brand-ink); }
.fd-quick a .ic.teal { background: var(--fd-teal-soft); color: var(--fd-teal-ink); }

/* ---------- List rows ---------- */
.fd-list { display: flex; flex-direction: column; }
.fd-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--fd-line); }
.fd-row:last-child { border-bottom: none; }
.fd-row .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; flex: none; background: var(--fd-surface-2); color: var(--fd-muted); }
.fd-row .ic.teal { background: var(--fd-teal-soft); color: var(--fd-teal-ink); }
.fd-row .ic.brand { background: var(--fd-brand-soft); color: var(--fd-brand-ink); }
.fd-row .grow { flex: 1; min-width: 0; }
.fd-row .grow b { font-weight: 800; font-size: 14.5px; display: block; }
.fd-row .grow span { font-size: 12.5px; color: var(--fd-muted); font-weight: 600; }
.fd-row .val { font-weight: 800; font-size: 14.5px; text-align: right; white-space: nowrap; }
.fd-row .val small { display: block; font-size: 11.5px; color: var(--fd-muted); font-weight: 700; }

/* ---------- Med progress ---------- */
.fd-prog { height: 7px; border-radius: 999px; background: #EFEDE8; overflow: hidden; margin-top: 8px; }
.fd-prog > i { display: block; height: 100%; border-radius: 999px; }

/* ---------- Info banner ---------- */
.fd-info { display: flex; gap: 11px; align-items: flex-start; }
.fd-info .ic { color: var(--fd-teal-ink); font-size: 22px; flex: none; margin-top: 1px; }
.fd-info b { font-weight: 800; }
.fd-info p { margin: 3px 0 0; font-size: 13px; color: var(--fd-muted); font-weight: 600; }

.fd-note { font-size: 12px; color: var(--fd-faint); font-weight: 700; display: flex; gap: 7px; align-items: flex-start; margin-top: 4px; }
.fd-note i { font-size: 15px; margin-top: 1px; }

/* ---------- Charts (epidemiológico) ---------- */
.fd-stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.fd-stat { background: var(--fd-surface); border-radius: var(--fd-radius-sm); box-shadow: var(--fd-shadow-sm); padding: 13px 10px; text-align: center; }
.fd-stat b { display: block; font-size: 24px; font-weight: 800; color: var(--fd-teal-ink); letter-spacing: -.5px; }
.fd-stat span { font-size: 11px; color: var(--fd-muted); font-weight: 700; }

.fd-bars { display: flex; flex-direction: column; gap: 9px; }
.fd-bar { display: grid; grid-template-columns: 78px 1fr 26px; align-items: center; gap: 8px; }
.fd-bar .k { font-size: 12.5px; font-weight: 700; color: var(--fd-muted); }
.fd-bar .track { height: 20px; border-radius: 7px; background: #F0EEE9; overflow: hidden; }
.fd-bar .track > i { display: block; height: 100%; background: var(--fd-teal); border-radius: 7px; }
.fd-bar .n { font-size: 12.5px; font-weight: 800; text-align: right; }

.fd-donut-wrap { display: flex; align-items: center; gap: 18px; }
.fd-donut { width: 118px; height: 118px; border-radius: 50%; flex: none; position: relative; }
.fd-donut::after { content: ""; position: absolute; inset: 26px; background: var(--fd-surface); border-radius: 50%; }
.fd-legend { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 700; }
.fd-legend span { display: flex; align-items: center; gap: 8px; color: var(--fd-muted); }
.fd-legend span i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.fd-legend span b { color: var(--fd-ink); }

/* ---------- Login (identidade próxima do ManagerLogin: foto + glass) ---------- */
.fd-login-page {
    min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end;
    position: relative; background: transparent;
}
.fd-login-bg {
    position: fixed; inset: 0; z-index: -1;
    background: #7a1338; overflow: hidden;
}
.fd-login-bg img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.fd-login-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(30,10,20,.55) 0%, rgba(30,10,20,.32) 42%, rgba(40,15,25,.78) 100%);
}
.fd-login-hero { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; padding: 48px 28px 10px; text-align: center; }
.fd-login-hero img { width: 300px; max-width: 60%; margin-bottom: 22px; }
.fd-login-hero h1 { font-size: 24px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.3px; }
.fd-login-hero p { font-size: 15px; opacity: .92; margin: 0; max-width: 300px; font-weight: 600; }
.fd-login-sheet {
    position: relative; z-index: 1;
    background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-radius: 26px 26px 0 0;
    padding: 26px 22px calc(30px + env(safe-area-inset-bottom, 0px));
    max-width: 480px; width: 100%; margin: 0 auto; color: #fff;
}
.fd-field { margin-bottom: 14px; min-width: 0; } /* min-width: filho de flex encolhe (Saída/Retorno lado a lado) */
.fd-field label { display: block; font-size: 12.5px; font-weight: 800; color: var(--fd-muted); margin-bottom: 6px; }
.fd-field input {
    width: 100%; min-width: 0; font-family: inherit; font-size: 16px; font-weight: 700;
    padding: 14px 16px; border-radius: 13px; border: 1px solid var(--fd-line-strong);
    background: var(--fd-surface); color: var(--fd-ink); outline: none;
}
/* iOS/Safari: date/time nativos têm largura INTRÍNSECA e ignoram width:100% dentro de flex —
   estouravam o card (Avisar uma saída). appearance:none faz respeitarem a caixa; o min-height
   compensa a altura que o Safari colapsa e o value volta a alinhar à esquerda (o iOS centra). */
.fd-field input[type="date"], .fd-field input[type="time"] {
    -webkit-appearance: none; appearance: none; min-height: 49px;
}
.fd-field input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.fd-field input:focus { border-color: var(--fd-brand); box-shadow: 0 0 0 3px var(--fd-brand-soft); }
.fd-login-sheet .fd-field label { color: rgba(255,255,255,.85); }
.fd-login-sheet .fd-field input { background: rgba(255,255,255,.92); border-color: rgba(255,255,255,.4); }
.fd-login-sheet .fd-btn.ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.fd-login-alt { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: rgba(255,255,255,.6); font-size: 12px; font-weight: 700; }
.fd-login-alt::before, .fd-login-alt::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.28); }
.fd-face { display: flex; align-items: center; justify-content: center; gap: 9px; }
.fd-help { text-align: center; font-size: 13px; color: rgba(255,255,255,.9); font-weight: 700; margin-top: 18px; }
.fd-help a { color: #fff; text-decoration: underline; }
.fd-help span { color: rgba(255,255,255,.6) !important; }

/* ---------- Notificações: canais preferidos ---------- */
/* ⚠️ Seletor de FILHO DIRETO (`> label`): a opção "Eu forneço" ganhou uma ciência com switch
   dentro dela, e um `.fd-choice label` solto pintaria o switch como se fosse mais uma opção. */
.fd-choice { display: flex; flex-direction: column; gap: 10px; }
.fd-choice > label,
.fd-choice > .fd-opt > label {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    border: 1.5px solid var(--fd-line); border-radius: 13px; padding: 13px 14px;
}
.fd-choice label.on { border-color: var(--fd-brand); background: var(--fd-brand-soft); }
.fd-choice label .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--fd-surface-2); color: var(--fd-muted); flex: none; }
.fd-choice label.on .ic { background: var(--fd-brand); color: #fff; }
.fd-choice label .grow { flex: 1; }
.fd-choice label .grow b { font-weight: 800; font-size: 14.5px; display: block; }
.fd-choice label .grow span { font-size: 12px; color: var(--fd-muted); font-weight: 600; }
.fd-choice label .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--fd-line-strong); display: grid; place-items: center; color: #fff; font-size: 14px; flex: none; }
.fd-choice label.on .mark { background: var(--fd-brand); border-color: var(--fd-brand); }

/* ---------- Ciência (cláusula das 72h) presa à opção "Eu forneço" ---------- */
/* O contrato deixou de ter card próprio: virou a ciência de quem escolhe fornecer — que é
   exatamente quem a cláusula obriga (dono 12/08). Fica ATRELADA à opção, com um degrau para
   a esquerda, para ninguém ler como um aviso solto da página. */
.fd-opt { display: flex; flex-direction: column; }
.fd-ciencia {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 8px 0 0 16px;
    background: var(--fd-amber-soft); border: 1px solid rgba(201, 133, 42, .22);
    border-radius: 12px; padding: 12px 13px;
}
.fd-ciencia > i { font-size: 19px; color: var(--fd-amber); flex: none; margin-top: 1px; }

/* Switch — o mesmo gesto do `form-check form-switch` do Manager, refeito nos tokens do draft
   (o protótipo não carrega Bootstrap). Checkbox CRU é proibido em todo o sistema. */
.fd-switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.fd-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.fd-switch .track {
    width: 38px; height: 22px; border-radius: 999px; flex: none; margin-top: 1px;
    background: #D9D4CC; position: relative; transition: background .16s ease;
}
.fd-switch .knob {
    position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .16s ease;
}
.fd-switch input:checked + .track { background: var(--fd-teal); }
.fd-switch input:checked + .track .knob { transform: translateX(16px); }
.fd-switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--fd-amber-soft), 0 0 0 4px var(--fd-amber); }
.fd-switch .txt { font-size: 12.5px; font-weight: 600; color: var(--fd-ink); line-height: 1.45; }
.fd-switch .txt b { font-weight: 800; }

/* ---------- Combo chart (financeiro) ---------- */
.fd-combo { width: 100%; height: auto; display: block; }
.fd-combo-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--fd-muted); }
.fd-combo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fd-combo-legend .swatch { width: 14px; height: 4px; border-radius: 2px; }
.fd-combo-legend .swatch.bar { height: 11px; width: 11px; border-radius: 3px; }

/* ---------- Misc ---------- */
.fd-hgroup h1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 6px 2px 2px; }
.fd-hgroup p { margin: 0 2px 14px; color: var(--fd-muted); font-weight: 600; font-size: 13.5px; }
.fd-backbar { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; }
.fd-backbar a { width: 38px; height: 38px; border-radius: 50%; background: var(--fd-surface); box-shadow: var(--fd-shadow-sm); display: grid; place-items: center; color: var(--fd-ink); text-decoration: none; font-size: 20px; }
.fd-backbar h1 { font-size: 18px; font-weight: 800; margin: 0; }
.fd-draft-flag {
    text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .3px;
    color: var(--fd-amber); background: var(--fd-amber-soft);
    padding: 5px; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fd-draft-flag a { color: var(--fd-brand-ink); text-decoration: underline; }
.fd-seg { display: flex; background: #EFEDE8; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.fd-seg button { flex: 1; border: none; background: transparent; font-family: inherit; font-weight: 800; font-size: 13px; color: var(--fd-muted); padding: 8px; border-radius: 9px; cursor: pointer; }
.fd-seg button.on { background: var(--fd-surface); color: var(--fd-ink); box-shadow: var(--fd-shadow-sm); }

/* ============================================================
   Foto de fundo sutil (o "jogo" do ManagerHome) + sidebar
   ============================================================ */
/* Foto de fundo sutil — renderizada só na tela inicial (via ViewData["Bg"]) */
.fd-bgphoto {
    position: fixed; inset: 0; z-index: -1;
    background-color: var(--fd-page);
    background-position: center; background-size: cover; background-repeat: no-repeat;
    filter: blur(7px) brightness(1.02); transform: scale(1.06);
}
.fd-bgphoto::after { content: ""; position: absolute; inset: 0; background: rgba(246, 244, 241, .90); }

.fd-shell { max-width: 480px; margin: 0 auto; }
.fd-topnav { display: none; }

/* ---------------- DESKTOP: menu no topo (estilo Nubank) ---------------- */
@media (min-width: 900px) {
    .fd-bgphoto::after { background: rgba(238, 233, 227, .92); }

    .fd-shell { max-width: none; margin: 0; }
    .fd-app { max-width: none; background: transparent; padding-bottom: 0; }

    .fd-topnav {
        display: flex; align-items: center; gap: 6px;
        position: sticky; top: 0; z-index: 40;
        padding: 12px 30px; background: var(--fd-surface);
        border-bottom: 1px solid var(--fd-line);
    }
    .fd-topnav .fd-brand { margin-right: 22px; }
    .fd-topnav .tn-links { display: flex; gap: 4px; flex: 1; }
    .fd-topnav .tn-links a {
        display: flex; align-items: center; gap: 8px; text-decoration: none;
        color: var(--fd-muted); font-weight: 700; font-size: 14.5px;
        padding: 9px 15px; border-radius: 11px;
    }
    .fd-topnav .tn-links a i { font-size: 20px; }
    .fd-topnav .tn-links a:hover { background: var(--fd-surface-2); color: var(--fd-ink); }
    .fd-topnav .tn-links a.active { background: var(--fd-brand-soft); color: var(--fd-brand-ink); }
    .fd-topnav .tn-user { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 13.5px; }
    .fd-topnav .tn-user .fd-avatar { background: var(--fd-brand-soft); color: var(--fd-brand-ink); }

    .fd-topbar { display: none; }
    .fd-nav { display: none; }
    .fd-draft-flag { border-radius: 0; }

    /* Conteúdo centralizado, 2 colunas com título colado no card */
    .fd-main { max-width: 1000px; margin: 0 auto; }
    .fd-content { padding: 26px 30px 64px; columns: 2; column-gap: 26px; }
    .fd-content > * { break-inside: avoid; }
    .fd-content > .fd-card,
    .fd-content > .fd-btn { margin-bottom: 16px; width: 100%; }
    /* Cada .fd-group (título + card) é um bloco atômico: nunca separa entre colunas.
       O respiro do topo vem do padding do grupo (ver a nota na regra base) — margem no topo
       de coluna é truncada e deixava a 2ª coluna colada no bloco de cima. */
    .fd-group { break-inside: avoid; }
    /* ⚠️ .fd-stat-cards NÃO entra aqui: ele quase sempre tem um título logo acima, e um
       spanner solto arranca o conteúdo da coluna deixando o título órfão do outro lado
       (foi o "Perfil dos residentes" flutuando na tela Unidade — dono 12/08). Quem atravessa
       as colunas é o WRAPPER .fd-span, com o título dentro. */
    .fd-greet, .fd-hgroup, .fd-backbar,
    .fd-quick, .fd-span { column-span: all; }
    .fd-hgroup h1 { font-size: 26px; }
    .fd-quick { grid-template-columns: repeat(4, 1fr); max-width: 640px; }
}

/* ---------------- Login centralizado no PC ---------------- */
@media (min-width: 900px) {
    .fd-login-page { justify-content: center; align-items: center; padding: 40px; }
    .fd-login-hero { flex: none; padding: 0 0 4px; }
    .fd-login-sheet {
        border-radius: 22px; max-width: 420px; margin: 20px auto 0;
        border: 1px solid rgba(255,255,255,.28);
    }
}

/* ============================================================
   EMBUTIDO NO APP (fd-in-app) — mesma régua do body.mn-app do Manager
   ============================================================ */
/* A barra de topo do app é NATIVA (MAUI). O que está aqui é a SIMULAÇÃO dela, para
   avaliarmos o portal com a altura e o comportamento certos no protótipo estático. */
.fd-appbar { display: none; }
.fd-appbar-nota { display: none; }

body.fd-in-app .fd-appbar {
    display: grid;
    grid-template-columns: 40px 1fr 40px 40px;
    align-items: center;
    gap: 2px;
    position: sticky; top: 0; z-index: 25;
    background: #fff;
    padding: 2px 6px;
    border-bottom: 1px solid var(--fd-line);
}
body.fd-in-app .fd-appbar .ab-btn {
    width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; position: relative;
    color: var(--fd-ink); text-decoration: none; font-size: 21px;
}
body.fd-in-app .fd-appbar .ab-title {
    font-size: 13.5px; font-weight: 800; color: var(--fd-ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 2px;
}
body.fd-in-app .fd-appbar .ab-badge {
    position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px;
    border-radius: 8px; background: var(--fd-brand); color: #fff;
    font-size: 9.5px; font-weight: 800; display: grid; place-items: center; padding: 0 4px;
}
body.fd-in-app .fd-appbar .ab-avatar {
    background: var(--fd-brand-soft); color: var(--fd-brand-ink);
    font-size: 13px; font-weight: 800; border-radius: 50%;
    width: 32px; height: 32px; justify-self: center;
}
body.fd-in-app .fd-appbar-nota {
    display: block; margin: 0; text-align: center;
    font-size: 10px; font-weight: 700; color: var(--fd-faint);
    background: var(--fd-bg); padding: 4px 8px 0;
}

/* O chrome WEB some (topo do desktop e do mobile); a barra INFERIOR fica — é a navegação
   do próprio portal, e o familiar não tem tab bar nativa. */
body.fd-in-app .fd-topnav,
body.fd-in-app .fd-topbar { display: none; }
/* A seta de voltar da página (AgendarSaida/Recados) sai: a barra nativa já tem a dela, e o
   título dela é o mesmo — dois "voltar" empilhados confundem. */
body.fd-in-app .fd-backbar { display: none; }

/* Dentro do app vale sempre a forma de celular, mesmo num WebView largo. */
body.fd-in-app .fd-shell { max-width: 480px; margin: 0 auto; }
body.fd-in-app .fd-app { max-width: 480px; background: var(--fd-bg); padding-bottom: 92px; }
body.fd-in-app .fd-main { max-width: 480px; }
body.fd-in-app .fd-content { padding: 4px 16px 24px; columns: 1; }
body.fd-in-app .fd-nav { display: grid; }

/* ============================================================
   Blocos de conteúdo (visitas, saídas, unidade, contatos)
   ============================================================ */

/* Trio de números DENTRO de um card (menor que o .fd-stat-cards, que é bloco de página) */
.fd-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fd-metrics > div { background: var(--fd-surface-2); border-radius: var(--fd-radius-sm); padding: 11px 8px; text-align: center; }
.fd-metrics b { display: block; font-size: 21px; font-weight: 800; color: var(--fd-teal-ink); letter-spacing: -.4px; line-height: 1.15; }
.fd-metrics span { font-size: 10.5px; color: var(--fd-muted); font-weight: 700; }

/* Aviso de privacidade — visual deliberadamente diferente da .fd-note (é regra, não rodapé) */
.fd-privacy {
    display: flex; align-items: flex-start; gap: 9px;
    background: var(--fd-surface-2); border: 1px dashed var(--fd-line-strong);
    border-radius: var(--fd-radius-sm); padding: 11px 12px; margin-top: 12px;
}
.fd-privacy i { font-size: 18px; color: var(--fd-muted); flex: none; margin-top: 1px; }
.fd-privacy p { margin: 0; font-size: 12px; font-weight: 700; color: var(--fd-muted); }

/* Linha de visita sem identificação autorizada */
.fd-anon b { color: var(--fd-faint); font-style: italic; }

/* Bloco de funcionalidade FUTURA (dia a dia do residente) */
.fd-soon {
    border: 1.5px dashed var(--fd-line-strong); border-radius: var(--fd-radius);
    padding: 16px; background: transparent;
}
.fd-soon .hd { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.fd-soon .hd i { font-size: 21px; color: var(--fd-teal-ink); }
.fd-soon .hd b { font-weight: 800; font-size: 15px; }
.fd-soon p { margin: 0 0 12px; font-size: 13px; color: var(--fd-muted); font-weight: 600; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fd-chips span {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--fd-surface); border: 1px solid var(--fd-line);
    border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--fd-muted);
}
.fd-chips span i { font-size: 15px; }

/* Referência de saúde no entorno (hospital / PS / UBS / AMA) */
.fd-place { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--fd-line); }
.fd-place:last-child { border-bottom: none; }
.fd-place .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; flex: none; }
.fd-place .ic.hosp { background: var(--fd-red-soft); color: var(--fd-red); }
.fd-place .ic.ubs { background: var(--fd-teal-soft); color: var(--fd-teal-ink); }
.fd-place .grow { flex: 1; min-width: 0; }
.fd-place .grow b { font-weight: 800; font-size: 14.5px; display: block; }
.fd-place .grow span { font-size: 12.5px; color: var(--fd-muted); font-weight: 600; display: block; }
.fd-place .acts { display: flex; gap: 8px; margin-top: 8px; }
.fd-place .acts a {
    display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
    font-size: 12px; font-weight: 800; color: var(--fd-brand-ink);
    background: var(--fd-brand-soft); border-radius: 9px; padding: 5px 10px;
}
.fd-place .acts a i { font-size: 15px; }
.fd-place .dist { font-size: 12px; font-weight: 800; color: var(--fd-muted); white-space: nowrap; flex: none; }

/* Cabeçalho de endereço/telefone da unidade */
.fd-endereco { display: flex; align-items: flex-start; gap: 12px; }
.fd-endereco .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: none; background: var(--fd-brand-soft); color: var(--fd-brand-ink); }
.fd-endereco b { display: block; font-weight: 800; font-size: 15px; }
.fd-endereco span { display: block; font-size: 13px; color: var(--fd-muted); font-weight: 600; }
.fd-acoes-linha { display: flex; gap: 10px; margin-top: 14px; }
.fd-acoes-linha .fd-btn { flex: 1; }

/* ============================================================
   PENDÊNCIAS — bloco único do que depende da família
   ============================================================ */
/* Vacina, reposição de item, documento: mesma lista. Cada linha carrega CATEGORIA, PRAZO e
   CONSEQUÊNCIA — a categoria porque imunização e medicamento se confundem no mesmo bloco,
   prazo e consequência porque é isso que o contrato prevê e o que a família precisa decidir.
   ⚠️ Não existe estado "vencida": o prazo é sempre futuro (ver a nota no Mock.cs). */
.fd-pend { display: flex; flex-direction: column; }
.fd-pend-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--fd-line); }
.fd-pend-item:first-child { padding-top: 0; }
.fd-pend-item:last-child { border-bottom: none; padding-bottom: 0; }
.fd-pend-item .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 21px; flex: none; }
.fd-pend-item.atencao .ic { background: var(--fd-amber-soft); color: var(--fd-amber); }
.fd-pend-item.info .ic { background: var(--fd-teal-soft); color: var(--fd-teal-ink); }
.fd-pend-item .bd { flex: 1; min-width: 0; }
.fd-pend-item .cat {
    display: block; font-size: 10px; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; color: var(--fd-faint); margin-bottom: 2px;
}
.fd-pend-item .tt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fd-pend-item .tt b { font-weight: 800; font-size: 14.5px; }
.fd-pend-item p { margin: 4px 0 0; font-size: 12.5px; color: var(--fd-muted); font-weight: 600; }
.fd-pend-item .cons { display: flex; align-items: flex-start; gap: 7px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--fd-muted); }
.fd-pend-item .cons i { font-size: 15px; flex: none; margin-top: 1px; color: var(--fd-amber); }
.fd-pend-item .fd-btn { margin-top: 10px; }

/* ---------- CHECKLIST das pendências (Início) ----------
   Na Início a pendência é só "o que falta": título, categoria e prazo, uma linha por item.
   Detalhe, consequência e ação moram na página da área — o dono pediu objetividade aqui
   (12/08), e um bloco com três parágrafos por pendência afogava a home. */
.fd-chklist { display: flex; flex-direction: column; }
.fd-chk {
    display: flex; align-items: center; gap: 11px; padding: 11px 0;
    border-bottom: 1px solid var(--fd-line); text-decoration: none; color: inherit;
}
.fd-chk:first-child { padding-top: 0; }
.fd-chk:last-child { border-bottom: none; padding-bottom: 0; }
.fd-chk .box {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    display: grid; place-items: center; font-size: 19px;
    background: var(--fd-surface-2); color: var(--fd-muted);
}
.fd-chk.atencao .box { background: var(--fd-amber-soft); color: var(--fd-amber); }
.fd-chk.info .box { background: var(--fd-teal-soft); color: var(--fd-teal-ink); }
.fd-chk .grow { flex: 1; min-width: 0; }
.fd-chk .grow b { display: block; font-weight: 800; font-size: 14px; line-height: 1.3; }
.fd-chk .cat { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fd-faint); }
.fd-chk .fd-pill { flex: none; }
.fd-chk .chev { color: var(--fd-faint); font-size: 18px; flex: none; }

/* ============================================================
   Quadro de visitas — MESMO desenho do "Sua presença em números" do BelaVisitas
   ============================================================ */
/* O familiar já vê esse painel ao registrar a visita na portaria; reusar o desenho faz a
   Área do Cliente parecer continuação daquilo. Muda só o SUJEITO: lá é a presença DELE,
   aqui são as visitas RECEBIDAS pelo residente. Valores portados do BelaVisitas.cshtml. */
/* O quadro por fora é um CARD BRANCO como os vizinhos (dono 12/08: sinergia com os demais
   blocos); o rosa translúcido/vidro migrou para DENTRO — tiles e gráfico. */
.fd-reward {
    border-radius: var(--fd-radius); padding: 18px 15px 12px;
    background: var(--fd-surface); box-shadow: var(--fd-shadow);
    margin-bottom: 14px;
}
.fd-eyebrow {
    font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--fd-ink);
    font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; justify-content: center;
}
.fd-eyebrow::before, .fd-eyebrow::after { content: ""; height: 1px; width: 30px; background: rgba(230, 56, 136, .22); }
.fd-rstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.fd-rstat {
    border-radius: 14px; padding: 13px 6px; text-align: center; border: 1px solid rgba(230, 56, 136, .18);
    background: linear-gradient(160deg, rgba(230, 56, 136, .12), rgba(230, 56, 136, .03));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.fd-rstat .big { font-weight: 800; font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--fd-brand-ink); }
.fd-rstat .cap { font-size: .68rem; color: var(--fd-muted); font-weight: 600; margin-top: 5px; line-height: 1.28; }
.fd-rstat .cap b { color: var(--fd-ink); }
.fd-rchart {
    border-radius: 14px; padding: 13px 13px 7px; border: 1px solid rgba(230, 56, 136, .20);
    background: linear-gradient(135deg, rgba(230, 56, 136, .16), rgba(230, 56, 136, .04));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.fd-rchart .h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.fd-rchart .h b { font-size: .84rem; font-weight: 800; }
.fd-rchart .h span { font-size: .7rem; color: var(--fd-muted); font-weight: 700; }
svg.fd-rbars { width: 100%; height: 116px; display: block; overflow: visible; }
.fd-rfrase { display: flex; gap: 10px; align-items: flex-start; margin: 13px 2px 2px; }
.fd-rfrase .h { flex: none; margin-top: 1px; font-size: 1.05rem; }
.fd-rfrase p { margin: 0; font-size: .9rem; color: var(--fd-ink); line-height: 1.5; font-weight: 600; }
.fd-rfrase p b { color: var(--fd-brand-ink); }
@media (max-width: 560px) {
    .fd-rstats { grid-template-columns: 1fr 1fr; }
    .fd-rstats .fd-rstat:last-child { grid-column: 1 / -1; }
}

/* ============================================================
   ANIVERSÁRIO — o único bloco COMEMORATIVO do portal
   ============================================================ */
/* Sobe para logo abaixo dos atalhos e atravessa as duas colunas (dono 12/08: "algo bom
   precisa ser comemorado"). É o único lugar do protótipo com fundo saturado e movimento —
   e é assim de propósito: se tudo brilhasse, nada brilharia. */
.fd-bday {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
    border-radius: var(--fd-radius); padding: 18px; margin-bottom: 14px; color: #fff;
    background: linear-gradient(128deg, #E63888 0%, #C33C9E 46%, #8B4FBE 100%);
    box-shadow: 0 10px 26px rgba(230, 56, 136, .26);
}
/* Confete: pontos fixos, sem imagem nem script */
.fd-bday::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .6;
    background:
        radial-gradient(circle at 11% 24%, #FFD166 0 3px, transparent 3.5px),
        radial-gradient(circle at 26% 76%, #9BE6C8 0 2.5px, transparent 3px),
        radial-gradient(circle at 41% 12%, #FFFFFF 0 2px, transparent 2.5px),
        radial-gradient(circle at 57% 86%, #FFD166 0 2.5px, transparent 3px),
        radial-gradient(circle at 73% 20%, #FFFFFF 0 2.5px, transparent 3px),
        radial-gradient(circle at 88% 64%, #9BE6C8 0 3px, transparent 3.5px),
        radial-gradient(circle at 95% 30%, #FFD166 0 2px, transparent 2.5px);
}
/* Brilho que atravessa devagar e descansa — chama o olho sem virar pisca-pisca */
.fd-bday::after {
    content: ""; position: absolute; top: -60%; left: 0; width: 34%; height: 220%; z-index: -1;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.30), transparent);
    animation: fd-shine 5.5s ease-in-out infinite;
}
@keyframes fd-shine {
    0% { transform: translateX(-160%) rotate(14deg); }
    55%, 100% { transform: translateX(420%) rotate(14deg); }
}
.fd-bday .ic {
    width: 60px; height: 60px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-size: 30px; line-height: 1;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.38);
    animation: fd-bob 3.4s ease-in-out infinite;
}
@keyframes fd-bob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-5px) rotate(4deg); }
}
.fd-bday .ey {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: rgba(255,255,255,.88);
}
.fd-bday .ey i { font-size: 14px; }
.fd-bday .bd > b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.3px; margin-top: 3px; }
.fd-bday .bd p { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }
.fd-bday .acts { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.fd-bday .acts .fd-btn { background: #fff; color: var(--fd-brand-ink); }

/* Vela acesa sobre o bolo: pavio + chama em gota, tremulando com brilho */
.fd-bday .vela {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    width: 5px; height: 14px; border-radius: 2px;
    background: repeating-linear-gradient(-45deg, #fff 0 3px, #F7B2CF 3px 6px);
}
.fd-bday .vela::before { /* pavio */
    content: ""; position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
    width: 1.5px; height: 4px; background: #6b4a2f;
}
.fd-bday .flame {
    position: absolute; top: -13px; left: 50%;
    width: 9px; height: 12px; transform-origin: 50% 100%;
    background: radial-gradient(circle at 50% 78%, #fff 0 18%, #FFE08A 42%, #FFAB3D 72%, rgba(255,120,40,0) 100%);
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    filter: drop-shadow(0 0 6px rgba(255, 200, 90, .85));
    animation: fd-flame 1s ease-in-out infinite;
}
@keyframes fd-flame {
    0%, 100% { transform: translateX(-50%) scale(1) rotate(-2deg); }
    30%      { transform: translateX(-52%) scale(1.12, .92) rotate(3deg); }
    60%      { transform: translateX(-48%) scale(.92, 1.1) rotate(-3deg); }
}

/* Fogos de artifício: um ponto sobe (.fw) e explode em partículas (::after em leque radial).
   Três lançamentos com posição, cor e atraso diferentes para nunca estourarem juntos. */
.fd-bday .fw { position: absolute; bottom: 6px; width: 3px; height: 3px; border-radius: 50%; pointer-events: none; }
.fd-bday .fw::before { /* o rojão subindo */
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: #FFE08A; box-shadow: 0 0 6px 1px rgba(255, 224, 138, .9);
    animation: fd-fw-sobe var(--fw-t, 3.2s) var(--fw-d, 0s) ease-in infinite;
}
.fd-bday .fw::after { /* a explosão: partículas em radial-gradient escalando e sumindo */
    content: ""; position: absolute; left: -34px; top: calc(var(--fw-alt, -74px) - 34px);
    width: 70px; height: 70px; border-radius: 50%; opacity: 0;
    background:
        radial-gradient(circle at 50% 8%,  var(--fw-c, #FFD166) 0 2.6px, transparent 3px),
        radial-gradient(circle at 82% 22%, #fff 0 2px, transparent 2.4px),
        radial-gradient(circle at 94% 52%, var(--fw-c, #FFD166) 0 2.4px, transparent 2.8px),
        radial-gradient(circle at 82% 82%, #fff 0 2px, transparent 2.4px),
        radial-gradient(circle at 50% 94%, var(--fw-c, #FFD166) 0 2.6px, transparent 3px),
        radial-gradient(circle at 17% 82%, #fff 0 2px, transparent 2.4px),
        radial-gradient(circle at 5% 52%,  var(--fw-c, #FFD166) 0 2.4px, transparent 2.8px),
        radial-gradient(circle at 17% 22%, #fff 0 2px, transparent 2.4px);
    animation: fd-fw-explode var(--fw-t, 3.2s) var(--fw-d, 0s) ease-out infinite;
}
.fd-bday .fw.f1 { left: 12%; --fw-c: #FFD166; --fw-t: 3.4s; --fw-d: 0s;    --fw-alt: -78px; }
.fd-bday .fw.f2 { left: 55%; --fw-c: #9BE6C8; --fw-t: 3.9s; --fw-d: 1.3s;  --fw-alt: -64px; }
.fd-bday .fw.f3 { left: 86%; --fw-c: #BFD3FF; --fw-t: 3.6s; --fw-d: 2.4s;  --fw-alt: -84px; }
@keyframes fd-fw-sobe {
    0%       { transform: translateY(0); opacity: 0; }
    5%       { opacity: 1; }
    38%      { transform: translateY(var(--fw-alt, -74px)); opacity: 1; }
    42%,100% { transform: translateY(var(--fw-alt, -74px)); opacity: 0; }
}
@keyframes fd-fw-explode {
    0%, 38%  { transform: scale(.15); opacity: 0; }
    46%      { transform: scale(.7);  opacity: 1; }
    72%      { transform: scale(1.15) translateY(6px); opacity: 0; }
    100%     { transform: scale(1.15); opacity: 0; }
}
.fd-bday .cd {
    flex: none; text-align: center; padding: 11px 16px; border-radius: 15px;
    background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.34);
}
.fd-bday .cd b { display: block; font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.fd-bday .cd span { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); }
/* No celular a contagem sobe para a linha do bolo e o texto ocupa a largura inteira */
@media (max-width: 560px) {
    .fd-bday { grid-template-columns: auto 1fr; row-gap: 13px; column-gap: 12px; }
    .fd-bday .ic { grid-area: 1 / 1; width: 52px; height: 52px; font-size: 26px; }
    .fd-bday .cd { grid-area: 1 / 2; justify-self: end; display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; }
    .fd-bday .cd b { font-size: 22px; }
    .fd-bday .bd { grid-area: 2 / 1 / 3 / -1; }
    /* Os dois botões não cabem lado a lado em 343px e quebravam desalinhados, com larguras
       diferentes — empilhados na largura inteira o degrau parece decisão, não acidente. */
    .fd-bday .acts { flex-direction: column; }
    .fd-bday .acts .fd-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .fd-bday::after, .fd-bday .ic, .fd-bday .flame,
    .fd-bday .fw::before, .fd-bday .fw::after { animation: none; }
    .fd-bday .fw { display: none; } /* sem animação o rojão parado é só um pontinho perdido */
}

/* Miniatura da unidade na Início: logo/fachada, não a planta (a planta é da tela Unidade) */
.fd-fachada { width: 100%; height: 132px; object-fit: cover; border-radius: var(--fd-radius-sm); display: block; background: var(--fd-surface-2); }

/* Face ID de retorno (dispositivo já cadastrado → valida direto) */
.fd-bio { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 6px; }
.fd-bio-btn {
    width: 92px; height: 92px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14);
    color: #fff; display: grid; place-items: center; font-size: 42px; cursor: pointer;
    animation: fdpulse 2.2s infinite;
}
.fd-bio-btn:active { transform: scale(.97); }
@keyframes fdpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.30); } 50% { box-shadow: 0 0 0 14px rgba(255,255,255,0); } }
.fd-bio b { color: #fff; font-size: 15px; }
.fd-bio span { color: rgba(255,255,255,.78); font-size: 12.5px; }
