/* ============================================================
   FitManager Pro — Portal do Cliente CSS
   Design premium, mobile-first, Angola 🇦🇴
   ============================================================ */

:root {
  --p-primary:   #6366f1;
  --p-primary-d: #4f46e5;
  --p-dark:      #0f172a;
  --p-card:      #1e293b;
  --p-border:    #334155;
  --p-text:      #f1f5f9;
  --p-text-2:    #94a3b8;
  --p-text-3:    #64748b;
  --p-success:   #22c55e;
  --p-warning:   #f59e0b;
  --p-danger:    #ef4444;
  --p-radius:    16px;
  --p-radius-sm: 10px;
}

/* ── Wrap ──────────────────────────────────────────────────── */
#fmp-portal-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--p-dark);
  min-height: 100vh;
  color: var(--p-text);
  position: relative;
}

/* ── Screens ───────────────────────────────────────────────── */
.fmp-screen { width: 100%; }

/* ── LOGIN SCREEN ──────────────────────────────────────────── */
#fmp-screen-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}
#fmp-screen-login::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  top: -100px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}
.fmp-login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.fmp-login-logo {
  margin-bottom: 40px;
}
.fmp-logo-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 24px rgba(99,102,241,.5));
  animation: fmpPulse 3s ease-in-out infinite;
}
@keyframes fmpPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
.fmp-login-logo h1 {
  font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin: 0 0 8px;
}
.fmp-login-logo p {
  color: var(--p-text-2); font-size: 14px; line-height: 1.6;
  margin: 0;
}
.fmp-login-form { display: flex; flex-direction: column; gap: 16px; }
.fmp-code-input-wrap { position: relative; }
.fmp-code-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .3em;
  text-align: center;
  background: rgba(255,255,255,.05);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: var(--p-radius);
  color: var(--p-text);
  outline: none;
  transition: all .2s;
}
.fmp-code-input::placeholder { font-size: 16px; letter-spacing: .05em; color: var(--p-text-3); font-weight: 400; }
.fmp-code-input:focus { border-color: var(--p-primary); box-shadow: 0 0 0 4px rgba(99,102,241,.2); background: rgba(255,255,255,.08); }
.fmp-login-error {
  padding: 12px 16px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--p-radius-sm);
  color: #fca5a5;
  font-size: 13px;
}
.fmp-portal-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--p-primary), var(--p-primary-d));
  color: #fff; font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--p-radius);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
  transition: all .2s;
}
.fmp-portal-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(99,102,241,.45); }
.fmp-portal-btn-primary:active { transform: translateY(0); }

/* ── HEADER ────────────────────────────────────────────────── */
.fmp-portal-header {
  background: linear-gradient(135deg, #1e1b4b, #1e293b);
  border-bottom: 1px solid var(--p-border);
  position: sticky; top: 0; z-index: 100;
}
.fmp-portal-header-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; max-width: 768px; margin: 0 auto;
}
.fmp-portal-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  flex: 1;
}
.fmp-portal-logo { font-size: 22px; filter: none; }
.fmp-portal-user { display: flex; align-items: center; gap: 8px; }
.fmp-portal-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--p-primary), var(--p-primary-d));
  color: #fff; font-size: 13px; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fmp-portal-user strong { display: block; font-size: 13px; }
