/* NEXO FITNESS · /app (medidas) e /privacidade na identidade "A linha do nexo" */
:root {
  --ground: #F4F3EE; --ground-2: #ECEBE4; --paper: #FFFFFF; --ink: #141816;
  --muted: #3F4743; --muted-2: #4A524D; --rule: #DEDDD5; --rule-strong: #C9CCC4;
  --accent-text: #0B7A52; --line: #10B37A; --mint: #45E3A2;
  --dark: #121714; --dark-text: #EEF2EE; --dark-muted: #B9C9C0; --dark-soft: #9FB5AA;
  --warn-bg: #F6EDD3; --warn-ink: #6B4E07; --warn-rule: #E3CF94; --error: #9B2C20;
  --font-display: "Segoe UI Variable Display", "SF Pro Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-text: "Segoe UI Variable Text", "SF Pro Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-text); -webkit-font-smoothing: antialiased; overflow-x: clip; }
svg { display: block; }
a { color: var(--accent-text); }
a:hover { color: #075C3D; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.intro :focus-visible, .overview-hero :focus-visible { outline-color: var(--mint); }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: var(--ground); }
.skip:focus { top: 12px; }
button { cursor: pointer; font: inherit; }
button:disabled { opacity: .55; cursor: wait; }

.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-text); }

/* ---------- Estrutura ---------- */
main { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.intro { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 40px clamp(28px, 6vw, 96px) 56px; background: var(--dark); color: var(--dark-text); }
.intro-line { position: absolute; right: 8%; top: 0; width: 22%; height: 100%; overflow: visible; pointer-events: none; }
.intro-line path { fill: none; stroke: var(--mint); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: .9; }
.intro > :not(.intro-line) { position: relative; }
.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: auto; padding-bottom: 72px; color: var(--dark-text); text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: .04em; }
.brand-tag { font-size: 11px; font-weight: 600; letter-spacing: .32em; color: var(--mint); }
.intro .eyebrow { color: var(--mint); }
h1 { margin: 0; max-width: 9ch; font-family: var(--font-display); font-weight: 800; font-size: clamp(52px, 6.6vw, 104px); line-height: .92; letter-spacing: -.035em; }
.intro-lead { max-width: 24rem; margin: 28px 0 0; font-size: 18px; line-height: 1.55; color: var(--dark-muted); }
.intro-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 36px; }
.intro-links a { color: var(--dark-soft); font-size: 14px; text-decoration: none; padding: 4px 0; }
.intro-links a:hover { color: var(--mint); }
.steps { display: flex; gap: 28px; margin: 48px 0 0; padding: 0; list-style: none; counter-reset: passo; font-size: 13px; color: var(--dark-soft); }
.steps li { counter-increment: passo; }
.steps li::before { content: "0" counter(passo) " · "; color: var(--mint); font-weight: 600; }
.app-nav { display: none; }

