/* Tokens do design system Cuff Tracking (cuff-analytics-frontend/design-system/tokens.json) */
:root {
  --background: #f3ebe6; --foreground: #1f1416; --card: #ffffff; --primary: #1f1416; --primary-foreground: #ffffff;
  --secondary: #f6efeb; --muted: #f8f3f0; --muted-foreground: #6e6264; --border: #efe5e0; --border-strong: #8a7d80;
  --ring: #6d0c07; --brand: #6d0c07; --brand-subtle: #fdeef1; --rose: #ffabbb; --mist: #a8b8bc;
  --success: #2d6a4f; --success-subtle: #e8f2ec; --danger: #c2410c;
  --shadow-sm: 0 1px 2px rgba(31, 20, 22, .03); --shadow-md: 0 12px 32px rgba(31, 20, 22, .08);
  --radius: 16px; --radius-md: 10px;
  color-scheme: light;
  --font-base: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --font: "futura-pt", "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-base); font-size: 16px; line-height: 1.5; font-weight: 400; -webkit-font-smoothing: antialiased; overflow-x: clip; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.page { max-width: 980px; margin: 0 auto; padding: 56px 16px 32px; }

/* Hero */
.hero { text-align: center; max-width: 640px; margin: 0 auto; }
.eyebrow { font-size: 15px; letter-spacing: .02em; color: var(--muted-foreground); }
.hero h1 { margin-top: 14px; font-size: clamp(32px, 6vw, 44px); line-height: 1.1; font-weight: 400; letter-spacing: -.01em; }
.lead { margin-top: 14px; color: var(--muted-foreground); font-size: 17px; }

.search { display: flex; gap: 8px; margin-top: 28px; padding: 6px; background: var(--card); border: 1.5px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow-md); }
.search:focus-within { border-color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; padding: 0 18px; height: 46px; outline: none; }
.search input::placeholder { color: var(--muted-foreground); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; transition: opacity .15s, background-color .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: .88; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-outline { background: var(--card); color: var(--foreground); border-color: var(--border-strong); height: 38px; padding: 0 16px; font-size: 14px; }
.btn-outline:hover { background: var(--secondary); }
.field-error { margin-top: 12px; color: var(--danger); font-size: 15px; }

/* Resultado */
.resultado { margin-top: 48px; }
.res-title { text-align: center; font-size: clamp(24px, 4vw, 30px); font-weight: 400; margin-bottom: 24px; }
.res-sub { margin: 40px 0 14px; font-size: 14px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.empty { text-align: center; background: var(--card); border-radius: var(--radius); padding: 32px 20px; box-shadow: var(--shadow-sm); color: var(--muted-foreground); }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, var(--muted) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cb { --tone: var(--mist); background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.cb::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tone); }
.cb-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cb-label { font-size: 13px; color: var(--muted-foreground); }
.cb-valor { font-size: 38px; line-height: 1.1; font-weight: 400; letter-spacing: -.01em; }
.chip { flex: none; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--secondary); color: var(--muted-foreground); }
.cb-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 8px 8px 8px 14px; }
.cb-code code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 15px; letter-spacing: .04em; word-break: break-all; }
.btn-outline.copied { color: var(--success); border-color: var(--success); background: var(--success-subtle); }

