/* ============================================================
   Habits — design system (light mode, mobile first)
   ============================================================ */

:root {
  /* paleta light */
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface2: #F0EDE6;
  --border: #E8E5DE;
  --border2: #D8D4CC;
  --accent: #B8901A;
  --accent-fill: #E8C36A;
  --accent-light: #FDF5DC;
  --green: #3A9A3A;
  --green-light: #F0FBF0;
  --blue: #3A78C0;
  --blue-light: #EEF4FF;
  --red: #D04040;
  --red-light: #FFF0F0;
  --orange: #C87030;
  --orange-light: #FFF4EC;
  --text: #1A1814;
  --text2: #4A4540;
  --muted: #9A9488;

  /* aliases retrocompatíveis (nomes legados usados no CSS existente) */
  --surface-2: var(--surface2);
  --text-dim: var(--text2);
  --text-faint: var(--muted);
  --accent2: var(--blue);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --r-md: 10px;
  --r-lg: 14px;
  --max: 520px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'Sora', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Transições globais suaves (Apple HIG) */
* {
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

html { height: 100%; background: var(--bg); }
/* body cresce com o conteúdo (sem min-height/flex que esticavam telas
   curtas e criavam vão extra). Centralização horizontal vem do .app
   (margin:auto); a landing/login centralizam pelo próprio .auth-wrap. */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); /* espaço para a nav fixa */
}

/* container central, mobile first */
.app, .app-container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 16px 0;
  position: relative;
}

/* container de conteúdo nomeado pela spec — garante espaço para a nav fixa.
   (o espaçamento real das telas com nav vem do body acima; mantido aqui
   caso algum conteúdo use .main diretamente) */
.main, [class*="main"], .content, .page-content { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* ---------- Motion (Apple HIG) ---------- */
.card { transition: transform 200ms var(--ease), background 150ms ease, border-color 150ms ease; }
.card:hover { transform: translateY(-1px); }
button:active { transform: scale(0.97); transition: transform 100ms ease; }

/* entrada de passo / seção */
.step, .ob-step { animation: stepIn 300ms var(--ease); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .step, .ob-step { animation: none; }
}

/* ---------- Tipografia ---------- */
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.blue { color: var(--blue); }

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.topbar .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.topbar .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 14px; color: var(--accent);
  cursor: pointer; flex: none;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card.tight { padding: 12px 14px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 12px;
}
.section-title h2 { color: var(--text); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  padding: 11px 16px; cursor: pointer; transition: .15s;
  width: 100%;
}
.btn:hover { border-color: var(--border2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Primário — sólido escuro */
.btn-primary {
  width: 100%; min-height: 50px; border-radius: var(--radius);
  background: var(--text); color: #FFFFFF; border: none;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); }

/* Accent translúcido (Apple) — CTA principal usado no app */
.btn-accent {
  width: 100%; min-height: 50px; border-radius: var(--radius);
  background: rgba(184, 144, 26, 0.12); border: 0.5px solid rgba(184, 144, 26, 0.35);
  color: var(--accent); font-size: 16px; font-weight: 600;
}
.btn-accent:hover { background: rgba(184, 144, 26, 0.18); filter: none; opacity: 1; }
.btn-accent:active { transform: scale(0.97); }

/* Secundário */
.btn-secondary {
  min-height: 44px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 0.5px solid var(--border);
  color: var(--text2); font-size: 14px; font-weight: 500; padding: 0 20px;
}
.btn-secondary:hover { border-color: var(--accent); }

/* Pular — discreto, plain */
.btn-skip {
  background: none; border: none;
  color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 12px;
  text-decoration: underline; text-underline-offset: 3px;
  width: auto;
}

/* Voltar — plain, accent secundário */
.btn-back {
  background: none; border: none;
  color: var(--accent2);
  font-size: 17px; cursor: pointer;
  padding: 12px 0;
  display: inline-flex; align-items: center; gap: 4px;
  width: auto;
}
a.btn-back { text-decoration: none; }
.btn-back:hover { opacity: .85; }

.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(208, 64, 64, 0.3); background: transparent; }
.btn-sm { padding: 8px 12px; font-size: 13px; width: auto; min-height: 0; }
.btn-row { display: flex; gap: 10px; }

/* Nav do onboarding (voltar · dots · pular) */
.onboarding-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; min-height: 44px;
}
.step-dots { display: flex; gap: 6px; align-items: center; }
.step-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border);
  transition: all 250ms var(--ease);
}
.step-dot.active { width: 20px; border-radius: 3px; background: var(--accent); }
.step-dot.done { background: var(--green); }

/* Link voltar no topo das telas internas */
.backlink { margin-bottom: 4px; }