.panel { width: min(100%, 520px); margin: auto; padding: 48px 32px; align-self: center; }
h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: -.03em; }
h3 { margin: 6px 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.panel p { line-height: 1.6; color: var(--muted); }

/* ---------- Formulários ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 40px; padding: 5px; border-radius: 999px; background: var(--ground-2); }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; }
.tabs .active { background: var(--ink); color: var(--ground); }
label { display: block; margin-top: 20px; font-size: 14px; font-weight: 600; color: var(--ink); }
input, select { display: block; width: 100%; min-height: 50px; margin-top: 8px; padding: 0 16px; border: 1.5px solid var(--rule-strong); border-radius: 12px; background: var(--paper); color: var(--ink); font: 16px var(--font-text); }
input:focus-visible, select:focus-visible { outline-offset: 1px; border-color: var(--accent-text); }
.hint, .footnote { font-size: 13px; }
.primary { width: 100%; min-height: 54px; margin-top: 26px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--ground); font-weight: 600; font-size: 16px; }
.primary:hover:not(:disabled) { background: #26302B; }
.secondary { min-height: 44px; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.secondary:hover:not(:disabled) { background: rgba(20,24,22,.06); }

.consent { margin: 26px 0 0; padding: 18px 18px 6px; border: 1.5px solid var(--rule-strong); border-radius: 16px; background: var(--paper); }
.consent legend { padding: 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0 0 14px; font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; padding: 0; accent-color: var(--accent-text); }
.check-health { padding: 12px; margin-left: -12px; margin-right: -12px; border-radius: 12px; background: #E9F6EF; color: var(--ink); }

.demo-entry { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); }
.demo-entry p { margin: 0 0 12px; font-size: 14px; }
.demo-entry button { width: 100%; }
.demo-entry small { display: block; margin-top: 12px; text-align: center; color: var(--muted-2); }
#message { min-height: 26px; font-size: 14px; }
#message.error { color: var(--error); }
.footnote { margin-top: 32px; color: var(--muted-2); }
.notice { padding: 20px; border: 1.5px dashed var(--rule-strong); border-radius: 16px; line-height: 1.6; }

/* ---------- Área logada ---------- */
.signed-in main { grid-template-columns: 250px minmax(0, 1fr); }
.signed-in .intro { position: sticky; top: 0; height: 100vh; justify-content: flex-start; padding: 32px 26px; }
.signed-in .intro-line { right: 10%; width: 30%; opacity: .45; }
.signed-in .brand { margin-bottom: 0; padding-bottom: 52px; }
.signed-in .intro > .eyebrow, .signed-in h1, .signed-in .intro-lead, .signed-in .steps { display: none; }
.signed-in .intro-links { flex-direction: column; gap: 4px; margin-top: auto; }
.signed-in .app-nav { position: relative; display: flex; flex-direction: column; }
.app-nav::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 18px; width: 2px; background: #2C3530; }
.app-nav a { position: relative; padding: 12px 10px 12px 34px; border-radius: 10px; color: var(--dark-muted); font-size: 15px; text-decoration: none; }
.app-nav a::before { content: ""; position: absolute; left: 3px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 2px solid #4A5A52; background: var(--dark); }
.app-nav a:hover, .app-nav a:focus-visible { color: var(--dark-text); }
.app-nav a:hover::before { border-color: var(--mint); background: var(--mint); }
.signed-in .panel { width: 100%; max-width: 1280px; padding: 32px clamp(20px, 4vw, 56px) 100px; align-self: start; }

.demo-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; padding: 12px 12px 12px 20px; border: 1.5px dashed var(--rule-strong); border-radius: 999px; font-size: 14px; color: var(--muted); }
.demo-banner strong { color: var(--ink); }
.demo-banner span { margin-left: 8px; }
.demo-banner .secondary { min-height: 38px; font-size: 13px; }
.account-header, .history-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.account-header { margin-top: 24px; }
.account-header h2 { font-size: clamp(36px, 4.4vw, 60px); }
.account-header p { margin: 8px 0 0; overflow-wrap: anywhere; }
.profile-editor { margin-top: 18px; font-size: 14px; }
.profile-editor form { max-width: 420px; }
summary { cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--accent-text); }

