/* Layout: lateral escura com o logo NEG, área de trabalho clara; dourado do logo como único acento */
:root {
  --bg: #F0F3F3;
  --surface: #FFFFFF;
  --surface-2: #F6F8F8;
  --ink: #1D2327;
  --muted: #626B71;
  --faint: #939CA1;
  --line: #DFE5E6;
  /* cor de destaque = verde da marca Pilatech (o nome --gold ficou do tema antigo) */
  --gold: #5FA394;
  --gold-ink: #2E6A5D;
  --gold-soft: #E2F1EC;
  --gold-grad: linear-gradient(180deg, #3F7F71 0%, #83BAAD 62%, #B5DDD3 100%);
  --side: #1A1F23;
  --side-2: #252B30;
  --side-ink: #E5ECEC;
  --side-muted: #87919A;
  --ok: #2E8558;
  --ok-soft: #E3F2EA;
  --warn: #B87A05;
  --warn-soft: #FCF1D6;
  --bad: #C0443A;
  --bad-soft: #FBE6E3;
  --info: #3D6FB6;
  --info-soft: #E5EDF8;
  --shadow: 0 1px 2px rgba(20, 26, 30, .06), 0 6px 24px rgba(20, 26, 30, .06);
  --font-display: "Arial Black", "Archivo Black", "Arial", sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --r-sm: 9px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1215; --surface: #171C20; --surface-2: #1D2328; --ink: #E7EDEE; --muted: #9AA4AA; --faint: #6E787E; --line: #2A3237;
    --gold: #83BAAD; --gold-ink: #A9D8CC; --gold-soft: #17302A;
    --side: #090C0E; --side-2: #161B1F; --side-ink: #E5ECEC; --side-muted: #87919A;
    --ok: #4DB07F; --ok-soft: #173326; --warn: #E0A732; --warn-soft: #3A2C0E; --bad: #E2675C; --bad-soft: #3D1B18; --info: #6E9BDB; --info-soft: #172438;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1215; --surface: #171C20; --surface-2: #1D2328; --ink: #E7EDEE; --muted: #9AA4AA; --faint: #6E787E; --line: #2A3237;
  --gold: #83BAAD; --gold-ink: #A9D8CC; --gold-soft: #17302A;
  --side: #090C0E; --side-2: #161B1F; --side-ink: #E5ECEC; --side-muted: #87919A;
  --ok: #4DB07F; --ok-soft: #173326; --warn: #E0A732; --warn-soft: #3A2C0E; --bad: #E2675C; --bad-soft: #3D1B18; --info: #6E9BDB; --info-soft: #172438;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* Sem zoom ao tocar duas vezes (iPad/celular); o toque continua rápido */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, input, select, textarea, label, [data-a] { touch-action: manipulation; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 var(--font-body); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 900; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.logo-light { display: block; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.gold { background: var(--gold); color: #171A1C; border-color: var(--gold); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); }
.icon-btn:hover { border-color: var(--faint); }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* chips de estado */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }

/* formulários */
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); outline: none;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
/* Campos de data no iPad/iPhone: o Safari dá largura e altura próprias e o campo invade a coluna ao lado */
input.input[type="date"], input.input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  height: 44px; line-height: 22px; text-align: left;
}
input.input[type="date"]::-webkit-date-and-time-value, input.input[type="month"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
textarea.input { min-height: 84px; resize: vertical; }
/* iPad/celular: com letra menor que 16px o Safari dá zoom ao tocar no campo e a janela fica "sambando" */
@media (pointer: coarse) { .input, select.input, textarea.input { font-size: 16px; } }
/* Listas (select): no Safari do Mac/iPad ficavam mais baixas que os outros campos; agora têm a mesma altura e uma seta própria */
select.input {
  -webkit-appearance: none; appearance: none; height: 44px; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a837c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}

/* toast */
.toast-wrap { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: toastIn .25s ease-out; max-width: min(90vw, 460px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* alerta de confirmação no centro da tela (toda ação confirmada, cancelada ou recusada) */
.fb-overlay { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: rgba(8, 11, 13, .28); animation: fade .18s; cursor: pointer; }
.fb-card { background: var(--surface); border-radius: 22px; padding: 26px 26px 22px; width: min(340px, 100%); text-align: center; display: grid; justify-items: center; gap: 8px; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .35); animation: fbIn .32s cubic-bezier(.2, 1.4, .4, 1); }
.fb-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px; animation: fbPop .45s .05s cubic-bezier(.2, 1.6, .4, 1) both; }
.fb-ico svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fb-ico.ok { background: var(--ok-soft); color: var(--ok); }
.fb-ico.bad { background: var(--bad-soft); color: var(--bad); }
.fb-ico.gold { background: var(--gold-soft); color: var(--gold-ink); }
.fb-card b { font-family: var(--font-display); font-size: 19px; line-height: 1.2; }
.fb-card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.fb-bar { width: 100%; height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.fb-bar i { display: block; height: 100%; background: var(--gold); animation: fbBar linear forwards; }
.fb-overlay.out { animation: fbOut .22s forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fbIn { from { transform: scale(.85) translateY(10px); opacity: 0; } }
@keyframes fbPop { from { transform: scale(0); } }
@keyframes fbBar { from { width: 100%; } to { width: 0; } }
@keyframes fbOut { to { opacity: 0; } }
a.btn { text-decoration: none; }

/* movimento de reforço: confirmação desenha o "check" e dá um pulo; recusa balança */
.fb-ico.ok svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: fbDraw .45s .18s ease-out forwards; }
.fb-ico.ok { animation: fbPop .45s .05s cubic-bezier(.2, 1.6, .4, 1) both, fbRing 1s .25s ease-out; }
.fb-ico.bad { animation: fbPop .4s .05s cubic-bezier(.2, 1.6, .4, 1) both, fbShake .45s .35s ease-in-out; }
.fb-ico.gold { animation: fbPop .45s .05s cubic-bezier(.2, 1.6, .4, 1) both, fbTilt .6s .3s ease-in-out; }
@keyframes fbDraw { to { stroke-dashoffset: 0; } }
@keyframes fbRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 100% { box-shadow: 0 0 0 18px color-mix(in srgb, var(--ok) 0%, transparent); } }
@keyframes fbShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes fbTilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-10deg); } 65% { transform: rotate(8deg); } }
/* marcação: o botão escolhido dá uma leve "batida" */
.sug.on, .pick-hours button.on, .hchip.on, .opts button.on, .rate button.on { animation: marca .28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes marca { 0% { transform: scale(.92); } 100% { transform: scale(1); } }

/* ---------- Assistente "Pergunte ao Pilatech" (painel e app do aluno): botão flutuante, janela, microfone e resposta ---------- */
.ast-fab { position: fixed; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; flex-direction: row-reverse; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ast-fab[hidden] { display: none; }
.ast-fab-orb { width: 60px; height: 60px; border-radius: 50%; display: block; flex: none; position: relative;
  box-shadow: 0 10px 28px rgba(20, 12, 40, .35), 0 0 22px rgba(131, 186, 173, .28), 0 0 0 1px rgba(255, 255, 255, .08); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), box-shadow .3s; }
.ast-fab-orb canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.ast-fab-t { background: var(--ink); color: var(--surface); font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 99px; box-shadow: var(--shadow);
  opacity: 0; transform: translateX(8px); transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.ast-fab:hover .ast-fab-orb, .ast-fab:focus-visible .ast-fab-orb { transform: scale(1.08); box-shadow: 0 14px 34px rgba(20, 12, 40, .4), 0 0 30px rgba(131, 186, 173, .45), 0 0 0 1px rgba(255, 255, 255, .12); }
.ast-fab:hover .ast-fab-t, .ast-fab:focus-visible .ast-fab-t { opacity: 1; transform: none; }
.ast-fab:active .ast-fab-orb { transform: scale(.94); }
@media (max-width: 760px) { .ast-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } .ast-fab-orb { width: 56px; height: 56px; } .ast-fab-t { display: none; } }

/* esfera grande dentro da janela: calma parada, cresce e pulsa ouvindo, pequena quando há resposta */
.ast-orb-w { display: grid; justify-items: center; gap: 6px; margin: 6px 0 2px; }
.ast-orb-w canvas { width: 92px; height: 92px; border-radius: 50%; display: block; box-shadow: 0 12px 34px rgba(20, 12, 40, .3), 0 0 26px rgba(131, 186, 173, .25); transition: width .35s cubic-bezier(.3, 1.3, .5, 1), height .35s cubic-bezier(.3, 1.3, .5, 1), box-shadow .35s; }
.ast-orb-w.on canvas { width: 124px; height: 124px; box-shadow: 0 14px 40px rgba(20, 12, 40, .35), 0 0 46px rgba(131, 186, 173, .45), 0 0 80px rgba(61, 111, 250, .25); }
.ast-orb-w.mini canvas { width: 52px; height: 52px; }
.ast-orb-w small { min-height: 16px; font-size: 12.5px; font-weight: 700; color: var(--bad); letter-spacing: .02em; }
.ast-orb-w.mini small { display: none; }
.modal.ast { width: min(560px, calc(100vw - 24px)); }
.ast .modal-h { gap: 10px; }
.ast-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-grad); color: #fff; flex: none; }
.ast-badge svg { width: 18px; height: 18px; }
.ast-barra { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); transition: border-color .2s, box-shadow .2s; }
.ast-barra:focus-within, .ast-barra.ouvindo { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.ast-barra .input { border: 0; background: transparent; box-shadow: none; flex: 1; min-width: 0; font-size: 16px; padding: 8px 4px; }
.ast-barra .input:focus { outline: none; box-shadow: none; }
.ast-mic { width: 44px; height: 44px; border-radius: 12px; border: 0; display: grid; place-items: center; flex: none; background: var(--ink); color: var(--gold); cursor: pointer; position: relative; }
.ast-mic svg { width: 21px; height: 21px; }
.ast-mic.on { background: var(--bad); color: #fff; }
.ast-mic.on::after { content: ''; position: absolute; inset: -4px; border-radius: 15px; border: 2px solid var(--bad); animation: astPulso 1.2s ease-out infinite; }
@keyframes astPulso { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
.ast-ir { flex: none; }
.ast-onda { display: flex; justify-content: center; gap: 4px; height: 22px; margin: 10px 0 0; }
.ast-onda i { width: 4px; border-radius: 4px; background: var(--bad); animation: astOnda .9s ease-in-out infinite; }
.ast-onda i:nth-child(2) { animation-delay: .12s; } .ast-onda i:nth-child(3) { animation-delay: .24s; } .ast-onda i:nth-child(4) { animation-delay: .36s; } .ast-onda i:nth-child(5) { animation-delay: .48s; }
@keyframes astOnda { 0%, 100% { height: 5px; } 50% { height: 22px; } }
.ast-msg { margin: 12px 2px 0; font-size: 13.5px; color: var(--gold-ink); }

.ast-resp { margin-top: 14px; padding: 16px 16px 14px; border-radius: 14px; background: linear-gradient(180deg, var(--gold-soft), var(--surface) 140%); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); animation: astEntra .35s cubic-bezier(.3, 1.2, .5, 1); }
.ast-resp small { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); }
.ast-rt { margin: 4px 0 6px; font-size: 19px; line-height: 1.3; font-weight: 800; color: var(--ink); }
.ast-rl { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
/* assistente inteligente: "Pensando…" enquanto o Claude responde, e o crédito da voz */
.ast-pensando { color: var(--muted); }
.ast-pensando i { font-style: normal; animation: ast-ponto 1.2s infinite both; }
.ast-pensando i:nth-child(2) { animation-delay: .2s; } .ast-pensando i:nth-child(3) { animation-delay: .4s; }
@keyframes ast-ponto { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.ast-resp { position: relative; }
.ast-mudo { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line, rgba(0,0,0,.12)); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ast-mudo .ico { width: 16px; height: 16px; }
.ast-mudo.on { color: var(--gold-ink); border-color: currentColor; }
.ast-resp .ast-cred { display: block; margin-top: 10px; font-size: 11px; font-weight: 400; color: var(--muted); opacity: .8; text-transform: none; letter-spacing: 0; }
.ast-ra { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@keyframes astEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ast-ops { display: grid; gap: 6px; margin-top: 12px; }
.ast-op { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ast-op b { flex: 1; font-size: 14px; } .ast-op small { color: var(--muted); font-size: 12px; }
.ast-op svg { width: 16px; height: 16px; color: var(--faint); }
.ast-op:hover { border-color: var(--gold); }

.ast-sug { margin-top: 16px; }
.ast-sug .eyebrow { display: block; margin-bottom: 8px; }
/* sugestões em grade de 2 colunas, botões do mesmo tamanho; o último ocupa a linha inteira quando sobra sozinho (painel e app do aluno) */
.ast-sug > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ast-ex { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 9px 10px; min-height: 48px; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1.25; color: var(--ink); text-align: center; transition: border-color .2s, background .2s; }
.ast-ex:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 42px; }
.ast-ex .nobr { white-space: nowrap; }
.ast-ex > span { text-wrap: balance; }
.ast-ex:hover { border-color: var(--gold); background: var(--gold-soft); }
@media (prefers-reduced-motion: reduce) { .ast-mic.on::after, .ast-onda i, .ast-resp { animation: none; } }

/* Saída suave das janelas (painel e app): a cópia da janela que fechou encolhe um pouco, desfoca e some
   — inspirada no "Toggle modal" da transitions.dev (transição com escala). Ver NP.saidaSuave. */
.np-saindo { pointer-events: none !important; animation: npSaiFundo .34s ease forwards !important; }
.np-saindo > * { animation: npSai .3s cubic-bezier(.4, 0, .2, 1) forwards !important; will-change: transform, opacity, filter; }
.sheet-bg.np-saindo:not(.centro) > .sheet { animation: npDesce .32s cubic-bezier(.4, 0, .2, 1) forwards !important; }
@keyframes npSaiFundo { to { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); } }
@keyframes npSai { to { opacity: 0; transform: translateY(6px) scale(.96); filter: blur(3px); } }
@keyframes npDesce { to { opacity: 0; transform: translateY(48px); filter: blur(2px); } }
/* Assistente: respostas de finanças escritas de forma enxuta — só o número, grande */
.ast-rt.num { font-size: 30px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
