/* =====================================================================
   DOVYR HEALTH · base
   Mesma linguagem do DOVYR FINANCE: Inter, grafite, verde ácido só como
   destaque. Tema escuro (padrão) e cinza névoa (html[data-theme=light]).
   ===================================================================== */
@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-Regular.woff") format("woff"); font-weight: 100 449; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-Medium.woff") format("woff"); font-weight: 450 549; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-SemiBold.woff") format("woff"); font-weight: 550 649; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-Bold.woff") format("woff"); font-weight: 650 1000; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../assets/fonts/InterDisplay-Medium.woff") format("woff"); font-weight: 100 549; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../assets/fonts/InterDisplay-SemiBold.woff") format("woff"); font-weight: 550 649; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../assets/fonts/InterDisplay-Bold.woff") format("woff"); font-weight: 650 1000; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #080a0c; --shell: #0b0e10; --raised: #111417; --raised-2: #15191c; --field: #0f1316;
  --pop: rgba(16, 20, 23, .97);
  --rule: rgba(255, 255, 255, .075); --rule-2: rgba(255, 255, 255, .05); --line: rgba(255, 255, 255, .14); --line-strong: rgba(255, 255, 255, .24);
  --ink: #f2f0e9; --ink-2: #d9d6cd; --ink-3: #9da3aa; --ink-4: #6f767c; --faint: rgba(242, 240, 233, .34);
  --acid: #d8ff3e; --on-acid: #050608; --acid-text: #d8ff3e; --acid-wash: rgba(216, 255, 62, .07); --acid-line: rgba(216, 255, 62, .3);
  --gain: #d8ff3e; --loss: #ff626e; --caution: #f1c66b;
  --hover: rgba(255, 255, 255, .045); --press: rgba(255, 255, 255, .07);
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --veil: rgba(4, 5, 7, .62);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Inter Display", "Inter", ui-sans-serif, -apple-system, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sb: 248px;
  /* paleta curta: ácido + azul-aço + areia; painéis */
  --acid-fill: #d8ff3e; --tone-a: #dedcd6; --tone-a-wash: rgba(222, 220, 214, .1); --tone-b: #6b7178; --tone-b-wash: rgba(107, 113, 120, .18); --st-low: #ff4d4d; --st-low-wash: rgba(255, 77, 77, .13);
  --panel: #0d1114; --panel-2: #12171b; --panel-line: rgba(255, 255, 255, .07);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f2; --shell: #e6e9ec; --raised: #f8f9fa; --raised-2: #f3f5f7; --field: #f9fafb;
  --pop: rgba(250, 251, 252, .98);
  --rule: rgba(20, 24, 30, .09); --rule-2: rgba(20, 24, 30, .06); --line: rgba(20, 24, 30, .16); --line-strong: rgba(20, 24, 30, .26);
  --ink: #16191d; --ink-2: #2d3238; --ink-3: #5c636b; --ink-4: #7b828a; --faint: rgba(22, 25, 29, .38);
  --acid: #d8ff3e; --on-acid: #111316; --acid-text: #5e7a00; --acid-wash: rgba(140, 175, 0, .12); --acid-line: rgba(110, 140, 0, .42);
  --gain: #8fb000; --loss: #b43a40; --caution: #9a6b10;
  --hover: rgba(20, 24, 30, .045); --press: rgba(20, 24, 30, .07);
  --shadow: 0 24px 60px rgba(20, 24, 30, .14);
  --veil: rgba(30, 34, 40, .28);
  --acid-fill: #a9cc1f; --tone-a: #2b3036; --tone-a-wash: rgba(43, 48, 54, .08); --tone-b: #9aa0a7; --tone-b-wash: rgba(154, 160, 167, .2); --st-low: #d92d2d; --st-low-wash: rgba(217, 45, 45, .1);
  --panel: #f9fafb; --panel-2: #f2f4f6; --panel-line: rgba(20, 24, 30, .085);
}
html.theme-anim, html.theme-anim * { transition: background-color .35s ease, border-color .35s ease, color .35s ease, fill .35s ease, stroke .35s ease !important; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
::selection { background: rgba(216, 255, 62, .28); color: var(--ink); }
html[data-theme="light"] ::selection { background: rgba(160, 200, 0, .35); }
:focus-visible { outline: 1.5px solid var(--acid-text); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.drag { -webkit-app-region: drag; }
.nodrag { -webkit-app-region: no-drag; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* logo: a palavra DOVYR desenhada pelo SVG, na cor do texto */
.wordmark { display: block; width: 104px; aspect-ratio: 1020 / 192; background: var(--ink); -webkit-mask: url("../assets/dovyr-wordmark.svg") center / contain no-repeat; mask: url("../assets/dovyr-wordmark.svg") center / contain no-repeat; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand small { font: 400 10px/1 var(--font); letter-spacing: .9em; text-transform: uppercase; color: var(--ink-3); margin-left: 2px; }

/* títulos */
.h-display { font: 600 44px/1.04 var(--display); letter-spacing: -.035em; margin: 0; }
.h-display em, .h-page em { font-style: normal; color: var(--acid-text); }
.h-page { font: 600 34px/1.08 var(--display); letter-spacing: -.03em; margin: 0; }
.h-page .dot { color: var(--acid-text); }
.h-sec { font: 500 17px/1.3 var(--font); letter-spacing: -.01em; margin: 0; }
.lead { color: var(--ink-3); font-size: 15px; line-height: 1.55; margin: 0; max-width: 62ch; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px; font-weight: 550; font-size: 14px; letter-spacing: -.005em; transition: background .2s var(--ease), border-color .2s, color .2s, transform .15s var(--ease), opacity .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { pointer-events: none; opacity: 1; background: transparent !important; color: var(--ink-4) !important; box-shadow: inset 0 0 0 1px var(--line); }
.btn svg { width: 16px; height: 16px; }
.btn-acid { background: var(--acid); color: var(--on-acid); }
.btn-acid:hover { background: #e3ff6e; }
.btn-line { border: 1px solid var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--line-strong); background: var(--hover); }
.btn-ghost { color: var(--ink-3); padding: 0 10px; }
.btn-ghost:hover { color: var(--ink); background: var(--hover); }
.btn-danger { border: 1px solid color-mix(in srgb, var(--loss) 45%, transparent); color: var(--loss); }
.btn-danger:hover { background: color-mix(in srgb, var(--loss) 9%, transparent); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 9px; }
.btn-wide { width: 100%; }
.link { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; font-weight: 500; }
.link:hover { color: var(--ink); text-decoration-color: var(--ink-3); }

/* campos */
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.fld > span i { font-style: normal; font-weight: 400; color: var(--ink-4); margin-left: 4px; }
.inp { height: 44px; width: 100%; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.inp::placeholder { color: var(--ink-4); }
.inp:hover { border-color: var(--line-strong); }
.inp:focus { border-color: var(--acid-line); box-shadow: 0 0 0 3px var(--acid-wash); }
textarea.inp { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
select.inp { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239da3aa' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.inp[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.6); }
html[data-theme="light"] .inp[type="time"]::-webkit-calendar-picker-indicator { filter: none; opacity: .5; }
.inp-wrap { position: relative; }
.inp-wrap .inp { padding-right: 46px; }
.inp-wrap .eye { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 8px; color: var(--ink-4); display: grid; place-items: center; }
.inp-wrap .eye:hover { color: var(--ink); background: var(--hover); }
.inp-wrap .eye svg { width: 17px; height: 17px; }
.inp-unit { position: relative; }
.inp-unit .inp { padding-right: 52px; }
.inp-unit b { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 450; color: var(--ink-4); font-size: 13px; pointer-events: none; }
.err { color: var(--loss); font-size: 13px; min-height: 1px; }
.err:empty { display: none; }

/* escolhas */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 450; transition: all .2s var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"] { border-color: var(--acid-line); background: var(--acid-wash); color: var(--ink); }
.chip[aria-pressed="true"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--acid); }
html[data-theme="light"] .chip[aria-pressed="true"]::before { background: var(--acid-text); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); gap: 2px; }
.seg button { height: 36px; min-width: 44px; padding: 0 14px; border-radius: 9px; color: var(--ink-3); font-weight: 500; font-size: 13.5px; transition: all .2s var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--raised-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="light"] .seg button[aria-pressed="true"] { background: #fff; }
.days { display: flex; gap: 6px; }
.days button { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); color: var(--ink-3); font-weight: 500; font-size: 13px; transition: all .2s var(--ease); }
.days button:hover { color: var(--ink); border-color: var(--line-strong); }
.days button[aria-pressed="true"] { background: var(--acid); border-color: var(--acid); color: var(--on-acid); }

/* chave liga/desliga */
.sw { position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; background: var(--line); transition: background .25s var(--ease); }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: transform .3s var(--ease), background .25s; }
.sw[aria-checked="true"] { background: var(--acid); }
.sw[aria-checked="true"]::after { transform: translateX(16px); background: var(--on-acid); }
.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 16px 0; border-top: 1px solid var(--rule); }
.toggle-row:last-child { border-bottom: 1px solid var(--rule); }
.toggle-row b { display: block; font-weight: 500; font-size: 14px; }
.toggle-row p { margin: 3px 0 0; color: var(--ink-3); font-size: 13px; line-height: 1.5; max-width: 62ch; }
.toggle-row .tag { font-size: 11.5px; color: var(--ink-4); margin-left: 8px; font-weight: 400; }

/* régua deslizante */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
.range::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--acid) 0 var(--p, 50%), var(--line) var(--p, 50%)); }
html[data-theme="light"] .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--acid-text) 0 var(--p, 50%), var(--line) var(--p, 50%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; margin-top: -7.5px; background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line-strong); }