/* ---------- Inputs ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.input, textarea.input, select.input {
  width: 100%;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans); font-size: 16px;
  padding: 11px 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none; appearance: none;
}
.input:focus, textarea.input:focus, select.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 144, 26, 0.12);
}
.input::placeholder, textarea.input::placeholder { color: var(--muted); opacity: 1; }
textarea.input { resize: vertical; min-height: 96px; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; }

/* date/time nativos no tema light */
.input[type="date"], .input[type="time"] {
  color-scheme: light;
  font-family: var(--font-mono);
  appearance: none; -webkit-appearance: none;
}
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .7;
  /* tinge o ícone (escuro por padrão) com o accent dourado, visível no claro */
  filter: invert(54%) sepia(58%) saturate(640%) hue-rotate(2deg) brightness(85%);
}
.input[type="date"]::-webkit-calendar-picker-indicator:hover,
.input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
/* placeholder dos campos vazios mais discreto */
.input[type="date"]:in-range::-webkit-datetime-edit,
.input[type="time"]::-webkit-datetime-edit { color: var(--text); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* color swatches */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: .15s;
}
.swatch.on { border-color: var(--text); transform: scale(1.1); }

/* icon picker */
.icons { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-opt {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  display: grid; place-items: center; font-size: 19px; cursor: pointer;
}
.icon-opt.on { border-color: var(--accent); background: var(--surface-2); }

/* ---------- Habit / checklist item ---------- */
.habit {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
}
.habit:last-child { border-bottom: none; }
.habit .ico {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 20px; flex: none;
  background: var(--surface-2);
}
.habit .body { flex: 1; min-width: 0; }
.habit .body .name { font-weight: 600; font-size: 15px; }
.habit .body .desc { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habit.done .body .name { color: var(--text-dim); text-decoration: line-through; }

.check {
  width: 28px; height: 28px; border-radius: 50%; flex: none; cursor: pointer;
  border: 2px solid var(--border); display: grid; place-items: center;
  transition: .15s; background: transparent;
}
.check.on { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.check svg { width: 15px; height: 15px; opacity: 0; transition: .15s; }
.check.on svg { opacity: 1; }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); transition: width .35s ease; }
.bigstat { display: flex; align-items: baseline; gap: 8px; }
.bigstat .num { font-family: var(--font-mono); font-size: 34px; font-weight: 700; line-height: 1; }

/* ---------- Stats grid ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; }
.stat .n { font-family: var(--font-mono); font-size: 24px; font-weight: 700; }
.stat .l { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* ---------- Chips / tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--text-dim); font-weight: 500;
}
.chip.on { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; width: 100%; }
.cal-dow { text-align: center; font-size: 11px; color: var(--text-faint); padding-bottom: 4px; min-width: 0; }
.cal-cell {
  aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  background: var(--surface-2); position: relative;
  min-width: 0; overflow: hidden;
}
.cal-cell.empty { background: transparent; }
/* box-shadow inset em vez de outline: não é cortado na borda da última coluna */
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--text-faint); }
.empty .em { font-size: 30px; margin-bottom: 8px; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.nav-inner { max-width: var(--max); margin: 0 auto; display: flex; padding: 8px 6px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.nav a {
  flex: 1; text-decoration: none; color: var(--text-faint);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; padding: 4px 0; transition: .15s;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--accent); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 96px; display: flex; justify-content: center; z-index: 100; pointer-events: none; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 18px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,.14); animation: toastIn .25s ease;
  max-width: calc(var(--max) - 36px);
}
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Auth / login ---------- */
.auth-wrap { width: 100%; flex: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.logo { font-family: var(--font-mono); font-size: 13px; letter-spacing: 4px; color: var(--accent); text-transform: uppercase; margin-bottom: 24px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card p.lead { color: var(--text-dim); font-size: 14px; margin-bottom: 26px; }

/* ---------- Utils ---------- */
.hide { display: none !important; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; padding: 50px 0; }
.list { list-style: none; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.tag { display: inline-block; font-size: 11px; font-family: var(--font-mono); padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-dim); }

/* ---------- Onboarding ---------- */
/* (animação de entrada definida em .step/.ob-step na seção Motion) */

.ob-skip { text-align: center; margin-top: 14px; }
.ob-skip a { color: var(--text-faint); font-size: 13px; cursor: pointer; }
.ob-skip a:hover { color: var(--text-dim); }

/* cards de intenção (multi-select) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: .15s; position: relative;
}
.choice:hover { border-color: var(--border2); }
.choice.on { border-color: var(--accent); background: var(--surface-2); }
.choice .e { font-size: 24px; }
.choice .l { font-size: 13px; font-weight: 500; line-height: 1.3; }
.choice.on::after { content: '✓'; position: absolute; top: 8px; right: 10px; color: var(--accent); font-weight: 700; font-size: 13px; }

/* sugestões clicáveis (meta / hábito / regra) */
.sugg {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; transition: .15s; margin-bottom: 8px; font-size: 14px;
}
.sugg:hover { border-color: var(--accent); }
.sugg .plus { margin-left: auto; color: var(--accent); font-size: 20px; font-weight: 700; flex: none; }
.sugg.used { opacity: .45; pointer-events: none; }
.sugg.used .plus::after { content: '✓'; }
.sugg-label { font-size: 11px; color: var(--text-faint); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .04em; }

/* Resumo do onboarding (passo 6) */
.summary-section { margin-bottom: 24px; }
.summary-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; font-family: var(--font-mono);
}
.summary-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
}
.summary-item-icon { font-size: 20px; flex-shrink: 0; }
.summary-item-name { font-size: 14px; font-weight: 500; color: var(--text); }
.summary-item-sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }
.summary-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

