@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-pure-black: #000000;
  --bg-card: #0c0c0e;
  --bg-card-hover: #121215;
  --bg-surface: #141418;
  --bg-input: #101013;
  
  --border-subtle: #202024;
  --border-card: #1c1c20;
  --border-focus: #E6392E;
  
  --red-primary: #E6392E;
  --red-hover: #D02E24;
  --red-soft: rgba(230, 57, 46, 0.12);
  
  --text-pure-white: #ffffff;
  --text-light: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-green: #10b981;
  --accent-blue: #3b82f6;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-pure-black);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-pure-white);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--red-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-pure-white);
  line-height: 1.25;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #050507;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--text-pure-white);
  background: var(--bg-surface);
}

.nav-link.active {
  color: var(--text-pure-white);
  background: var(--red-soft);
  border: 1px solid rgba(230, 57, 46, 0.3);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-pure-white);
}

.user-badge .role-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--red-soft);
  color: var(--red-primary);
}

.btn-logout {
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--bg-surface);
  border-color: #333;
  color: var(--text-pure-white);
}

.mobile-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 1.1rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.mobile-toggle:hover {
  background: #202026;
  border-color: #333;
}

/* SLIDE-OUT MOBILE DRAWER */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 290px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: #0d0d10;
  border-left: 1px solid var(--border-subtle);
  z-index: 99999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0,0,0,0.8);
  visibility: hidden;
}

body.drawer-open {
  overflow: hidden !important;
}

body.drawer-open .mobile-drawer-overlay {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: block !important;
}

body.drawer-open .mobile-drawer {
  transform: translateX(0) !important;
  visibility: visible !important;
  display: flex !important;
}

.drawer-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 2px;
}

.drawer-close {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.drawer-close:hover {
  color: #fff;
  border-color: #444;
}

.drawer-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  transition: var(--transition);
}

.drawer-link i {
  width: 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.drawer-link:hover, .drawer-link.active {
  background: var(--red-soft);
  border-color: rgba(230, 57, 46, 0.4);
  color: #fff;
}

.drawer-link.active i {
  color: var(--red-primary);
}

.drawer-footer {
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--border-card);
}

/* MAIN CONTAINER */
.main-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 4rem;
  flex: 1;
}

/* FLASH ALERTS */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.alert-error {
  background: rgba(230, 57, 46, 0.08);
  border: 1px solid rgba(230, 57, 46, 0.25);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-subtle);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-card);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-pure-white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--red-primary);
  color: var(--text-pure-white);
  border-color: var(--red-primary);
}

.btn-primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  color: var(--text-pure-white);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-pure-white);
}

.btn-secondary:hover {
  background: #1c1c22;
  border-color: #333;
  color: var(--text-pure-white);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-pure-white);
}

.btn-outline:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-whatsapp {
  background: #25D366;
  color: #000000;
  font-weight: 700;
}

.btn-whatsapp:hover {
  background: #20BA5A;
  color: #000000;
}

/* HERO SECTION */
.hero-banner {
  background: #08080a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.hero-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.hero-content h1 span {
  color: var(--red-primary);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--red-primary);
  flex-shrink: 0;
}

.stat-info .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-info .stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-pure-white);
  line-height: 1.1;
  margin-top: 2px;
}

.stat-info .stat-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* HABIT TRACKER CHECKLIST */
.habits-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.habit-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  cursor: pointer;
  user-select: none;
}

.habit-row:hover {
  background: #1a1a20;
  border-color: #2e2e36;
}

.habit-row.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.habit-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.habit-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: var(--transition);
}

.habit-row.completed .habit-checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #000;
}

.habit-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-pure-white);
}

.habit-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ROADMAP & TIMELINE (WELCOME PACKAGE) */
.roadmap-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.roadmap-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.roadmap-phase-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red-primary);
  margin-bottom: 6px;
}

.roadmap-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-pure-white);
  margin-bottom: 10px;
}

.roadmap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roadmap-list li {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.roadmap-list li strong {
  color: var(--text-pure-white);
}

.bullet-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-primary);
  margin-top: 8px;
  flex-shrink: 0;
}

/* NUTRITION & MACROS */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 1rem 0;
}

.macro-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.macro-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-pure-white);
}

.macro-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.meal-slot {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 10px;
}

.meal-time-badge {
  display: inline-block;
  background: var(--red-soft);
  border: 1px solid rgba(230, 57, 46, 0.3);
  color: var(--red-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
}

/* WORKOUT ROUTINES */
.exercise-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.exercise-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.exercise-table td {
  padding: 12px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-card);
}

.exercise-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* FORMS & INPUTS */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-pure-white);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #fff;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--red-primary);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

/* LOGIN SCREEN */
.auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: #09090b;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header img {
  height: 42px;
  margin-bottom: 0.75rem;
}

.auth-header h2 {
  font-size: 1.4rem;
  margin-bottom: 3px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* FOOTER */
.footer {
  border-top: 1px solid var(--border-card);
  background: #050507;
  padding: 1.25rem 0;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* COPY PILL */
.copy-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: monospace;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-banner {
    padding: 1.25rem;
    gap: 1rem;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .main-wrapper {
    padding: 1rem 0.85rem 2.5rem;
  }

  .card {
    padding: 1.25rem;
  }

  .stat-card {
    padding: 1rem;
  }
}
