:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --paper-deep: #e9e1d2;
  --surface: #fffdf8;
  --ink: #26352d;
  --muted: #68736b;
  --moss: #355f45;
  --moss-dark: #274936;
  --leaf: #88a86a;
  --clay: #ae5e4b;
  --clay-soft: #f4ddd5;
  --water: #4c7b7a;
  --line: #ded6c7;
  --shadow: 0 14px 32px rgb(49 45 34 / 9%);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #18221c;
    --paper-deep: #222e26;
    --surface: #202d25;
    --ink: #f1f2e9;
    --muted: #b8c0b4;
    --moss: #92b67d;
    --moss-dark: #769e68;
    --leaf: #b3ca85;
    --clay: #f09b83;
    --clay-soft: #503a34;
    --water: #8bb9b5;
    --line: #3a493e;
    --shadow: 0 14px 32px rgb(0 0 0 / 18%);
  }
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", Avenir, "Nunito Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [contenteditable]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--leaf) 72%, white);
  outline-offset: 3px;
}

::selection { background: var(--leaf); color: #102217; }

main {
  max-width: 760px;
  min-height: 100dvh;
  margin: auto;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

#login[hidden], #painel[hidden] { display: none; }
#login {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  padding: 28px;
}
.marca { width: min(100%, 360px); color: var(--moss); text-align: center; }
.marca:first-letter, .logo { color: var(--leaf); font-size: 2.5rem; line-height: 1; }
.marca h1 { margin: .35rem 0 .25rem; font-size: 1.75rem; letter-spacing: -.035em; }
.marca p { color: var(--muted); margin: 0 0 1.5rem; }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { letter-spacing: -.035em; line-height: 1.12; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.12rem; margin-bottom: .8rem; }
h3 { margin: 1.6rem 0 .55rem; color: var(--muted); font-size: .8rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
p { line-height: 1.5; }

form, label { display: grid; gap: 7px; }
label { color: var(--muted); font-size: .83rem; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 38%);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--moss); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 24%, transparent); }
textarea { min-height: 72px; resize: vertical; }
form button, .grande {
  border: 0;
  border-radius: 12px;
  padding: 12px 15px;
  background: var(--moss);
  color: #fffef9;
  font-weight: 760;
  box-shadow: 0 6px 14px rgb(35 70 49 / 20%);
  transition: transform 140ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease;
}
form button:active, .grande:active { transform: scale(.975); box-shadow: 0 2px 7px rgb(35 70 49 / 18%); }