.venc { display: flex; flex-direction: column; gap: 8px; }
.venc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.venc-days { font-weight: 500; }
.venc-date { color: var(--muted-foreground); }
.bar { height: 10px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--tone); transition: width 1.2s cubic-bezier(.2, .7, .2, 1) .25s; position: relative; overflow: hidden; }
.bar > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); transform: translateX(-100%); animation: sheen 2.6s ease-in-out 1.5s infinite; }
@keyframes sheen { to { transform: translateX(100%); } }
.cb.urgent .bar > span { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.min { font-size: 14px; color: var(--muted-foreground); }
.min strong { color: var(--foreground); font-weight: 500; }

/* Vencido / utilizado: tons mais claros, menos destaque */
.cb.off { background: var(--muted); box-shadow: none; opacity: .72; }
.cb.off::before { background: var(--border); }
.cb.off .cb-valor { color: var(--muted-foreground); text-decoration: line-through; text-decoration-thickness: 1px; }
.cb.off .cb-code { background: transparent; border-color: var(--border); }
.cb.off code { color: var(--muted-foreground); }
.cb.off .chip { background: var(--card); }

.cta { display: flex; justify-content: center; margin-top: 32px; }
.cta .btn { height: 52px; padding: 0 38px; font-size: 17px; }

/* Benefícios */
.beneficios { margin-top: 80px; }
.beneficios h2 { text-align: center; font-size: clamp(22px, 4vw, 28px); font-weight: 400; margin-bottom: 28px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.benefit { border-radius: var(--radius); padding: 40px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; font-size: 15px; min-height: 250px; }
.benefit svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tone-card { background: var(--card); box-shadow: var(--shadow-sm); }
.tone-mist { background: var(--mist); color: #1f1416; }
.benefit em { font-style: italic; }

.footer { text-align: center; padding: 32px 16px 48px; color: var(--muted-foreground); font-size: 14px; }

@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .page { padding-top: 36px; }
  .grid { grid-template-columns: 1fr; }
  .benefit { min-height: 0; padding: 32px 24px; }
  .search { flex-direction: column; border-radius: 24px; padding: 8px; }
  .search input { text-align: center; }
  .btn-primary { width: 100%; }
  .cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bar > span { width: var(--w) !important; }
}

/* ---- Linguagem da capa do design system: laje bordô, pílula névoa, disco rosa, ladrilho branco ---- */
.page { max-width: 1040px; }
.brandbar { display: flex; justify-content: center; margin-bottom: 36px; }
.brandbar img { height: 52px; width: auto; display: block; }
.hero { max-width: none; text-align: left; display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: center; margin: 0; }
.hero-copy { display: flex; flex-direction: column; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; flex: none; width: 28px; height: 8px; border-radius: 8px; background: var(--rose); animation: grow .8s .2s both cubic-bezier(.2,.7,.2,1); }
@keyframes grow { from { width: 0; } }
.hero h1 { font-size: clamp(44px, 7vw, 76px); line-height: .98; letter-spacing: -.01em; font-weight: 400; margin-top: 18px; color: var(--foreground); }
.hero h1 span { color: var(--brand); }
.lead { max-width: 460px; }
.search { margin-top: 28px; max-width: 520px; transition: box-shadow .25s, border-color .25s, transform .25s; }
.search:hover { transform: translateY(-1px); }
.search:focus-within { box-shadow: 0 0 0 4px rgba(255, 171, 187, .55), var(--shadow-md); }
.btn-primary::after { content: "→"; display: inline-block; max-width: 0; opacity: 0; overflow: hidden; transition: max-width .25s, opacity .25s, margin .25s; margin-left: -4px; }
.btn-primary:hover::after { max-width: 20px; opacity: 1; margin-left: 2px; }
.btn-primary:hover { opacity: 1; background: var(--brand); }
.btn-primary:disabled::after { display: none; }

.hero-art { position: relative; aspect-ratio: 1 / 1.05; width: 100%; max-width: 440px; justify-self: end; }
.hero-art > * { position: absolute; }
.shape-slab { right: 0; top: -6%; width: 46%; height: 112%; background: var(--brand); border-radius: var(--radius); animation: enter-up .9s .1s both cubic-bezier(.2,.7,.2,1); }
.shape-slab i { position: absolute; left: 18%; height: 7%; border-radius: 999px; background: var(--rose); animation: grow-x .9s both cubic-bezier(.2,.7,.2,1); transform-origin: left; }
.shape-slab i:nth-child(1) { top: 58%; width: 64%; animation-delay: .8s; }
.shape-slab i:nth-child(2) { top: 70%; width: 44%; animation-delay: .95s; }
.shape-slab i:nth-child(3) { top: 82%; width: 76%; animation-delay: 1.1s; }
@keyframes grow-x { from { transform: scaleX(0); } }
.shape-mist { left: 0; top: 14%; width: 56%; height: 22%; border-radius: 999px; background: var(--mist); animation: enter-right .9s .25s both cubic-bezier(.2,.7,.2,1), drift 7s 1.2s ease-in-out infinite; }
.shape-paper { left: 0; bottom: 6%; width: 22%; height: 34%; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-md); animation: enter-up .9s .4s both cubic-bezier(.2,.7,.2,1), tilt 6s 1.3s ease-in-out infinite; }
.shape-rose { left: 27%; bottom: 6%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--rose); animation: pop .8s .55s both cubic-bezier(.2,.9,.3,1.3), drift 5.5s 1.4s ease-in-out infinite reverse; }
@keyframes enter-up { from { opacity: 0; transform: translateY(40px); } }
@keyframes enter-right { from { opacity: 0; transform: translateX(-50px); } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } }
@keyframes drift { 50% { transform: translateY(-10px); } }
@keyframes tilt { 50% { transform: rotate(-4deg) translateY(-6px); } }

