/*
 * Componentes que não cabem bem em classes utilitárias:
 * botões, faixa do dia, celular de demonstração, Caixinha e notificações.
 * O layout das seções fica no HTML, com Tailwind.
 */

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 3px solid #2FD5B2; outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Marca ---------- */
.wordmark { font: 700 1.45rem/1 "Poppins", system-ui, sans-serif; letter-spacing: -0.01em; }
.wordmark .a { color: var(--wm-a); }
.wordmark .b { color: var(--wm-b); }
.wordmark.on-night .a { color: #FFFFFF; }
.wordmark.on-night .b { color: #2FD5B2; }

/* ---------- Botões e links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 16px 24px; border: 0; border-radius: 999px;
  font: 600 1rem/1 "Inter", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: background-color .15s;
}
.btn-primary { background: var(--btn); color: var(--btn-ink); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-mint { background: #2FD5B2; color: #011A3A; }
.btn-mint:hover { background: #5BE3C6; }
.textlink {
  background: none; border: 0; padding: 8px 0; cursor: pointer;
  font: 600 1rem "Inter", system-ui, sans-serif;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}

/* ---------- Navegação ---------- */
.nav-link { display: block; padding: 8px 12px; border-radius: 999px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: #139D9C; }

/* ---------- Formulário do simulador ---------- */
.field { display: grid; gap: 8px; }
.field > label, .field > .label { font-size: .9rem; font-weight: 600; }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: 400 1rem "Inter", system-ui, sans-serif; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
}
.input:focus { outline: none; border-color: #139D9C; box-shadow: 0 0 0 3px color-mix(in srgb, #139D9C 25%, transparent); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  min-height: 44px; padding: 10px 16px; cursor: pointer;
  font: 600 .95rem "Inter", system-ui, sans-serif; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
}
.seg button[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input {
  appearance: none; position: relative; flex-shrink: 0; margin: 0; cursor: pointer;
  width: 48px; height: 28px; border-radius: 999px; background: var(--line-strong); transition: background .2s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #FFFFFF; transition: transform .2s;
}
.switch input:checked { background: #139D9C; }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- Faixa do dia (assinatura visual) ---------- */
.band {
  position: relative; height: 48px; border-radius: 12px;
  background: linear-gradient(90deg, #011A3A 0%, #012552 20%, #01507B 27%, #139D9C 33%, #7FE3CD 45%, #BFEFE4 58%, #7FE3CD 68%, #139D9C 75%, #01507B 82%, #012552 90%, #011A3A 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.band .now { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: #FFFFFF; }
.band .now::after {
  content: "agora"; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font: 600 .75rem "Inter", system-ui, sans-serif; color: #FFFFFF;
}
.band .dot {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0;
  border: 3px solid #FFFFFF; border-radius: 50%; background: transparent; cursor: pointer;
}
.band .dot.ok { background: #FFFFFF; }
.band .dot.skip { border-style: dashed; }
.band .dot.cur { box-shadow: 0 0 0 4px rgba(47, 213, 178, .55); }
.band.static .dot { cursor: default; background: #FFFFFF; }
.axis { position: relative; height: 20px; margin-top: 8px; font-size: .75rem; font-variant-numeric: tabular-nums; }
.axis span { position: absolute; transform: translateX(-50%); }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }

/* ---------- Celular de demonstração ----------
 * Cores fixas: é uma imagem do app, igual nos dois temas. */
.phone {
  position: relative; width: min(320px, 100%); max-width: 100%; aspect-ratio: 330 / 680;
  padding: 10px; border-radius: 44px; background: #0B1624;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45), inset 0 0 0 2px #24384F;
}
.screen {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%;
  overflow: hidden; border-radius: 34px; background: #F3F7F9; color: #012552;
}
.notch { position: absolute; z-index: 5; top: 9px; left: 50%; transform: translateX(-50%); width: 88px; height: 24px; border-radius: 20px; background: #0B1624; }
.statusbar { display: flex; justify-content: space-between; height: 36px; padding: 12px 24px 0; font-size: .72rem; font-weight: 600; }
.app-head { padding: 8px 16px; }
.app-head small { font-size: .72rem; font-weight: 500; color: #4B6178; }
.app-head h4 { margin: 2px 0 0; font: 700 1.2rem/1.2 "Poppins", system-ui, sans-serif; }
.progress { display: flex; align-items: center; gap: 12px; margin: 0 12px 8px; padding: 12px; border-radius: 14px; background: #FFFFFF; }
.ring { --p: 40; display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(#139D9C calc(var(--p) * 1%), #E8EFF3 0); }
.ring span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #FFFFFF; font-size: .7rem; font-weight: 700; }
.progress b { display: block; font-size: .85rem; }
.progress small { font-size: .72rem; color: #4B6178; }
.app-body { flex: 1; overflow-y: auto; padding: 0 12px 12px; scrollbar-width: none; }
.app-body::-webkit-scrollbar { display: none; }

.dose { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; padding: 10px; border: 1.5px solid transparent; border-radius: 14px; background: #FFFFFF; }
.dose.now { border-color: #139D9C; }
.dose.done { opacity: .72; }
.dose .t { font: 600 .82rem/1 "Inter", system-ui, sans-serif; font-variant-numeric: tabular-nums; text-align: center; color: #01507B; }
.dose .t i { display: block; margin-top: 4px; font-style: normal; font-size: .6rem; font-weight: 700; text-transform: uppercase; color: #0A7473; }
.dose .n { overflow: hidden; font-size: .84rem; font-weight: 600; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.dose .d { font-size: .7rem; line-height: 1.3; color: #4B6178; }
.dose .act { padding: 8px 11px; border: 0; border-radius: 999px; background: #01507B; color: #FFFFFF; font: 600 .74rem/1 "Inter", system-ui, sans-serif; cursor: pointer; }
.dose .act:hover { background: #002D5E; }
.pill-st { padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.pill-st.ok { background: #E0F3EF; color: #0A7568; }
.pill-st.skip { background: #FFF1DC; color: #9A5B00; }

.tabbar { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 6px 14px; border-top: 1px solid #D5E1E7; background: #FFFFFF; }
.tabbar button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; border-radius: 10px; background: none; color: #4B6178; font: 500 .66rem/1.2 "Inter", system-ui, sans-serif; cursor: pointer; }
.tabbar svg { width: 20px; height: 20px; }
.tabbar button[aria-selected="true"] { color: #01507B; font-weight: 700; }
.tabbar button[aria-selected="true"] svg { color: #139D9C; }

/* Telas "Meus remédios" e "Últimos 7 dias" (usadas no celular e na seção Estoque) */
.med { margin-bottom: 8px; padding: 12px; border-radius: 14px; background: #FFFFFF; color: #012552; }
.med-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.med-top b { font-size: .85rem; }
.med-top span { font-size: .7rem; color: #4B6178; white-space: nowrap; }
.bar { overflow: hidden; height: 6px; margin: 8px 0 6px; border-radius: 6px; background: #E8EFF3; }
.bar i { display: block; height: 100%; border-radius: 6px; background: #139D9C; }
.bar.low i { background: #E59A2E; }
.med small { font-size: .7rem; color: #4B6178; }
.med small.warn { font-weight: 600; color: #9A5B00; }
.hist-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; padding: 12px; border-radius: 14px; background: #FFFFFF; }
.hd { display: grid; justify-items: center; gap: 6px; font-size: .62rem; color: #4B6178; }
.hd .col { display: flex; align-items: flex-end; overflow: hidden; width: 100%; height: 84px; border-radius: 6px; background: #E8EFF3; }
.hd .col i { display: block; width: 100%; background: #139D9C; }
.hd b { font-size: .66rem; font-variant-numeric: tabular-nums; color: #012552; }
.hist-log { padding: 4px 12px; border-radius: 14px; background: #FFFFFF; }
.hist-log div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid #E8EFF3; font-size: .74rem; }
.hist-log div:last-child { border-bottom: 0; }
.hist-log span { color: #4B6178; }

/* Alarme em tela cheia */
.alarm {
  position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: 64px 20px 24px; background: #011A3A; color: #FFFFFF; text-align: center;
  transform: translateY(102%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.alarm.show { transform: none; }
.alarm .clock { font: 700 3.2rem/1 "Poppins", system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.alarm .lbl { margin-top: 8px; font-size: .85rem; font-weight: 600; color: #2FD5B2; }
.alarm .pulse { display: grid; place-items: center; width: 96px; height: 96px; margin: 32px 0 24px; border-radius: 50%; background: rgba(47, 213, 178, .12); animation: pulse 1.6s infinite; }
.alarm .pulse img { width: 60px; height: auto; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 213, 178, .5); }
  70% { box-shadow: 0 0 0 22px rgba(47, 213, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 213, 178, 0); }
}
.alarm .what { font: 600 1.25rem/1.25 "Poppins", system-ui, sans-serif; }
.alarm .how { margin-top: 6px; font-size: .82rem; color: #9FB4C7; }
.alarm .slot { margin-top: 16px; padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .8rem; }
.alarm .acts { display: grid; gap: 10px; width: 100%; margin-top: auto; }
.alarm .acts button { padding: 15px; border: 0; border-radius: 999px; font: 600 .95rem/1 "Inter", system-ui, sans-serif; cursor: pointer; }
.alarm .take { background: #2FD5B2; color: #011A3A; }
.alarm .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.alarm .row2 button { background: rgba(255, 255, 255, .1); color: #FFFFFF; }
.alarm .row2 button:hover { background: rgba(255, 255, 255, .18); }

.toast {
  position: absolute; z-index: 6; left: 12px; right: 12px; bottom: 78px; padding: 11px 14px;
  border-radius: 12px; background: #012552; color: #FFFFFF; font-size: .78rem;
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* Imitação dos botões do alarme na seção "O alarme" */
.fake-btn { padding: 14px 0; border-radius: 999px; font: 600 .95rem/1 "Inter", system-ui, sans-serif; text-align: center; }
.fake-btn.take { background: #2FD5B2; color: #011A3A; }
.fake-btn.other { background: var(--sunken); color: var(--ink); }

/* ---------- Caixinha ---------- */
.org-rect { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.comp {
  position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 0; cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--muted);
  font: 700 1.05rem "Poppins", system-ui, sans-serif;
}
.comp.filled { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, #139D9C 45%, var(--line)); }
.comp.sel { border-color: #139D9C; box-shadow: 0 0 0 3px color-mix(in srgb, #139D9C 30%, transparent); }
.comp .dots { position: absolute; bottom: 7px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.comp .dots i { width: 6px; height: 6px; border-radius: 50%; background: #139D9C; }
.org-round { position: relative; aspect-ratio: 1 / 1; max-width: 100%; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.org-round .comp { position: absolute; width: 19%; border-radius: 50%; }
.org-round .hub { position: absolute; inset: 36%; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); }
.org-round .hub img { width: 60%; height: auto; }
.nobox { display: grid; gap: 8px; padding: 40px 24px; border: 2px dashed var(--line-strong); border-radius: 20px; color: var(--muted); }
.nobox b { font: 600 1.15rem "Poppins", system-ui, sans-serif; color: var(--ink); }

/* ---------- Notificações na tela bloqueada ---------- */
.notif { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .92); color: #012552; font-size: .9rem; }
.notif img { width: 36px; height: 36px; padding: 8px 7px; border-radius: 10px; background: #012552; object-fit: contain; }
.notif b { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; }
.notif b span { font-weight: 500; color: #4B6178; }
.notif p { margin-top: 2px; font-size: .9rem; line-height: 1.4; }
.notif small { display: block; margin-top: 4px; font-size: .72rem; color: #4B6178; }
.vote button { min-height: 44px; padding: 10px 16px; border: 1.5px solid rgba(255, 255, 255, .35); border-radius: 999px; background: transparent; color: #FFFFFF; font: 600 .9rem "Inter", system-ui, sans-serif; cursor: pointer; }
.vote button[aria-pressed="true"] { background: #2FD5B2; border-color: #2FD5B2; color: #011A3A; }

/* ---------- Dúvidas ---------- */
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; list-style: none; cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex-shrink: 0; font: 400 1.5rem/1 "Inter", system-ui, sans-serif; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