header {
  height: 68px;
  padding: 9px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
}
header .logo { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 13px; background: var(--moss); color: var(--leaf); font-size: 1.25rem; }
header strong, header small { display: block; }
header strong { font-size: .95rem; letter-spacing: -.015em; }
header small { color: var(--muted); font-size: .73rem; }
.sair { margin-left: auto; padding: 8px 4px; border: 0; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 700; }
.sair:active { color: var(--ink); transform: scale(.96); }

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 14px 26px;
  padding: 25px 22px 22px;
  border-radius: 22px;
  background: var(--moss);
  color: #fffef9;
  box-shadow: 0 12px 28px rgb(35 70 49 / 20%);
}
.hero::after { content: ""; position: absolute; width: 150px; height: 150px; right: -67px; bottom: -88px; border: 22px solid rgb(180 207 138 / 20%); border-radius: 50%; }
.hero p { position: relative; margin-bottom: 8px; color: #dce7d4; font-size: .88rem; }
.hero h1 { position: relative; max-width: 19ch; margin-bottom: 18px; font-size: clamp(1.45rem, 6vw, 1.85rem); }
.percentual { position: relative; display: block; margin-top: 8px; color: #dce7d4; font-size: .78rem; font-variant-numeric: tabular-nums; }

.bar { display: block; position: relative; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 99px; background: rgb(255 255 255 / 20%); color: var(--leaf); }
.bar::-webkit-progress-bar { background: rgb(255 255 255 / 20%); border-radius: inherit; }
.bar::-webkit-progress-value { background: var(--leaf); border-radius: inherit; transition: background-color 160ms ease; }
.bar::-moz-progress-bar { background: var(--leaf); border-radius: inherit; }

#conteudo > .lista-acoes, #conteudo > .pilar, #conteudo > .card, #conteudo > #voltar { margin-left: 18px; margin-right: 18px; }
.lista-acoes { margin-bottom: 28px; }
.lista-acoes h2 { margin-bottom: 10px; }
.acao {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}
.acao:first-of-type { border-top: 1px solid var(--line); }
.acao > div { min-width: 0; flex: 1; }
.acao b { display: block; font-size: .94rem; line-height: 1.35; }
.acao small { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.acao small i, .contexto i { font-style: normal; padding: 0 2px; }
.check {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  padding: 0;
  border: 2px solid var(--moss);
  border-radius: 50%;
  background: transparent;
  color: #fffef9;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.check span { width: 9px; height: 5px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; opacity: 0; transform: rotate(-45deg) translate(1px, -1px); transition: opacity 120ms ease; }
.check.marcada { border-color: var(--moss); background: var(--moss); }
.check.marcada span { opacity: 1; }
.check:active { transform: scale(.86); }
.feito { opacity: .6; }
.feito b { text-decoration: line-through; text-decoration-thickness: 1px; }
.atrasada { border-bottom-color: color-mix(in srgb, var(--clay) 55%, var(--line)); }
em { display: inline-block; margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--clay-soft); color: color-mix(in srgb, var(--clay) 80%, var(--ink)); font-size: .67rem; font-style: normal; font-weight: 750; white-space: nowrap; }
.vazio { margin: 4px 0; color: var(--muted); font-size: .92rem; }

.pilar, .card { margin-bottom: 22px; }
.pilarTopo { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.pilar h2, .card h2 { margin-bottom: .65rem; }
.nota { min-width: 62px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: .68rem; font-weight: 700; }
.nota strong { display: block; color: var(--ink); font-size: 1rem; line-height: 1.1; }
.fichas { display: flex; gap: 5px; margin-top: 6px; }
.fichas i { display: block; width: 8px; height: 8px; border: 1px solid var(--leaf); border-radius: 50%; }
.fichas .on { background: var(--leaf); }
.objetivo, .tema {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: color 160ms ease, transform 140ms var(--ease-out);
}
.objetivo:hover, .tema:hover { color: var(--moss); }
.objetivo:active, .tema:active { transform: translateX(3px); }
.objetivo b { display: block; font-size: .94rem; }
.objetivo small { display: block; margin: 3px 0 9px; color: var(--muted); font-size: .75rem; }
.objetivo .bar { height: 4px; background: var(--paper-deep); }
.objetivo .bar::-webkit-progress-bar { background: var(--paper-deep); }
.tema { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: .9rem; }
.tema span { color: var(--moss); font-size: 1.3rem; line-height: .8; }

.card { padding-bottom: 18px; }
.card > h1 { max-width: 27ch; margin-bottom: 7px; }
.contexto { margin-bottom: 22px; color: var(--muted); font-size: .82rem; }
.card label { margin: 15px 0; }
.card .acao { padding-left: 0; padding-right: 0; }
#voltar { margin-top: 3px; margin-bottom: 20px; padding: 7px 0; border: 0; background: transparent; color: var(--moss); font-size: .83rem; font-weight: 760; }
#voltar::before { content: "←"; display: inline-block; margin-right: 6px; transition: transform 150ms var(--ease-out); }
#voltar:hover::before { transform: translateX(-3px); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.chips button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--moss); font-size: .77rem; font-weight: 700; }
.estado { width: 30px; height: 30px; flex: 0 0 30px; border: 2px solid var(--line); border-radius: 50%; }
.feito .estado { border-color: var(--moss); background: var(--moss); }
.conquista { padding: 10px 0; border-bottom: 1px solid var(--line); }
.conquista b { display: block; margin-bottom: 2px; color: var(--moss); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.frase { padding-left: 14px; border-left: 3px solid var(--leaf); color: var(--muted); font-family: Georgia, serif; font-size: 1.05rem; }
.guardiao-titulo { margin-top: 28px; }
.link { color: var(--moss); font-size: .88rem; font-weight: 780; text-decoration: none; }
.link span { display: inline-block; transition: transform 150ms var(--ease-out); }
.link:hover span { transform: translateX(3px); }

nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 7px 7px max(7px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
nav button { min-width: 74px; padding: 5px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: .7rem; transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease; }
nav button:hover, nav button:focus-visible { background: var(--paper-deep); color: var(--moss); }
nav button:active { transform: scale(.94); }
nav svg { display: block; width: 21px; height: 21px; margin: 0 auto 2px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; }
nav span { display: block; }
nav button[aria-current="page"] { color: var(--moss); font-weight: 800; }

.grande { width: calc(100% - 36px); margin: 2px 18px 18px; }
#salvo { position: fixed; bottom: 92px; left: 50%; z-index: 8; padding: 8px 12px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: .76rem; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity 160ms ease, transform 180ms var(--ease-out); }
#salvo.visivel { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) and (pointer: fine) { form button:hover, .grande:hover { background: var(--moss-dark); box-shadow: 0 8px 18px rgb(35 70 49 / 24%); } }
@media (min-width: 760px) {
  body { background: var(--paper-deep); }
  main { background: var(--paper); box-shadow: 0 0 0 1px rgb(52 50 39 / 4%), var(--shadow); }
  .hero { margin-right: 24px; margin-left: 24px; }
  #conteudo > .lista-acoes, #conteudo > .pilar, #conteudo > .card, #conteudo > #voltar { margin-right: 28px; margin-left: 28px; }
  nav { right: calc(50% - 380px); left: calc(50% - 380px); border-radius: 18px 18px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 1ms !important; }
}
