:root {
  --brand: #4f7cff;
  --brand-ink: #fff;
  --bg: #f6f7fb;
  --card: #fff;
  --ink: #1d2433;
  --muted: #5d6678;
  --line: #e1e5ee;
  --soft: #eef2ff;
  --ok: #1b8a4a;
  --err: #c62828;
  --warn: #b26a00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
.hidden { display: none !important; }

/* Layout */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth { width: 100%; max-width: 400px; padding: 28px 22px; }
.brandmark { display: flex; justify-content: center; margin: -4px 0 14px; }
.brandmark img { width: min(220px, 70%); height: auto; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p.sub, .muted { color: var(--muted); }
p.sub { margin: 0 0 18px; }
.small { font-size: 13px; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding: max(10px, env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.topbar .logo { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--soft); }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .elk { height: 26px; width: auto; flex-shrink: 0; }
@media (max-width: 360px) { .topbar .elk { height: 20px; } }
.topbar .title span { font-size: 13px; color: var(--muted); }
main.page { padding: 16px 16px 96px; max-width: 760px; margin: 0 auto; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; background: none; border: 0; padding: 10px 2px 8px; font-size: 12px; color: var(--muted); display: grid; justify-items: center; gap: 2px; cursor: pointer; }
.tabs button .ic { font-size: 20px; line-height: 1; }
.tabs button[aria-current="page"] { color: var(--brand); font-weight: 700; }

/* Forms */
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 16px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.row > .shrink { flex: 0 0 auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 10px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 44px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.block { width: 100%; margin-top: 18px; }
.btn.danger { color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sm { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.linkbtn { background: none; border: 0; color: var(--brand); font-weight: 600; padding: 6px 0; cursor: pointer; }

.msg { margin-top: 12px; font-size: 14px; min-height: 20px; }
.msg.err { color: var(--err); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > .fl { font-weight: 700; font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.meal { display: grid; gap: 6px; margin-bottom: 10px; }
.meal .ml { font-size: 13px; color: var(--muted); }
.nap { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.nap input { flex: 1; }

/* Lists */
.list { display: grid; gap: 10px; }
.list > * { min-width: 0; }
html, body { overflow-x: hidden; }
.item { padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-weight: 700; }
.item .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.selectable { cursor: pointer; }
.item input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--brand); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; color: var(--brand); flex: 0 0 auto; }
.section { margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section h2 { margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar > * { flex: 1 1 140px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

/* Sheet (tela cheia no celular) */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 14, 25, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 760px; max-height: 94vh; overflow: auto; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.sheet-head { position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 10px; z-index: 1; }
.sheet-head b { flex: 1; }
.sheet-body { padding: 14px 16px 24px; }
.sheet-foot { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 800px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; width: 28px; height: 28px; cursor: pointer; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.bubble { padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.bubble .who { font-size: 12px; color: var(--muted); margin-top: 4px; }

#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; }
#toast.err { background: var(--err); }
.selbar { position: fixed; left: 0; right: 0; bottom: 64px; z-index: 7; display: flex; justify-content: center; padding: 0 16px; }
.selbar .card { display: flex; gap: 8px; align-items: center; padding: 8px 10px; width: 100%; max-width: 728px; }
.selbar .card span { flex: 1; font-weight: 600; font-size: 14px; }
pre.csv { background: var(--soft); padding: 10px; border-radius: 10px; overflow: auto; font-size: 13px; }

/* Pacote 3 */
.badge.warn { color: var(--warn); background: rgba(178, 106, 0, .12); }
.term { white-space: pre-line; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin: 12px 0; background: var(--bg); }
.bubble.unread { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.reply { margin: 8px 0 0 12px; padding: 8px 10px; border-left: 3px solid var(--line); background: var(--bg); border-radius: 0 8px 8px 0; font-size: 14px; }
ol { padding-left: 20px; } ol li { margin: 4px 0; }

/* Pacote 4 */
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 4px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
h3.month { margin: 18px 0 8px; color: var(--muted); font-size: 14px; }
.card.event { padding: 12px 14px; }
.card.event.past { opacity: .6; }
.datebox { width: 48px; text-align: center; background: var(--soft); border-radius: 10px; padding: 6px 0; line-height: 1.1; }
.datebox b { display: block; font-size: 20px; }
.datebox span { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.menu-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.menu-row:first-of-type { border-top: 0; }
.card.today { border-color: var(--brand); }
.authz-kid { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.small.ok, .ok { color: var(--ok); } .small.err { color: var(--err); } .warn { color: var(--warn); }
.tabs button { font-size: 11px; }

/* ===== Visual B · Vidro colorido (aprovado em 02/11/2026) ===== */
@font-face { font-family: "Baloo 2"; src: url(/fonts/baloo-2-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url(/fonts/baloo-2-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: Nunito; src: url(/fonts/nunito-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Nunito; src: url(/fonts/nunito-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Nunito; src: url(/fonts/nunito-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Nunito; src: url(/fonts/nunito-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
:root { --navy: #27396e; --coral: #f4685a; --yellow: #f8c94a; --mint: #5fc9a0; --sky: #5bb4e5; --radius: 18px; --shadow: 0 6px 18px rgba(20, 30, 70, .08); }
h1, h2, .hero-title { font-family: "Baloo 2", Nunito, system-ui, sans-serif; font-weight: 800; letter-spacing: -.2px; }
h1 { font-size: 26px; line-height: 1.1; }
h2 { font-size: 20px; line-height: 1.15; }
.btn, .chip, input, select, textarea { border-radius: 14px; }
.btn.primary { box-shadow: 0 8px 18px rgba(20, 30, 70, .16); }

/* Fundo colorido (app) */
html { background: var(--navy); }
body.inapp { background: transparent; }
body.inapp::before { content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(120% 55% at 0% 0%, var(--sky) 0%, transparent 60%), radial-gradient(90% 55% at 100% 15%, var(--coral) 0%, transparent 60%), radial-gradient(90% 60% at 50% 100%, var(--mint) 0%, transparent 60%), var(--navy); }
body.inapp.fam::before { background: radial-gradient(120% 55% at 100% 0%, var(--yellow) 0%, transparent 55%), radial-gradient(90% 55% at 0% 25%, var(--coral) 0%, transparent 60%), radial-gradient(90% 60% at 50% 100%, var(--sky) 0%, transparent 60%), var(--navy); }
body.inapp .topbar { background: rgba(23, 33, 72, .28); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255, 255, 255, .18); color: #fff; }
body.inapp .topbar .title span { color: rgba(255, 255, 255, .85); }
body.inapp .topbar .btn.ghost { color: #fff; font-size: 20px; }
body.inapp .topbar .logo, body.inapp .topbar .avatar { background: #fff; border-radius: 12px; }
body.inapp .topbar .elk { background: #fff; border-radius: 10px; padding: 3px 7px; box-sizing: content-box; height: 22px; }
@media (max-width: 360px) { body.inapp .topbar .elk { height: 17px; } }
.hero { max-width: 760px; margin: 0 auto; padding: 16px 18px 14px; color: #fff; }
.hero-title { font-size: 30px; line-height: 1.05; margin: 0; text-shadow: 0 2px 12px rgba(10, 15, 40, .25); }
.hero-meta { margin: 4px 0 0; font-weight: 700; font-size: 14px; color: rgba(255, 255, 255, .9); }
.hero-photo { margin-top: 14px; height: 120px; border-radius: 22px; background-size: cover; background-position: center; box-shadow: 0 10px 26px rgba(10, 15, 40, .25); border: 1px solid rgba(255, 255, 255, .35); }
@media (min-width: 600px) { .hero-photo { height: 170px; } }
body.inapp main.page { background: rgba(246, 248, 252, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 26px 26px 0 0; min-height: 100vh; padding-bottom: 120px; box-shadow: 0 -8px 30px rgba(10, 15, 40, .12); }
body.inapp .card { border-color: rgba(225, 229, 238, .8); }
body.inapp .tabs { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); border-radius: 22px; padding: 4px; background: rgba(39, 57, 110, .62); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, .3); box-shadow: 0 10px 30px rgba(10, 15, 40, .3); max-width: 736px; margin: 0 auto; }
body.inapp .tabs button { color: rgba(255, 255, 255, .78); border-radius: 18px; padding: 8px 2px 6px; }
body.inapp .tabs button[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .2); }
body.inapp .selbar { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px); }
body.inapp #toast { bottom: 110px; }

/* Telas de entrada (Entrar, convite, termo) */
.center.authwrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 18px; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background-image: linear-gradient(180deg, rgba(39, 57, 110, 0) 0%, rgba(39, 57, 110, 0) 38%, rgba(39, 57, 110, .96) 60%, rgba(244, 104, 90, .95) 100%), url(/img/blocos.webp), linear-gradient(180deg, var(--navy), var(--coral));
  background-size: cover, 100% auto, cover; background-position: center, center top, center; background-repeat: no-repeat; }
@media (min-width: 700px) { .center.authwrap { justify-content: center; background-image: linear-gradient(180deg, rgba(39, 57, 110, .35), rgba(244, 104, 90, .75)), url(/img/blocos.webp); background-size: cover, cover; background-position: center, center 30%; } }
.authwrap .brandmark { margin: 0 auto auto; background: rgba(255, 255, 255, .95); border-radius: 22px; padding: 10px 18px; box-shadow: 0 10px 26px rgba(10, 15, 40, .2); }
@media (min-width: 700px) { .authwrap .brandmark { margin: 0; } }
.authwrap .brandmark img { width: 150px; }
.card.auth.glass { background: rgba(32, 46, 96, .58); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(255, 255, 255, .38); border-radius: 26px; box-shadow: 0 16px 40px rgba(10, 15, 40, .25); color: #fff; }
.glass h1, .glass h2, .glass h3, .glass label { color: #fff; }
.glass p.sub, .glass .muted { color: rgba(255, 255, 255, .9); }
.glass a, .glass .linkbtn { color: #fff; }
.glass .msg.err, .glass .small.err { color: #fff; background: rgba(198, 40, 40, .55); border-radius: 10px; padding: 6px 10px; }
.glass .msg.ok, .glass .ok { color: #dff7ea; }
.glass input[type=text], .glass input[type=password], .glass input[type=email], .glass input[type=tel] { background: rgba(255, 255, 255, .94); border-color: transparent; color: var(--ink); }
.glass .btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy); font-weight: 800; }
.glass .btn:not(.primary) { background: rgba(255, 255, 255, .9); color: var(--navy); border-color: transparent; }
.glass .btn.ghost { background: transparent; color: #fff; }
.glass .term { background: rgba(255, 255, 255, .95); color: var(--ink); border-color: transparent; }
.glass .note { background: rgba(255, 255, 255, .9); color: var(--ink); }
.glass input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--yellow); flex-shrink: 0; }
