/* ============================================================================
   TX FITNESS — PORTAL DO ALUNO "MODO APP MOBILE" (iPhone / Android PWA)
   Gráficos animados de frequência, último treino, agenda pessoal e vitrine de
   profissionais filiados com estrelas. 100% CSP-safe (zero inline style).
   ============================================================================ */

@keyframes paFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes paRingIn { from { stroke-dashoffset: 264; } }
@keyframes paBarGrow { from { transform: scaleY(0.06); opacity: 0.25; } to { transform: scaleY(1); opacity: 1; } }
@keyframes paLineDraw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

.pa-fade-up { animation: paFadeUp 420ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.pa-ring-arc { animation: paRingIn 920ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both; filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.4)); }
.pa-bar-anim { transform-box: fill-box; transform-origin: 50% 100%; animation: paBarGrow 640ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.pa-line-anim { stroke-dashoffset: 0; animation: paLineDraw 980ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both; }
.pa-d-0 { animation-delay: 0ms; }
.pa-d-1 { animation-delay: 55ms; }
.pa-d-2 { animation-delay: 110ms; }
.pa-d-3 { animation-delay: 165ms; }
.pa-d-4 { animation-delay: 220ms; }
.pa-d-5 { animation-delay: 275ms; }
.pa-d-6 { animation-delay: 330ms; }

.pa-app-wrap { display: grid; gap: 16px; margin-top: 18px; }
.pa-toast { margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 700; }
.pa-toast.is-ok { background: #EAF7EF; border: 1px solid #86EFAC; color: #146C43; }
.pa-toast.is-err { background: #FDEDEE; border: 1px solid #FCA5A5; color: #A82432; }

/* Hero TX Evolução (Deep Navy + TX Blue) */
.pa-hero {
 display: grid;
 grid-template-columns: 146px minmax(0, 1.15fr) minmax(240px, 1fr);
 gap: 18px 20px;
 align-items: center;
 padding: 20px 22px;
 border-radius: 16px;
 background:
  radial-gradient(420px 200px at 10% 0%, rgba(36, 94, 234, 0.34), transparent 72%),
  radial-gradient(320px 180px at 94% 100%, rgba(16, 185, 129, 0.16), transparent 70%),
  linear-gradient(140deg, #0D1E32 0%, #10243A 55%, #14304E 100%);
 border: 1px solid rgba(96, 165, 250, 0.28);
 color: #F8FAFC;
 box-shadow: 0 14px 32px rgba(10, 22, 38, 0.2);
}
.pa-hero-gauge {
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 8px;
 padding-right: 16px;
 border-right: 1px solid rgba(148, 163, 184, 0.22);
}
.pa-ring-svg { width: 108px; height: 108px; display: block; overflow: visible; }
.pa-ring-track { stroke: rgba(148, 163, 184, 0.24); }
.pa-ring-val { fill: #FFFFFF; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pa-ring-sub { fill: #93C5FD; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pa-streak-pill {
 padding: 4px 10px;
 border-radius: 999px;
 background: rgba(36, 94, 234, 0.28);
 border: 1px solid rgba(96, 165, 250, 0.45);
 color: #DBEAFE;
 font-size: 11px;
 font-weight: 700;
 text-align: center;
}
.pa-hero-body { display: grid; gap: 12px; min-width: 0; }
.pa-eyebrow-sky { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; color: #60A5FA; }
html .portal-page .portal-block .pa-hero-head h3,
.pa-hero-head h3 { margin: 2px 0 0; font-size: 18px; font-weight: 800; color: #FFFFFF; }
.pa-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pa-kpi {
 padding: 9px 11px;
 border-radius: 10px;
 background: rgba(255, 255, 255, 0.07);
 border: 1px solid rgba(148, 163, 184, 0.18);
 display: grid;
 gap: 1px;
}
.pa-kpi span { font-size: 10.5px; color: #94A3B8; font-weight: 600; }
.pa-kpi strong { font-size: 21px; font-weight: 800; color: #FFFFFF; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pa-kpi small { font-size: 10.5px; color: #CBD5E1; }

.pa-week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pa-day-pill {
 display: flex;
 flex-direction: column;
 align-items: center;
 gap: 3px;
 padding: 7px 4px;
 border-radius: 10px;
 background: rgba(255, 255, 255, 0.05);
 border: 1px solid rgba(148, 163, 184, 0.16);
 color: #94A3B8;
 font-size: 11px;
}
.pa-day-pill.is-hit {
 background: rgba(36, 94, 234, 0.34);
 border-color: rgba(96, 165, 250, 0.65);
 color: #FFFFFF;
}
.pa-day-dot {
 width: 20px;
 height: 20px;
 border-radius: 999px;
 display: grid;
 place-items: center;
 font-size: 11px;
 font-weight: 800;
 background: rgba(148, 163, 184, 0.18);
}
.pa-day-pill.is-hit .pa-day-dot { background: #10B981; color: #FFFFFF; }

.pa-hero-chart {
 display: grid;
 gap: 6px;
 padding-left: 16px;
 border-left: 1px solid rgba(148, 163, 184, 0.22);
}
.pa-chart-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #93C5FD; }
.pa-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pa-grid { stroke: rgba(148, 163, 184, 0.22); }
.pa-bar-val { fill: #E2E8F0; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pa-axis { fill: #94A3B8; font-size: 10px; font-weight: 600; }

/* Cards 2 colunas: Último Treino + Minha Agenda */
.pa-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
html .portal-page .portal-block .pa-card,
.pa-card {
 background: var(--nx-surface, #FFFFFF);
 border: 1px solid var(--nx-border, #D9DEE6);
 border-radius: 14px;
 padding: 18px;
 margin: 0;
 display: grid;
 gap: 12px;
 align-content: start;
}
html[data-by-theme="dark"] .portal-page .portal-block .pa-card,
html[data-by-theme="dark"] .pa-card { background: #161D27; border-color: #2B3646; color: #F1F5F9; }
.pa-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pa-eyebrow { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: #245EEA; }
html[data-by-theme="dark"] .pa-eyebrow { color: #60A5FA; }
.pa-card-head h3 { margin: 2px 0 0; font-size: 16px; font-weight: 800; }
.pa-muted { margin: 0; font-size: 13.5px; color: var(--nx-text-muted, #526174); }
.pa-next-chip {
 padding: 4px 10px;
 border-radius: 999px;
 background: #DBEAFE;
 color: #1D4ED8;
 font-size: 12px;
 font-weight: 600;
}
html[data-by-theme="dark"] .pa-next-chip { background: #172B4D; color: #93C5FD; }
.pa-last-row {
 padding: 12px 14px;
 border-radius: 10px;
 background: var(--nx-bg, #F6F7F9);
 border: 1px solid var(--nx-border, #D9DEE6);
 display: grid;
 gap: 3px;
}
html[data-by-theme="dark"] .pa-last-row { background: #1E2734; border-color: #2B3646; }
.pa-last-row strong { font-size: 15px; font-weight: 800; }
.pa-last-row span { font-size: 13px; color: var(--nx-text-muted, #526174); }
.pa-print-meta { margin: 0; font-size: 12.5px; color: var(--nx-text-muted, #526174); }
.pa-quick-log { display: grid; gap: 8px; }
.pa-quick-label { font-size: 12.5px; font-weight: 700; color: var(--nx-text-muted, #526174); }
.pa-block-chips { display: flex; flex-wrap: wrap; gap: 8px; }
html .portal-page .portal-block .pa-log-btn,
.pa-log-btn {
 min-height: 40px;
 padding: 8px 14px;
 border-radius: 10px;
 border: 1px solid var(--nx-border, #CBD5E1);
 background: var(--nx-bg, #F8FAFC);
 color: var(--nx-text, #0F172A);
 font-weight: 700;
 font-size: 13.5px;
 cursor: pointer;
}
html .portal-page .portal-block .pa-log-btn.is-primary,
.pa-log-btn.is-primary { background: #245EEA; border-color: #245EEA; color: #FFFFFF; }
html .portal-page .portal-block .pa-log-btn.is-primary:hover:not(:disabled),
.pa-log-btn.is-primary:hover:not(:disabled) { background: #1D4ED8; border-color: #1D4ED8; color: #FFFFFF; }
html .portal-page .portal-block .pa-log-btn:hover:not(:disabled),
.pa-log-btn:hover:not(:disabled) { filter: brightness(1.04); }

.pa-today-banner,
.pa-next-banner {
 padding: 11px 14px;
 border-radius: 10px;
 display: grid;
 gap: 2px;
}
.pa-today-banner { background: #EAF7EF; border: 1px solid #86EFAC; color: #146C43; }
.pa-next-banner { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A8A; }
html[data-by-theme="dark"] .pa-today-banner { background: #143326; border-color: #22C55E; color: #86EFAC; }
html[data-by-theme="dark"] .pa-next-banner { background: #172B4D; border-color: #3B82F6; color: #BFDBFE; }
.pa-plan-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pa-plan-chip {
 padding: 5px 10px;
 border-radius: 999px;
 background: var(--nx-bg, #F1F5F9);
 border: 1px solid var(--nx-border, #D9DEE6);
 font-size: 12px;
}
.pa-plan-chip.is-today { background: #245EEA; border-color: #245EEA; color: #FFFFFF; }
.pa-sched-form { display: grid; gap: 12px; }
.pa-sched-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pa-sched-meta label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; }
.pa-sched-days { display: grid; gap: 6px; }
.pa-sched-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 96px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--nx-bg, #F8FAFC); }
html[data-by-theme="dark"] .pa-sched-row { background: #1E2734; }
.pa-sched-row.is-on { border: 1px solid rgba(36, 94, 234, 0.45); }
.pa-sched-day-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; cursor: pointer; }
.pa-sched-actions, .pa-sched-foot { display: flex; gap: 8px; flex-wrap: wrap; }
html .portal-page .portal-block .pa-btn-primary,
.pa-btn-primary { min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 0; background: #245EEA; color: #FFFFFF; font-weight: 700; font-size: 13.5px; cursor: pointer; }
html .portal-page .portal-block .pa-btn-primary:hover:not(:disabled),
.pa-btn-primary:hover:not(:disabled) { background: #1D4ED8; color: #FFFFFF; }
html .portal-page .portal-block .pa-btn-secondary,
.pa-btn-secondary { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid #245EEA; background: #EFF6FF; color: #1D4ED8; font-weight: 700; font-size: 13px; cursor: pointer; }
html .portal-page .portal-block .pa-btn-secondary:hover:not(:disabled),
.pa-btn-secondary:hover:not(:disabled) { background: #DBEAFE; color: #1E40AF; border-color: #1D4ED8; }
html[data-by-theme="dark"] .portal-page .portal-block .pa-btn-secondary,
html[data-by-theme="dark"] .pa-btn-secondary { background: #172B4D; color: #93C5FD; border-color: #3B82F6; }
html .portal-page .portal-block .pa-btn-ghost,
.pa-btn-ghost { min-height: 36px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--nx-border, #CBD5E1); background: transparent; color: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }

/* Vitrine de Profissionais Filiados + Estrelas na aba Agenda */
.pa-pros-section { display: grid; gap: 14px; margin-bottom: 22px; }
.pa-pros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
html .portal-page .portal-block .pa-pro-card,
.pa-pro-card {
 background: var(--nx-surface, #FFFFFF);
 border: 1px solid var(--nx-border, #D9DEE6);
 border-radius: 14px;
 padding: 16px;
 margin: 0;
 display: grid;
 gap: 10px;
 align-content: start;
}
html[data-by-theme="dark"] .portal-page .portal-block .pa-pro-card,
html[data-by-theme="dark"] .pa-pro-card { background: #161D27; border-color: #2B3646; }
.pa-pro-head { display: flex; align-items: center; gap: 12px; }
.pa-pro-avatar {
 width: 46px;
 height: 46px;
 border-radius: 12px;
 background: linear-gradient(135deg, #10243A, #245EEA);
 color: #FFFFFF;
 font-weight: 800;
 font-size: 16px;
 display: grid;
 place-items: center;
 flex: none;
}
.pa-pro-meta { min-width: 0; display: grid; gap: 2px; }
.pa-pro-meta strong { font-size: 15px; font-weight: 800; }
.pa-pro-spec { font-size: 12px; font-weight: 700; color: #245EEA; }
html[data-by-theme="dark"] .pa-pro-spec { color: #60A5FA; }
.pa-stars { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #D97706; }
html[data-by-theme="dark"] .pa-stars { color: #FBBF24; }
.pa-stars small { color: var(--nx-text-muted, #64748B); font-weight: 600; }
.pa-pro-bio { margin: 0; font-size: 13px; line-height: 1.45; color: var(--nx-text-muted, #526174); }
.pa-slot-list { display: flex; flex-wrap: wrap; gap: 7px; }
html .portal-page .portal-block .pa-slot-btn,
.pa-slot-btn {
 min-height: 36px;
 padding: 7px 11px;
 border-radius: 9px;
 border: 1px solid rgba(36, 94, 234, 0.35);
 background: #EFF6FF;
 color: #1D4ED8;
 font-size: 12px;
 font-weight: 700;
 cursor: pointer;
}
html .portal-page .portal-block .pa-slot-btn:hover:not(:disabled),
.pa-slot-btn:hover:not(:disabled) { background: #245EEA; color: #FFFFFF; border-color: #245EEA; }
html[data-by-theme="dark"] .portal-page .portal-block .pa-slot-btn,
html[data-by-theme="dark"] .pa-slot-btn { background: #172B4D; color: #93C5FD; border-color: #3B82F6; }
.pa-bookings-list { display: grid; gap: 10px; }
.pa-booking-item {
 padding: 12px 14px;
 border-radius: 12px;
 background: var(--nx-bg, #F6F7F9);
 border: 1px solid var(--nx-border, #D9DEE6);
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 10px;
 flex-wrap: wrap;
}
html[data-by-theme="dark"] .pa-booking-item { background: #1E2734; border-color: #2B3646; }
.pa-rate-stars { display: inline-flex; gap: 4px; }
html .portal-page .portal-block .pa-rate-btn,
.pa-rate-btn {
 width: 34px;
 height: 34px;
 min-height: 34px;
 padding: 0;
 border-radius: 8px;
 border: 1px solid #F59E0B;
 background: #FFFBEB;
 color: #B45309;
 font-size: 14px;
 font-weight: 800;
 cursor: pointer;
}
html .portal-page .portal-block .pa-rate-btn:hover:not(:disabled),
.pa-rate-btn:hover:not(:disabled) { background: #F59E0B; color: #FFFFFF; border-color: #D97706; }

/* Evita que o <svg class="sprite"> inline crie uma faixa fantasma de 20px no topo do body */
.portal-page > svg.sprite {
 position: absolute;
 width: 0;
 height: 0;
 overflow: hidden;
 pointer-events: none;
}

/* Barra Inferior Fixa estilo App Nativo no Celular (iPhone & Android) */
.portal-mobile-dock { display: none; }
@media (max-width: 960px) {
 .pa-hero { grid-template-columns: 126px minmax(0, 1fr); }
 .pa-hero-chart { grid-column: 1 / -1; padding-left: 0; padding-top: 12px; border-left: 0; border-top: 1px solid rgba(148, 163, 184, 0.22); }
 .pa-grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
 /* Trava a janela externa estilo App Nativo (tela cheia até o topo, sem mover/pular ao rolar) */
 html:has(body.portal-page #portal-dashboard:not([hidden])),
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  overscroll-behavior: none;
 }
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) #portal-dashboard.portal-app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  overscroll-behavior: none;
 }
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) .portal-fixed-chrome {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 40;
 }
 html[data-nx-theme="corporativo"] body.portal-page .portal-header {
  margin: 0 !important;
  padding-top: env(safe-area-inset-top, 0px);
 }
 html[data-nx-theme="corporativo"] body.portal-page .portal-jump {
  margin: 0 auto !important;
 }
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) .portal-main-wrap {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 14px 12px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  touch-action: pan-y;
 }
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) .portal-main-wrap > * + * {
  margin-top: 12px;
 }
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) .portal-footer {
  display: none;
 }
 .pa-hero { grid-template-columns: minmax(0, 1fr); padding: 16px; }
 .pa-hero-gauge { padding-right: 0; padding-bottom: 12px; border-right: 0; border-bottom: 1px solid rgba(148, 163, 184, 0.22); }
 .pa-kpis { gap: 6px; }
 .pa-kpi { padding: 8px 6px; }
 .pa-kpi span { font-size: 10.5px; letter-spacing: 0; white-space: nowrap; }
 .pa-kpi small { font-size: 10.5px; letter-spacing: 0; line-height: 1.25; white-space: nowrap; }
 html[data-nx-theme="corporativo"] .portal-jump {
  padding: 0 10px;
  gap: 10px;
  justify-content: space-between;
 }
 html[data-nx-theme="corporativo"] .portal-jump a {
  font-size: 12px;
 }
 html[data-nx-theme="corporativo"] .portal-main-wrap {
  padding-bottom: 20px;
 }
 html[data-nx-theme="corporativo"] .portal-page .portal-footer {
  position: static;
  height: auto;
  padding: 12px 0 calc(84px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  border-top: 1px solid var(--nx-border);
 }
 .portal-mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0 !important;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(16, 36, 58, 0.97);
  border-top: 1px solid rgba(96, 165, 250, 0.28);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 24px rgba(2, 6, 23, 0.28);
 }
 html[data-nx-theme="corporativo"] body.portal-page:has(#portal-dashboard:not([hidden])) .portal-mobile-dock {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  margin: 0 !important;
 }
 html .portal-page .portal-mobile-dock button.portal-dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #94A3B8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 2px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: none;
 }
 html .portal-page .portal-mobile-dock button.portal-dock-btn:hover:not(:disabled),
 html .portal-page .portal-mobile-dock button.portal-dock-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
 }
 html .portal-page .portal-mobile-dock button.portal-dock-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
 }
 html .portal-page .portal-mobile-dock button.portal-dock-btn.is-active,
 html .portal-page .portal-mobile-dock button.portal-dock-btn.is-active:hover,
 html .portal-page .portal-mobile-dock button.portal-dock-btn.is-active:focus-visible {
  color: #FFFFFF;
  background: #245EEA;
 }
}
@media (prefers-reduced-motion: reduce) {
 .pa-fade-up, .pa-ring-arc, .pa-bar-anim, .pa-line-anim { animation: none !important; transition: none !important; }
}
