/* ============================================================
   GainMetric — Design System & Styles
   Theme: Matte Black + Neon Lime Accent
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Base palette */
  --black-pure:    #000000;
  --black-deep:    #050505;
  --black-matte:   #0a0a0a;
  --black-card:    #111111;
  --black-raised:  #161616;
  --black-border:  #1e1e1e;
  --black-hover:   #222222;

  /* Neon accent — Lime Green */
  --accent:        #39ff14;
  --accent-dim:    #2bcc0f;
  --accent-glow:   rgba(57, 255, 20, 0.25);
  --accent-subtle: rgba(57, 255, 20, 0.08);

  /* Secondary accents for macro rings */
  --protein:       #39ff14;
  --carbs:         #00d4ff;
  --fats:          #ff6b35;
  --calories:      #f5f5f5;

  /* Text */
  --text-primary:  #f0f0f0;
  --text-secondary:#8a8a8a;
  --text-muted:    #555555;

  /* Misc */
  --danger:        #ff4444;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;
  --font-display:  'Outfit', 'Inter', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--black-matte);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- Typography ---------- */
h1 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin-bottom: 1rem; }
h4 { font-weight: 600; font-size: 0.95rem; }
.accent { color: var(--accent); }
.subtitle { color: var(--text-secondary); font-size: 0.95rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); font-size: 0.9rem; padding: 0.65rem 1.4rem;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: var(--black-pure);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { background: #50ff30; box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(57,255,20,0.15); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--accent); border: 1.5px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-subtle); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--black-hover); }
.btn-sm { font-size: 0.8rem; padding: 0.45rem 0.9rem; }
.btn-lg { font-size: 1rem; padding: 0.85rem 2rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(255,68,68,0.1); }

/* ---------- Inputs ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select {
  width: 100%; padding: 0.7rem 1rem; font-size: 0.9rem;
  background: var(--black-deep); border: 1.5px solid var(--black-border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text-muted); }
.input-sm { max-width: 160px; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.input-lg { font-size: 1rem; padding: 0.85rem 1.2rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
select option { background: var(--black-card); color: var(--text-primary); }
select optgroup { color: var(--accent); font-weight: 600; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,0.85); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--black-border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none;
}
.logo-img {
  height: 36px; width: auto; object-fit: contain; border-radius: 50%;
}
.nav-logo-text {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text-primary);
}
.nav-logo-text span { color: var(--accent); }
.nav-links { display: flex; gap: 0.25rem; }
.nav-link {
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.9rem;
  color: var(--text-secondary); transition: all var(--transition); position: relative;
}
.nav-link:hover { color: var(--text-primary); background: var(--black-hover); }
.nav-link.active { color: var(--accent); background: var(--accent-subtle); }

/* ---------- Cards ---------- */
.card {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color var(--transition);
}
.card:hover { border-color: #2a2a2a; }
.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.card-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.landing {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 4rem 1.5rem 3rem; position: relative; overflow: hidden;
}
.landing-glow {
  position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(57,255,20,0.08) 0%, transparent 70%);
  pointer-events: none; animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.6; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.1); } }
.landing-content { position: relative; z-index: 1; max-width: 720px; }
.landing-tag {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.25rem;
  display: inline-block; background: var(--accent-subtle);
  padding: 0.35rem 1rem; border-radius: 100px; border: 1px solid rgba(57,255,20,0.15);
}
.landing-headline {
  font-family: var(--font-display); font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900; line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.landing-sub {
  font-size: 1.1rem; color: var(--text-secondary); max-width: 540px; margin: 0 auto 2rem;
  line-height: 1.7;
}
.landing-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }
.landing-stats {
  display: flex; gap: 3rem; justify-content: center; flex-wrap: wrap;
  padding-top: 2rem; border-top: 1px solid var(--black-border);
}
.landing-stat { text-align: center; }
.landing-stat span { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; display: block; }
.landing-stat small { font-size: 0.8rem; color: var(--text-secondary); }