/* aviso rápido */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); opacity: 0; z-index: 90; padding: 11px 18px; border-radius: 12px; background: var(--pop); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px; transition: all .35s var(--ease); pointer-events: none; display: flex; gap: 10px; align-items: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); }
.toast.bad::before { background: var(--loss); }

/* janela de diálogo */
.modal-veil { position: fixed; inset: 0; z-index: 80; background: var(--veil); backdrop-filter: blur(6px); display: grid; place-items: center; opacity: 0; transition: opacity .3s var(--ease); }
.modal-veil.on { opacity: 1; }
.modal { width: min(520px, calc(100vw - 48px)); max-height: calc(100vh - 80px); overflow: auto; background: var(--pop); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; transform: translateY(14px) scale(.985); transition: transform .4s var(--ease); }
.modal-veil.on .modal { transform: none; }
.modal h3 { margin: 0 0 6px; font: 600 21px/1.2 var(--display); letter-spacing: -.02em; }
.modal .lead { font-size: 14px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* animação de entrada em cascata */
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.m-in > * { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 40ms); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* redesenho no lugar (depois de marcar algo): nada de animação de entrada */
.quiet *, .quiet *::before, .quiet *::after { animation: none !important; }
.quiet .ch-svg .ln { stroke-dashoffset: 0 !important; } /* linhas de gráfico aparecem já desenhadas quando a tela é redesenhada no lugar */