/* resultado */
.res-title, .beneficios h2 { color: var(--foreground); }
.res-title b, .beneficios h2 b { color: var(--brand); font-weight: 400; }
.cb { transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
.cb:not(.off):hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.cb-valor { color: var(--brand); }
.cb-code { background: var(--brand-subtle); border-color: var(--rose); transition: border-color .2s; }
.cb:hover .cb-code { border-color: var(--brand); }
.btn-outline { color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-outline.copied, .btn-outline.copied:hover { background: var(--success-subtle); color: var(--success); border-color: var(--success); }
.cb.off .cb-valor { color: var(--muted-foreground); }
.cb.off .cb-code { background: transparent; border-color: var(--border-strong); }
.cta .btn { box-shadow: var(--shadow-md); transition: transform .2s, box-shadow .2s, background-color .2s; }
.cta .btn:hover { transform: translateY(-3px) scale(1.02); background: var(--brand); }
.cta .btn::after { content: "→"; max-width: 20px; opacity: 1; margin-left: 4px; transition: transform .2s; }
.cta .btn:hover::after { transform: translateX(4px); }

/* benefícios: revelam ao rolar e reagem ao hover */
.benefit { transition: transform .3s cubic-bezier(.2,.7,.2,1), background-color .3s, color .3s, box-shadow .3s; }
.benefit:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.benefit svg { transition: transform .4s cubic-bezier(.3,1.5,.5,1); }
.benefit:hover svg { transform: scale(1.18) rotate(-6deg); }
.tone-card:hover { background: var(--rose); }
.tone-mist:hover { background: var(--brand); color: #fff; }
.js .benefit:not(.in) { opacity: 0; transform: translateY(24px); }
.js .benefit.in { animation: reveal .6s calc(var(--d, 0) * 80ms) both cubic-bezier(.2,.7,.2,1); }
@keyframes reveal { from { opacity: 0; transform: translateY(24px); } }
.footer { color: var(--muted-foreground); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { align-items: center; }
  .hero-art { order: -1; max-width: 260px; justify-self: center; aspect-ratio: 1.3 / 1; }
}
@media (prefers-reduced-motion: reduce) { .js .benefit:not(.in) { opacity: 1; transform: none; } }

/* hero centralizado, sem formas decorativas */
.hero { display: block; text-align: center; max-width: 680px; margin: 0 auto; }
.hero-copy { align-items: center; }
.eyebrow::before { display: none; }
.hero h1 { font-size: clamp(38px, 6.5vw, 60px); }
.lead { margin-left: auto; margin-right: auto; }
.search { margin-left: auto; margin-right: auto; width: 100%; }
.brandbar { margin-bottom: 44px; } @media (max-width: 560px) { .brandbar img { height: 42px; } }

.brandbar img { height: 38px; } @media (max-width: 560px) { .brandbar img { height: 32px; } }

/* barra: preenche conforme o tempo passa; a cor revelada esquenta até o vencimento */
.bar > span { width: 100%; background: var(--tone); clip-path: inset(0 100% 0 0 round 999px); transition: clip-path 1.6s cubic-bezier(.2,.7,.2,1) .3s; }
.bar { background: rgba(31, 20, 22, .07); }
@media (prefers-reduced-motion: reduce) { .bar > span { clip-path: var(--clip) !important; } }

/* tela de resultado limpa */
body.is-result .hero, body.is-result .beneficios { display: none; }
body.is-result .resultado { margin-top: 0; }
.back { display: block; margin: 0 auto 28px; background: none; border: 0; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 14px; color: var(--muted-foreground); cursor: pointer; transition: background-color .2s, color .2s, transform .2s; }
.back:hover { background: var(--card); color: var(--brand); transform: translateX(-3px); }
.cards { display: flex; flex-wrap: wrap; justify-content: center; }
.cards > .cb, .cards > .skeleton { flex: 1 1 300px; max-width: 380px; }
.cards > .skeleton { min-width: 280px; }

/* CTA: vermelho, em maiúsculas, hover rosa */
.cta .btn { background: var(--brand); color: #fff; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; }
.cta .btn:hover { background: var(--rose); color: var(--foreground); }

/* benefícios: cores fixas = rosa e bordô; no hover viram branco e azul-névoa */
.tone-card { background: var(--rose); color: var(--foreground); }
.tone-card:hover { background: var(--card); }
.tone-mist { background: var(--brand); color: #fff; }
.tone-mist svg { color: #fff; }
.tone-mist:hover { background: var(--mist); color: var(--foreground); }
.tone-mist:hover svg { color: #1f1416; }

/* Futura PT só entra quando terminar de carregar (evita texto invisível); até lá usa Jost/Futura do sistema */
html.tk body { font-family: var(--font); }

/* botão copiado: rosa da marca */
.btn-outline.copied, .btn-outline.copied:hover { background: var(--rose); color: var(--foreground); border-color: var(--rose); }

/* caixa do código rosa; Copiar branco, hover vermelho, copiado azul clarinho */
.cb:not(.off) .cb-code { background: var(--rose); border: 1.5px dashed rgba(109, 12, 7, .35); }
.cb:not(.off) .cb-code code { color: var(--foreground); }
.cb:not(.off) .btn-outline { background: #fff; color: var(--brand); border-color: #fff; }
.cb:not(.off) .btn-outline:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.cb:not(.off) .btn-outline.copied, .cb:not(.off) .btn-outline.copied:hover { background: #d9e6ea; color: #1f3a44; border-color: #d9e6ea; }

/* rosa mais claro na caixa; copiado em vermelho */
.cb:not(.off) .cb-code { background: #ffd3dc; border-color: rgba(109, 12, 7, .3); }
.cb:not(.off) .btn-outline.copied, .cb:not(.off) .btn-outline.copied:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.loading-msg { text-align: center; color: var(--muted-foreground); margin-bottom: 16px; }
/* menos espera pela animação da barra */
.bar > span { transition-duration: 1s; transition-delay: .1s; }
.cb { animation-delay: calc(var(--i, 0) * 40ms); }

/* listra do topo do card: rosa */
.cb:not(.off)::before { background: var(--rose); }

/* barra inteira numa cor só, que esquenta conforme faltam menos dias */
.bar > span { transition: clip-path 1.2s cubic-bezier(.2,.7,.2,1) .1s, background-color 1.6s ease .1s, background 1.6s ease .1s; }

/* frase de economia e rótulo de dias */
.economia { width: fit-content; max-width: 100%; margin: -8px auto 28px; padding: 8px 18px; border-radius: 999px; background: #ffd3dc; color: var(--foreground); text-align: center; font-size: 15px; }
.economia b { color: var(--brand); font-weight: 500; }
.venc-head { flex-wrap: wrap; }

/* mobile: campo grande e botão separado */
@media (max-width: 560px) {
  .search { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 12px; flex-direction: column; border-radius: 0; margin-top: 24px; }
  .search:hover { transform: none; }
  .search:focus-within { box-shadow: none; }
  .search input { flex: none; width: 100%; height: 60px; padding: 0 24px; font-size: 18px; text-align: left; background: var(--card); border: 1.5px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow-md); transition: border-color .2s, box-shadow .2s; }
  .search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 171, 187, .55); }
  .search .btn-primary { height: 58px; font-size: 17px; width: 100%; }
  .lead { font-size: 16px; }
}
