/* =========================================================================
   Cobalt Coach — core.css
   Variables, reset et composants partagés. Identité verte « énergie »,
   distincte du bleu du site Cobalt.
   ========================================================================= */

:root {
  --bg-primary: #080b08;          /* noir légèrement verdâtre */
  --bg-secondary: #0f140f;        /* fond cartes */
  --bg-tertiary: #161e16;         /* fond hover */
  --bg-card: #111711;             /* cartes */
  --accent: #22c55e;              /* vert énergie principal */
  --accent-dark: #16a34a;         /* vert hover */
  --accent-glow: rgba(34, 197, 94, 0.12);
  --accent-2: #4ade80;            /* vert clair highlights */
  --text-primary: #f0fdf0;        /* blanc verdâtre */
  --text-secondary: #86a086;      /* gris verdâtre */
  --text-muted: #4a5c4a;
  --border: rgba(34, 197, 94, 0.08);
  --border-strong: rgba(34, 197, 94, 0.18);
  --danger: #ef4444;
  --warning: #f59e0b;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --ease: 0.2s ease;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-width: 900px;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: var(--accent-glow); }

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ---------- Typographie ---------- */
h1, h2, h3 { font-weight: 300; letter-spacing: -0.5px; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-muted); }
.accent { color: var(--accent); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), border var(--ease);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #062b12; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-tertiary); }

.btn-danger { background: transparent; border-color: rgba(239,68,68,0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.12); }

.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Cartes ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform var(--ease), border var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: var(--border-strong); }

/* ---------- Formulaires ---------- */
label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; }

input[type="text"], input[type="number"], input[type="email"], input[type="time"],
select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: border var(--ease), box-shadow var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 90px; }

input[type="range"] { accent-color: var(--accent); width: 100%; }

/* Pastilles de sélection (jours, matériel, objectifs) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all var(--ease);
  font-size: 0.9rem;
}
.chip:hover { border-color: var(--accent); color: var(--text-primary); }
.chip.selected {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-2);
}

/* Badges muscles / catégories */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent-2);
  border: 1px solid var(--border-strong);
}

/* ---------- Barre de navigation latérale ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 86px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .logo {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 22px;
  text-align: center;
}
.nav-item {
  width: 52px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease);
  font-size: 0.6rem;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }

.main { flex: 1; min-width: 0; }
.page { max-width: 1080px; margin: 0 auto; padding: 38px 40px 80px; }

.page-header { margin-bottom: 30px; }
.page-header h1 { font-size: 2rem; }
.page-header p { color: var(--text-secondary); margin-top: 4px; }

/* ---------- Grilles utilitaires ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 14px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.wrap { flex-wrap: wrap; }

.flex-1 { flex: 1; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }
.mb { margin-bottom: 16px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Toasts / notifications ---------- */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
  max-width: 340px;
}
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Spinner ---------- */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Lueur titre ---------- */
.glow-text { position: relative; }
.glow-text::after {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  z-index: -1;
  filter: blur(20px);
}

/* ---------- Animations d'apparition ---------- */
.fade-in { animation: fadeIn 0.6s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state .big { font-size: 2.4rem; margin-bottom: 10px; }

/* --------------------------------------------- Rappels IA (santé) ---------- */
/* Rappel permanent en pied de chaque page de l'app. */
.ai-disclaimer {
  margin: 2.5rem 1.25rem 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #223027);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
/* Rappel spécifique sous le bloc de besoins nutritionnels chiffrés. */
.nutri-reco-note {
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