/* ---------- Avatar + menu de usuário ---------- */
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent); border: 1.5px solid rgba(184, 144, 26, 0.2);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.user-menu {
  position: absolute; top: 48px; right: 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 8px; min-width: 200px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.user-menu-name { font-size: 14px; font-weight: 600; color: var(--text); padding: 8px 12px 2px; }
.user-menu-email { font-size: 11px; color: var(--muted); padding: 0 12px 8px; font-family: var(--font-mono); word-break: break-all; }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-item {
  display: block; width: 100%; padding: 10px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none;
}
.user-menu-item:hover { background: var(--surface2); }

/* banner (ex.: conta excluída) */
.banner {
  background: var(--green-light); border: 1px solid var(--green);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; margin-bottom: 14px; line-height: 1.5;
}
.user-menu-logout {
  display: block; width: 100%; padding: 10px 12px; border-radius: 8px;
  border: none; background: none; color: var(--red);
  font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; font-family: var(--font-sans);
}
.user-menu-logout:hover { background: rgba(239, 91, 107, 0.12); }

/* ---------- Form colapsável (lista antes do formulário) ---------- */
.addbtn { margin-bottom: 14px; }

/* ---------- Geração do plano (IA) ---------- */
.gen-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #FFFFFF;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.prev-x {
  background: none; border: none; color: var(--text-faint);
  font-size: 14px; cursor: pointer; flex: none; padding: 4px 8px; line-height: 1;
}
.prev-x:hover { color: var(--red); }

/* ---------- Campos de data separados (DD / MM / AAAA) ---------- */
.date-fields { display: flex; align-items: center; gap: 8px; }
.date-fields input { text-align: center; }
#nasc-dia, #nasc-mes { width: 64px; }
#nasc-ano { width: 96px; }
.date-fields span { color: var(--muted); font-size: 20px; }
/* esconde as setas do number nos campos de data */
.date-fields input::-webkit-outer-spin-button,
.date-fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.date-fields input[type=number] { -moz-appearance: textfield; }

/* ---------- Aviso LGPD ---------- */
.lgpd-notice {
  font-size: 11px; color: var(--muted); text-align: center;
  line-height: 1.5; margin-top: 16px; padding: 0 8px;
}
.lgpd-notice a { color: var(--accent2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Páginas legais (termos / privacidade) ---------- */
.legal h2 { margin: 24px 0 8px; font-size: 16px; color: var(--text); }
.legal p { color: var(--text-dim); font-size: 14px; line-height: 1.65; margin-bottom: 8px; }
.legal ul { color: var(--text-dim); font-size: 14px; line-height: 1.65; margin: 4px 0 8px 18px; }
.legal a { color: var(--accent2); }
.legal .updated { color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); margin-bottom: 8px; }

/* ---------- Modal de edição ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  z-index: 300; display: flex; align-items: flex-end; justify-content: center;
  animation: opacity 150ms ease;
}
.modal-panel {
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0; padding: 24px 16px calc(40px + env(safe-area-inset-bottom));
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  animation: modalUp 250ms var(--ease);
}
@keyframes modalUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.btn-delete {
  width: 100%; height: 44px; border-radius: 10px;
  background: rgba(239, 91, 107, 0.1); border: 1px solid rgba(239, 91, 107, 0.3);
  color: var(--red); font-size: 14px; font-weight: 500; cursor: pointer;
  margin-top: 12px; font-family: var(--font-sans);
}
.btn-delete:hover { background: rgba(239, 91, 107, 0.16); }
/* segmentado (status / ativo) */
.seg { display: flex; gap: 8px; }
.seg .chip { flex: 1; text-align: center; }

/* ---------- Rotina (seletor de dias) ---------- */
.day-nav {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px; margin-bottom: 20px;
}
.day-nav::-webkit-scrollbar { display: none; }
.day-btn {
  flex-shrink: 0; padding: 7px 13px; border-radius: 20px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font-sans);
  transition: all 0.2s ease; white-space: nowrap;
}
.day-btn.active { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 700; }

