@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/Figtree-normal-400-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/Rubik-normal-400-900.woff2') format('woff2');
}

:root {
  --ink: #1a1446;
  --yellow: #ffd23f;
  --paper: #fff8dc;
  --white: #ffffff;
  --blue: #2f6bff;
  --green: #14b87a;
  --pink: #ff4f8b;
  --violet: #6d4ae0;
  --orange: #ff7a1a;
  --stage: var(--blue);
  --stage-on: #fff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

.top {
  background: var(--yellow);
  border-bottom: 4px solid var(--ink);
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
}
.top-inner, .progress, main, footer { max-width: 560px; margin-inline: auto; }
.top-inner { display: flex; align-items: center; gap: 12px; }
.face { border-radius: 50%; border: 3px solid var(--ink); background: var(--yellow); flex: none; }
.logo {
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 26px;
  line-height: 1;
}
.sub { font-weight: 700; font-size: 15px; margin-top: 4px; }

.progress { margin-top: 12px; }
.progress-text { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.bar {
  height: 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  overflow: hidden;
}
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .25s ease; }

main { padding: 16px; display: grid; gap: 16px; }
footer { padding: 4px 16px 28px; font-size: 13px; opacity: .8; }

.card {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.pad { padding: 16px; }
[hidden] { display: none !important; }

/* faixa de dias */
.strip {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 8px 14px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.day {
  flex: none;
  width: 46px;
  height: 52px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--c);
  color: var(--on);
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  font-size: 18px;
  display: grid;
  place-items: center;
  position: relative;
  scroll-snap-align: center;
  cursor: pointer;
  padding: 0;
}
.day.lock { opacity: .5; }
.day.sel { box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--ink); transform: translateY(-2px); }
.day.done::after {
  content: '✓';
  position: absolute;
  right: -6px; top: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ink);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  color: var(--ink);
}
.day.today::before {
  content: 'próximo';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-family: 'Figtree', sans-serif;
  font-weight: 700;
  font-size: 9px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 6px;
}

/* cartão do dia */
.banner {
  background: var(--stage);
  color: var(--stage-on);
  padding: 14px 16px;
  border-bottom: 3px solid var(--ink);
}
.banner .kicker { font-weight: 700; font-size: 14px; opacity: .95; }
.banner h2 {
  margin: 2px 0 0;
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 30px;
  line-height: 1;
}
.body { padding: 16px; display: grid; gap: 14px; }
.body h3 { margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }

.habits { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.habit label {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
}
.habit.new label { background: #fff3b8; }
.habit input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px; height: 36px;
  margin: 0;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.habit input::after {
  content: '';
  width: 10px; height: 18px;
  border: solid var(--white);
  border-width: 0 5px 5px 0;
  transform: rotate(45deg) translate(-1px, -2px);
  opacity: 0;
}
.habit input:checked { background: var(--hc); }
.habit input:checked::after { opacity: 1; }
.habit input:disabled { opacity: .45; cursor: not-allowed; }
.habit input:focus-visible, .btn:focus-visible, .day:focus-visible, summary:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}
.habit .t { font-weight: 800; }
.habit .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 1px;
}
.habit .h { display: block; font-size: 15px; margin-top: 3px; opacity: .85; }

.tip { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 3px dashed var(--ink); font-size: 15px; }
.tip b { display: block; margin-bottom: 2px; }

.closing h2 {
  margin: 0 0 6px;
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 24px;
  line-height: 1.05;
}
.closing p { margin: 6px 0 0; }

.tool summary { cursor: pointer; font-weight: 800; }
.tool h3 { margin: 16px 0 6px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.tool p { margin: 8px 0; }
.note { font-size: 15px; }
.row { display: flex; gap: 8px; align-items: center; }
#feedback h2 {
  margin: 0 0 6px;
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 24px;
  line-height: 1.05;
}
#feedback label { display: block; font-weight: 700; margin: 14px 0 6px; }
#feedback label.check {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 600;
}
#feedback label.check input { width: 28px; height: 28px; margin: 0; accent-color: var(--ink); }
.row.wrap { flex-wrap: wrap; margin-top: 12px; }
input[type=date], input[type=text], textarea, select {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 10px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
}
textarea { resize: vertical; font-size: 14px; margin-bottom: 8px; }
.btn {
  appearance: none;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--yellow);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
}
a.btn { display: inline-block; text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.small { padding: 8px 14px; font-size: 15px; }
.btn.danger { background: #ffd6d6; }
.btn.big { width: 100%; font-size: 18px; padding: 14px 18px; }
.msg { min-height: 1.3em; font-weight: 700; font-size: 15px; }

/* pop-up "Começar" */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(26, 20, 70, .6);
  overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%;
  max-width: 460px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 20px 18px 12px;
  text-align: center;
}
.modal-box h2 {
  margin: 0 0 8px;
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 26px;
  line-height: 1.05;
}
.modal-box p { margin: 0 0 12px; text-align: left; }
.modal-box .link { display: block; margin: 6px auto 0; }

/* tutorial de abertura */
body.noscroll { overflow: hidden; }
.onb {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.onb-inner { max-width: 560px; margin: 0 auto; padding: 20px 16px 28px; display: grid; gap: 16px; }
.onb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onb-dots { display: flex; gap: 8px; }
.onb-dots i { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); background: var(--white); }
.onb-dots i.on { background: var(--ink); }
.onb-body { display: grid; gap: 14px; }
.onb-body h2 {
  margin: 0;
  font-family: 'Rubik', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 30px;
  line-height: 1.02;
}
.onb-body p { margin: 0; }
.onb-body ol, .onb-body ul { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.onb-card { background: var(--white); border: 3px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); padding: 16px; }
.onb-card h3 { margin: 0 0 4px; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; }
.onb-warn { background: #ffe1a8; }
.onb-note { background: #fff3b8; border: 3px dashed var(--ink); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.onb-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.onb-actions #onbNext { margin-left: auto; }
.link {
  appearance: none;
  background: none;
  border: 0;
  padding: 8px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  justify-self: center;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