.overview-hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 28px; padding: 36px 40px 56px; border-radius: 28px; background: var(--dark); color: var(--dark-text); }
.overview-hero .eyebrow { color: var(--mint); }
.overview-hero h3 { max-width: 18ch; font-size: clamp(28px, 3.2vw, 44px); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.panel .overview-hero p:not(.eyebrow) { margin: 0; color: var(--dark-muted); }
.hero-action { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--mint); color: var(--ink); font-weight: 600; text-decoration: none; }
.hero-action:hover { background: #6EEBB8; color: var(--ink); }
.hero-line { position: absolute; left: 0; bottom: 20px; width: 100%; height: 24px; overflow: visible; pointer-events: none; animation: draw 1.4s cubic-bezier(.6,0,.2,1) both; }
.hero-line path { fill: none; stroke: var(--mint); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; }
@keyframes draw { from { clip-path: inset(-50% 100% -50% 0); } to { clip-path: inset(-50% 0 -50% 0); } }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stats article { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border: 1px solid var(--rule); border-radius: 22px; background: var(--paper); }
.stats span { font-size: 13px; color: var(--muted-2); }
.stats strong { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.03em; }
.stats article:first-child strong { color: var(--accent-text); }
.stats small { font-size: 12px; line-height: 1.5; color: var(--muted-2); }

.card { min-width: 0; padding: 28px; border: 1px solid var(--rule); border-radius: 22px; background: var(--paper); }
.trend { margin-top: 16px; }
.metric-label { min-width: 180px; margin: 0; }
select { min-height: 44px; }
#trend-chart svg { width: 100%; height: auto; max-height: 300px; }
#trend-comparison { font-weight: 600; color: var(--ink); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.optional { margin-top: 22px; }
#history { max-height: 640px; overflow-y: auto; padding-right: 6px; }
.measurement { position: relative; padding: 18px 0 18px 26px; border-top: 1px solid var(--rule); }
.measurement::before { content: ""; position: absolute; left: 4px; top: 24px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.measurement h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted-2); }
.measurement p { margin: 6px 0; font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--ink) !important; }
.measurement dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 14px; }
.measurement dd { margin: 0; text-align: right; }
.signed-in #message { position: sticky; bottom: 16px; z-index: 5; padding: 14px 22px; border-radius: 999px; background: rgba(20,24,22,.94); color: var(--dark-text); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.signed-in #message.error { background: #5A1D16; color: #FBE9E5; }
.signed-in #message:empty { padding: 0; box-shadow: none; background: transparent; }
.privacy-note { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 13px; }

/* ---------- Aviso de Privacidade ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 24px 96px; }
.doc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 56px; }
.doc-top .brand { margin: 0; color: var(--ink); }
.doc-top .brand-tag { color: var(--accent-text); }
.doc h1 { max-width: none; font-size: clamp(40px, 6vw, 72px); }
.doc h2 { margin: 48px 0 12px; font-size: 26px; }
.doc p, .doc li { font-size: 17px; line-height: 1.65; color: var(--muted); }
.doc ul { padding-left: 22px; }
.doc .lead { font-size: 19px; color: var(--ink); }
.draft { margin: 24px 0 0; padding: 16px 20px; border: 1px solid var(--warn-rule); border-radius: 16px; background: var(--warn-bg); color: var(--warn-ink) !important; font-size: 15px !important; }
.todo { padding: 1px 6px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--paper); }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; line-height: 1.5; }
th { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
tr:last-child td { border-bottom: 0; }
.doc-foot { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted-2); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .signed-in main { grid-template-columns: minmax(0, 1fr); }
  .signed-in .intro { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 18px 20px; }
  .signed-in .brand { margin: 0; padding: 0; }
  .signed-in .intro-line { display: none; }
  .signed-in .app-nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .signed-in .app-nav::before { display: none; }
  .signed-in .app-nav a { padding: 8px 12px 8px 26px; font-size: 14px; }
  .signed-in .app-nav a::before { left: 6px; width: 10px; height: 10px; margin-top: -5px; }
  .signed-in .intro-links { flex-direction: row; gap: 4px 16px; margin: 0 0 0 auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .intro { padding: 28px 22px 32px; }
  .intro-line { width: 14%; right: 0; opacity: .35; }
  .brand { padding-bottom: 32px; }
  h1 { font-size: 52px; }
  .steps { margin-top: 26px; }
  .panel { padding: 32px 20px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .signed-in .intro-links { margin-left: 0; }
}
@media (max-width: 600px) {
  .signed-in .panel { padding: 20px 16px 90px; }
  .card { padding: 20px; }
  .account-header { flex-direction: column; }
  .history-header { flex-direction: column; }
  .metric-label { width: 100%; }
  .overview-hero { flex-direction: column; align-items: flex-start; padding: 26px 22px 50px; border-radius: 22px; }
  .demo-banner { flex-direction: column; align-items: flex-start; border-radius: 18px; padding: 14px 16px; }
  .demo-banner span { display: block; margin: 4px 0 0; }
  .stats { gap: 8px; }
  .stats article { padding: 14px; border-radius: 16px; }
  .stats strong { font-size: 26px; }
  .field-grid { gap: 0 10px; }
  .intro-links a { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-line { animation: none; }
}