/* Features */
.landing-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem; max-width: 900px; width: 100%;
  margin-top: 4rem; position: relative; z-index: 1;
}
.feature-card {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: var(--radius); padding: 2rem 1.5rem;
  text-align: left; transition: all var(--transition);
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 30px rgba(57,255,20,0.08); }
.feature-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ============================================================
   AUTH MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; animation: fadeIn 0.2s ease;
}
.modal-card {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 420px;
  position: relative;
}
.modal-close {
  position: absolute; top: 1rem; right: 1.25rem;
  background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-card h2 { margin-bottom: 1.5rem; }
.auth-toggle { margin-top: 1rem; font-size: 0.85rem; color: var(--text-secondary); text-align: center; }
.auth-toggle a { color: var(--accent); cursor: pointer; font-weight: 600; }
.auth-toggle a:hover { text-decoration: underline; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: #2a2a2a; }
.stat-card small { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.stat-card h2 {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 800;
  color: var(--accent); margin: 0.25rem 0 0.5rem;
}
.stat-bar {
  height: 6px; background: var(--black-border); border-radius: 100px; overflow: hidden;
}
.stat-bar-fill {
  height: 100%; background: var(--accent); border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px var(--accent-glow);
}
.stat-detail { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* Chart */
.chart-card { margin-bottom: 1.5rem; }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap canvas { width: 100% !important; }

/* Quick Actions */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.action-card {
  display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem;
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: var(--radius); transition: all var(--transition); cursor: pointer;
}
.action-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(57,255,20,0.06); }
.action-icon { font-size: 1.5rem; }
.action-arrow { margin-left: auto; color: var(--text-muted); font-size: 1.2rem; transition: transform var(--transition); }
.action-card:hover .action-arrow { transform: translateX(4px); color: var(--accent); }

/* ============================================================
   STRENGTH TRACKER
   ============================================================ */
.strength-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
@media (max-width: 768px) { .strength-layout { grid-template-columns: 1fr; } }

.set-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--black-border);
}
.set-row:last-child { border-bottom: none; }
.set-label {
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  min-width: 48px; text-transform: uppercase;
}
.set-row .input-sm { flex: 1; max-width: none; }
.set-actions { display: flex; gap: 0.5rem; margin: 0.75rem 0 1rem; }
#btn-log-exercise { margin-top: 0.5rem; }

/* History */
.history-list { max-height: 450px; overflow-y: auto; padding-right: 0.5rem; }
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--black-border); border-radius: 100px; }
.history-item {
  padding: 1rem 0; border-bottom: 1px solid var(--black-border);
  animation: fadeIn 0.3s ease;
}
.history-item:last-child { border-bottom: none; }
.history-item-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem;
}
.history-item-header h4 { color: var(--accent); }
.history-item-header small { color: var(--text-muted); font-size: 0.75rem; }
.history-sets {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.history-set-badge {
  background: var(--accent-subtle); color: var(--accent);
  font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem;
  border-radius: 100px; border: 1px solid rgba(57,255,20,0.15);
}
.empty-state { color: var(--text-muted); font-size: 0.9rem; font-style: italic; padding: 1rem 0; }

/* ============================================================
   MACRO TRACKER
   ============================================================ */
.macro-rings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem; margin-bottom: 1.5rem;
}
.ring-card {
  background: var(--black-card); border: 1px solid var(--black-border);
  border-radius: var(--radius); padding: 1.5rem; text-align: center;
  transition: border-color var(--transition);
}
.ring-card:hover { border-color: #2a2a2a; }
.ring-visual { position: relative; width: 100px; height: 100px; margin: 0 auto 0.75rem; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--black-border); stroke-width: 8; }
.ring-fill {
  fill: none; stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-protein { stroke: var(--protein); filter: drop-shadow(0 0 6px rgba(57,255,20,0.3)); }
.ring-carbs   { stroke: var(--carbs);   filter: drop-shadow(0 0 6px rgba(0,212,255,0.3)); }
.ring-fats    { stroke: var(--fats);    filter: drop-shadow(0 0 6px rgba(255,107,53,0.3)); }
.ring-calories{ stroke: var(--calories);filter: drop-shadow(0 0 6px rgba(245,245,245,0.15)); }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-center span { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }
.ring-center small { font-size: 0.7rem; color: var(--text-secondary); }
.ring-target { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Food Search */
.macro-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .macro-layout { grid-template-columns: 1fr; } }
.food-search-wrap { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.food-search-wrap input { flex: 1; }
.food-results { display: flex; flex-direction: column; gap: 0.5rem; max-height: 400px; overflow-y: auto; }
.food-result-item {
  display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1rem;
  background: var(--black-raised); border: 1px solid var(--black-border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
}
.food-result-item:hover { border-color: var(--accent); background: var(--accent-subtle); }
.food-result-info h4 { font-size: 0.9rem; margin-bottom: 0.15rem; }
.food-result-info small { color: var(--text-muted); font-size: 0.75rem; }
.food-result-cals { font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 0.9rem; white-space: nowrap; }

/* Food Log */
.food-log { display: flex; flex-direction: column; gap: 0.5rem; max-height: 380px; overflow-y: auto; }
.food-log-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0; border-bottom: 1px solid var(--black-border);
}
.food-log-item:last-child { border-bottom: none; }
.food-log-item-info h4 { font-size: 0.85rem; }
.food-log-item-info small { color: var(--text-muted); font-size: 0.75rem; }
.food-log-item button {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; transition: color var(--transition);
}
.food-log-item button:hover { color: var(--danger); }
.food-log-total {
  margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1.5px solid var(--black-border);
  display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600;
}
.food-modal-name {
  color: var(--accent); font-weight: 600; font-size: 1.05rem; margin-bottom: 1rem;
}
.macro-preview {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem;
  text-align: center;
}
.macro-preview-item { }
.macro-preview-item small { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.2rem; }
.macro-preview-item span { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.macro-preview-item.pro span { color: var(--protein); }
.macro-preview-item.carb span { color: var(--carbs); }
.macro-preview-item.fat span { color: var(--fats); }
.macro-preview-item.cal span { color: var(--text-primary); }

/* ---------- Custom Food Module ---------- */
.custom-food-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.25rem 0; color: var(--text-muted); font-size: 0.8rem;
}
.custom-food-divider::before, .custom-food-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--black-border);
}
.modal-card-wide { max-width: 580px; }
.modal-lg { max-width: 500px; }
.results-card { background: var(--black-bg); border-radius: var(--radius-md); padding: 1.5rem; text-align: center; margin-bottom: 1rem; border: 1px solid var(--black-border); }
.tdee-big { font-size: 2.5rem; font-weight: 800; margin: 0.5rem 0 1.5rem; }
.macro-split { display: flex; justify-content: center; gap: 1.5rem; }
.macro-col { display: flex; flex-direction: column; gap: 0.25rem; font-size: 1.1rem; }
.macro-col span { font-weight: 700; color: var(--text-primary); }
.modal-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.form-group-grow { grid-column: span 1; }
.row-group { display: flex; gap: 0.75rem; align-items: end; margin-bottom: 1.25rem; }
.row-group .form-group { margin-bottom: 0; }
.custom-food-actions { margin-top: 0.5rem; display: flex; justify-content: flex-end; }
.custom-foods-list-wrap {
  margin-top: 1.75rem; padding-top: 1.25rem;
  border-top: 1px solid var(--black-border);
}
.custom-foods-list-wrap h3 { display: flex; align-items: center; gap: 0.5rem; }
.badge {
  font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.55rem;
  background: var(--accent-subtle); color: var(--accent);
  border-radius: 100px; border: 1px solid rgba(57,255,20,0.15);
}
.custom-foods-list {
  max-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.custom-food-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.85rem; background: var(--black-raised);
  border: 1px solid var(--black-border); border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.custom-food-item:hover { border-color: #2a2a2a; }
.custom-food-item-info h4 { font-size: 0.85rem; margin-bottom: 0.1rem; }
.custom-food-item-info small { color: var(--text-muted); font-size: 0.72rem; }
.custom-food-item-actions { display: flex; gap: 0.35rem; }
.custom-food-item-actions button {
  background: none; border: none; cursor: pointer;
  font-size: 0.85rem; padding: 0.25rem; transition: color var(--transition);
}
.custom-food-item-actions .btn-use { color: var(--accent); }
.custom-food-item-actions .btn-use:hover { color: #50ff30; }
.custom-food-item-actions .btn-del { color: var(--text-muted); }
.custom-food-item-actions .btn-del:hover { color: var(--danger); }

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 300;
  background: var(--black-card); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); padding: 0.85rem 1.5rem;
  color: var(--accent); font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 0 20px var(--accent-glow);
  animation: toastIn 0.35s ease, toastOut 0.35s ease 2.2s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-inner { padding: 0 1rem; }
  .nav-links { gap: 0; }
  .nav-link { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  .container { padding: 1.5rem 1rem 3rem; }
  .landing { padding: 3rem 1rem 2rem; }
  .landing-stats { gap: 1.5rem; }
  .card-header { flex-direction: column; align-items: flex-start; }
  .card-actions { width: 100%; }
  .card-actions .input-sm { flex: 1; max-width: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .macro-rings { grid-template-columns: 1fr 1fr; }
  .food-search-wrap { flex-direction: column; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .macro-rings { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: 1fr; }
}

.btn-red { color: #ff3333; border-color: #ff3333; }
.btn-red:hover { background: rgba(255, 51, 51, 0.1); color: #ff3333; }


/* ---------- Cloudflare Turnstile ---------- */
.turnstile-wrapper {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

/* ---------- Auth Error ---------- */
.auth-error {
  color: #ff4444;
  font-size: 0.85rem;
  text-align: center;
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: 8px;
}

/* ---------- Trial Banner ---------- */
.trial-banner {
  background: linear-gradient(90deg, rgba(57,255,20,0.10) 0%, rgba(57,255,20,0.03) 100%);
  border-bottom: 1px solid rgba(57,255,20,0.15);
  padding: 0.6rem 1.5rem;
}
.trial-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.trial-banner-inner strong {
  color: var(--accent);
  font-weight: 700;
}
.trial-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(57,255,20,0.10);
  border: 1px solid rgba(57,255,20,0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

/* ---------- Paywall Modal ---------- */
.paywall-card {
  text-align: center;
  padding: 3rem 2.5rem !important;
  max-width: 420px;
  border: 1px solid rgba(57,255,20,0.15) !important;
  background: radial-gradient(ellipse at top, rgba(57,255,20,0.04) 0%, var(--black-card) 70%) !important;
}
.paywall-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 20px rgba(57,255,20,0.3));
}
.paywall-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.paywall-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}
.paywall-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.paywall-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(57,255,20,0.3);
}
.paywall-period {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.paywall-cta {
  font-size: 1.1rem;
  padding: 1rem;
  box-shadow: 0 0 30px rgba(57,255,20,0.15);
}
.paywall-note {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 1rem;
  letter-spacing: 0.5px;
}

/* ============================================================
   AESTHETIC OVERHAUL & MOBILE FIRST RESPONSIVE
   ============================================================ */

/* ---------- Core Aesthetics ---------- */
body {
  /* Dynamic gradient background instead of flat black */
  background: radial-gradient(circle at top left, var(--black-card), var(--black-matte) 60%);
  background-attachment: fixed;
}

/* Glassmorphism for Top Nav */
.nav {
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card {
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Soft Neon Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #20d409 100%);
  border: none;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 25px var(--accent-glow);
  transform: translateY(-2px);
}

/* ---------- Touch Targets (Apple/Google Guidelines) ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], select, .btn {
  min-height: 48px; 
  padding: 0.75rem 1.25rem;
}

/* Nav Icons Styling */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========== MOBILE NAVIGATION (BOTTOM BAR) ========== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 65px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(24px) saturate(1.8);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: none; /* hidden on desktop */
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  gap: 4px;
  transition: color var(--transition);
}

.bottom-nav-link.active {
  color: var(--accent);
}

.bottom-nav-link svg {
  width: 22px; height: 22px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-link:active svg {
  transform: scale(0.9);
}

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 768px) {
  body {
    padding-bottom: 85px; /* space for bottom nav */
  }

  /* Show Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Hide Top Nav Links */
  .nav-links {
    display: none !important;
  }
  
  .nav-actions .btn-red {
    display: none;
  }

  /* Modals as Slide-up Bottom Sheets */
  .modal-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
  }
  
  @keyframes slideUp {
    to { transform: translateY(0); }
  }

  /* Fix grid stacking */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row-2, .form-row-3, .form-row-4 {
    grid-template-columns: 1fr !important;
    gap: 0;
  }
  
  /* Better Landing page for mobile */
  .landing-headline {
    font-size: 3rem;
  }
  .landing-stats {
    gap: 1.5rem;
  }
  .landing-actions {
    flex-direction: column;
    width: 100%;
  }
  .landing-actions .btn {
    width: 100%;
  }
}

/* Shiny Golden Premium Button */
.btn-premium {
  background: linear-gradient(45deg, #FFDF00, #D4AF37, #FFDF00, #B8860B);
  background-size: 300% 300%;
  color: #111 !important;
  font-weight: 800;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  text-shadow: 0 1px 1px rgba(255,255,255,0.4);
  transition: all 0.3s ease;
  animation: shinyGold 3s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-premium:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

@keyframes shinyGold {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#btn-upgrade-premium {
  margin-left: auto;
}

@media (max-width: 768px) {
  #btn-upgrade-premium {
    margin-left: 0;
    width: 100%;
  }
}