.fmp-portal-user small  { display: block; font-size: 11px; color: var(--p-text-2); }
.fmp-portal-btn-icon {
  background: rgba(255,255,255,.07); border: 1px solid var(--p-border);
  border-radius: 8px; padding: 7px; cursor: pointer; color: var(--p-text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.fmp-portal-btn-icon:hover { background: rgba(239,68,68,.15); color: var(--p-danger); border-color: var(--p-danger); }

/* ── NAV ───────────────────────────────────────────────────── */
.fmp-portal-nav {
  display: flex;
  background: #1a2234;
  border-bottom: 1px solid var(--p-border);
  max-width: 768px; margin: 0 auto;
}
.fmp-pnav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 8px;
  background: none; border: none;
  color: var(--p-text-3); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  border-bottom: 2px solid transparent;
}
.fmp-pnav-btn span { font-size: 18px; }
.fmp-pnav-btn.active { color: var(--p-primary); border-bottom-color: var(--p-primary); }
.fmp-pnav-btn:hover  { color: var(--p-text); }

/* ── SECTIONS ──────────────────────────────────────────────── */
.fmp-portal-section {
  max-width: 768px; margin: 0 auto;
  padding: 20px 16px;
}
.fmp-portal-section-title {
  font-size: 18px; font-weight: 700; margin: 0 0 16px;
  color: var(--p-text);
}

/* ── PLAN ──────────────────────────────────────────────────── */
.fmp-plan-header-card {
  background: linear-gradient(135deg, #1e1b4b, #1e293b);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 16px;
  margin-bottom: 16px;
}
.fmp-plan-header-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fmp-plan-tag {
  padding: 4px 12px;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 99px;
  font-size: 12px; font-weight: 600; color: #a5b4fc;
}
.fmp-week-strip { display: flex; gap: 6px; }
.fmp-ws-day {
  flex: 1; text-align: center; padding: 8px 4px;
  border: 1px solid var(--p-border); border-radius: 8px;
  background: rgba(255,255,255,.03);
}
.fmp-ws-day.active { background: rgba(99,102,241,.15); border-color: rgba(99,102,241,.4); }
.fmp-ws-label { display: block; font-size: 9px; color: var(--p-text-3); text-transform: uppercase; }
.fmp-ws-val { display: block; font-size: 11px; font-weight: 700; color: var(--p-primary); }

/* ── DAY CARD ──────────────────────────────────────────────── */
.fmp-day-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.fmp-day-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(99,102,241,.05));
  border-bottom: 1px solid var(--p-border);
}
.fmp-day-letter {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--p-primary), var(--p-primary-d));
  color: #fff; font-size: 16px; font-weight: 800;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fmp-day-name  { flex: 1; font-weight: 700; font-size: 14px; }
.fmp-day-count { font-size: 11px; color: var(--p-text-3); }