.rotina-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
}
.rotina-hora { font-size: 11px; font-family: var(--font-mono); color: var(--muted); min-width: 38px; flex-shrink: 0; }
.rotina-icone { font-size: 18px; flex-shrink: 0; }
.rotina-info { flex: 1; min-width: 0; }
.rotina-nome { font-size: 13px; font-weight: 500; color: var(--text); }
.rotina-recorrencia { font-size: 10px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }
.rotina-badge-especial {
  font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 8px;
  background: #7a849918; border: 1px solid #7a849940; color: var(--muted);
  font-family: var(--font-mono); margin-left: auto; flex-shrink: 0;
}
.rotina-vazio { font-size: 13px; color: var(--muted); text-align: center; padding: 24px 16px; }
.rotina-vazio a { display: block; margin-top: 10px; color: var(--accent2); }

/* ---------- Escolha de caminho (onboarding passo 2) ---------- */
.path-card {
  display: block; width: 100%; text-align: left; padding: 18px;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface);
  cursor: pointer; margin-bottom: 12px; position: relative; transition: .15s; font-family: var(--font-sans);
}
.path-card:hover { border-color: var(--accent); }
.path-card .pc-emoji { font-size: 28px; }
.path-card .pc-title { font-size: 16px; font-weight: 600; margin-top: 8px; color: var(--text); }
.path-card .pc-desc { font-size: 13px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
.path-card .pc-badge { position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 700; color: #FFFFFF; background: var(--accent); border-radius: 999px; padding: 2px 8px; }

/* ---------- Widget de importação ---------- */
.imp-ex {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-family: var(--font-mono); font-size: 11px; line-height: 1.6;
  white-space: pre-wrap; color: var(--text-dim); margin: 10px 0 0;
}
.imp-erro { color: var(--red) !important; white-space: normal; }

/* ---------- Insights (histórico) ---------- */
.insights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.insight-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.insight-card.full-width { grid-column: 1 / -1; }
.insight-card.muted { color: var(--muted); text-align: center; font-size: 13px; }
.insight-num { font-size: 32px; font-weight: 700; font-family: var(--font-mono); color: var(--accent); margin-bottom: 4px; }
.insight-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-mono); }
.insight-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.insight-habit-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.insight-habit-row:last-child { border-bottom: none; }
.insight-pct { margin-left: auto; font-size: 11px; font-family: var(--font-mono); color: var(--muted); }
.insight-pct.baixo { color: var(--red); }
.insight-pct.alto { color: var(--green); }

/* ---------- OTP (código de 6 dígitos) ---------- */
.otp-wrap { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.otp-digit {
  flex: 1 1 0; min-width: 0; max-width: 44px; height: 52px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 20px; font-weight: 700; text-align: center; color: var(--text);
  font-family: var(--font-mono); -moz-appearance: textfield; appearance: textfield;
  transition: border-color 150ms ease; padding: 0; min-height: 0;
}
.otp-digit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,144,26,0.12); }
.otp-digit.filled { border-color: var(--accent); background: var(--accent-light); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Botão WhatsApp ---------- */
.btn-whats { background: #25d366; color: #06311a; border-color: #25d366; }
.btn-whats:hover { filter: brightness(1.05); opacity: 1; }

/* ---------- Empty states + ilustrações ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 20px; gap: 12px; }
.empty-state p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }
.empty-state a { font-size: 14px; color: var(--accent); font-weight: 600; text-decoration: none; }
.illus { display: block; margin: 0 auto; }
.illus svg { display: block; }
.fade-in { animation: fadeIn 500ms var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* período do dia (header do dashboard) */
.period-header { display: flex; justify-content: center; margin-bottom: 8px; }

/* done tints (tema light) */
.habit.done { background: var(--green-light); }
.card.done { border-color: var(--green); background: var(--green-light); }

/* section label + tags coloridas */
.section-label { color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.tag-treino { background: var(--blue-light); color: var(--blue); border: 0.5px solid rgba(58,120,192,0.3); border-radius: 20px; font-size: 10px; font-weight: 700; padding: 4px 10px; }
.tag-caminhada { background: var(--green-light); color: var(--green); border: 0.5px solid rgba(58,154,58,0.3); border-radius: 20px; font-size: 10px; font-weight: 700; padding: 4px 10px; }
.tag-familia { background: var(--accent-light); color: var(--accent); border: 0.5px solid rgba(184,144,26,0.3); border-radius: 20px; font-size: 10px; font-weight: 700; padding: 4px 10px; }