/* ── EXERCISE ──────────────────────────────────────────────── */
.fmp-exercise-list-portal { display: flex; flex-direction: column; }
.fmp-ex-portal {
  border-bottom: 1px solid var(--p-border);
  cursor: pointer;
  transition: background .15s;
}
.fmp-ex-portal:last-child { border-bottom: none; }
.fmp-ex-portal:hover { background: rgba(255,255,255,.03); }
.fmp-ex-portal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
}
.fmp-ex-num {
  width: 24px; height: 24px;
  background: rgba(99,102,241,.2);
  color: var(--p-primary); font-size: 11px; font-weight: 800;
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fmp-ex-thumb {
  width: 40px; height: 40px;
  border-radius: 8px; object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--p-border);
}
.fmp-ex-main { flex: 1; min-width: 0; }
.fmp-ex-main strong { display: block; font-size: 13px; font-weight: 600; }
.fmp-ex-main small  { display: block; font-size: 11px; color: var(--p-text-2); }
.fmp-ex-sets { font-size: 14px; font-weight: 800; color: var(--p-primary); white-space: nowrap; }
.fmp-ex-chevron { color: var(--p-text-3); flex-shrink: 0; transition: transform .2s; }
.fmp-ex-portal-detail {
  padding: 0 14px 12px 48px;
  display: flex; flex-direction: column; gap: 6px;
  animation: fmpFadeIn .15s ease;
}
@keyframes fmpFadeIn { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }
.fmp-ex-detail-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--p-text-2);
}
.fmp-ex-detail-row strong { color: var(--p-text); font-size: 13px; }
.fmp-ex-notes { flex-direction: column; gap: 2px; }
.fmp-ex-video-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 4px; padding: 7px 14px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  border-radius: 99px; font-size: 12px; color: #fca5a5;
  text-decoration: none; transition: all .2s;
  align-self: flex-start;
}
.fmp-ex-video-link:hover { background: rgba(239,68,68,.2); color: #f87171; }

/* ── BODY ASSESSMENT ───────────────────────────────────────── */
.fmp-body-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.fmp-body-card-latest {
  border-color: rgba(99,102,241,.5);
  box-shadow: 0 0 0 1px rgba(99,102,241,.2);
}
.fmp-body-latest-badge {
  position: absolute; top: -10px; left: 16px;
  padding: 3px 12px;
  background: linear-gradient(135deg, var(--p-primary), var(--p-primary-d));
  border-radius: 99px; font-size: 11px; font-weight: 700; color: #fff;
}
.fmp-body-date { font-size: 12px; color: var(--p-text-2); margin-bottom: 12px; }
.fmp-body-date span { color: var(--p-primary); font-weight: 600; }
.fmp-body-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 12px; }
.fmp-body-metric {
  padding: 8px 12px;
  background: rgba(255,255,255,.04);
  border-radius: var(--p-radius-sm);
  display: flex; flex-direction: column; gap: 2px;
}
.fmp-body-metric span { font-size: 10px; color: var(--p-text-3); text-transform: uppercase; }
.fmp-body-metric strong { font-size: 14px; font-weight: 700; }
.fmp-fat-bar-wrap { margin-top: 4px; }
.fmp-fat-bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--p-text-2); margin-bottom: 6px; }
.fmp-fat-bar { height: 8px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.fmp-fat-bar-fill { height: 100%; border-radius: 99px; transition: width .8s ease; }
.fmp-fat-bar-goal { font-size: 11px; color: var(--p-text-3); margin-top: 4px; }

/* ── SCHEDULE ──────────────────────────────────────────────── */
.fmp-session-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-left: 4px solid var(--p-primary);
  border-radius: var(--p-radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.fmp-session-date { text-align: center; flex-shrink: 0; min-width: 40px; }
.fmp-session-date strong { display: block; font-size: 18px; font-weight: 800; }
.fmp-session-date small  { display: block; font-size: 10px; color: var(--p-text-3); text-transform: uppercase; }
.fmp-session-body { flex: 1; }
.fmp-session-body strong { display: block; font-size: 14px; font-weight: 600; }
.fmp-session-body span   { display: block; font-size: 12px; color: var(--p-text-2); margin-top: 2px; }
.fmp-session-status { padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ── PROFILE ───────────────────────────────────────────────── */
.fmp-profile-avatar {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--p-primary), var(--p-primary-d));
  color: #fff; font-size: 28px; font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}
.fmp-profile-name { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 20px; }
.fmp-profile-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 20px; }
.fmp-profile-item {
  background: rgba(255,255,255,.04); border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm); padding: 12px;
}
.fmp-profile-item span  { display: block; font-size: 11px; color: var(--p-text-3); margin-bottom: 3px; }
.fmp-profile-item strong{ font-size: 13px; font-weight: 600; }
.fmp-portal-code-badge {
  text-align: center;
  padding: 12px 20px;
  background: rgba(99,102,241,.1); border: 1px solid rgba(99,102,241,.3);
  border-radius: var(--p-radius);
  font-size: 13px; color: var(--p-text-2);
}
.fmp-portal-code-badge strong { color: var(--p-primary); font-size: 20px; letter-spacing: .2em; }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.fmp-empty-portal {
  text-align: center; padding: 48px 24px;
}
.fmp-empty-portal span { font-size: 48px; display: block; margin-bottom: 12px; }
.fmp-empty-portal p { color: var(--p-text-2); font-size: 14px; line-height: 1.6; margin: 0; }

/* ── LOADING ───────────────────────────────────────────────── */
.fmp-portal-loading {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.7);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.fmp-portal-spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,.1);
  border-top-color: var(--p-primary);
  border-radius: 50%;
  animation: fmpSpin .8s linear infinite;
}
@keyframes fmpSpin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .fmp-body-metrics { grid-template-columns: 1fr 1fr; }
  .fmp-profile-grid { grid-template-columns: 1fr; }
  .fmp-week-strip   { gap: 3px; }
  .fmp-ws-day       { padding: 6px 2px; }
}
