@import url('https://fonts.googleapis.com/css2?family=Geist:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #08090D;
  --ink: #08090D;
  --surface: rgba(51,65,85,0.5);
  --surface-solid: #131A26;
  --surface-2: rgba(255,255,255,0.025);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(148,163,184,0.35);
  --border-light: rgba(255,255,255,0.05);
  --text: #F5F4F0;
  --text-muted: #8B8D98;
  --text-dim: #65617c;
  --accent: #004aad;
  --accent-hover: #003c8f;
  --accent-blue: #004aad;
  --accent-glow: rgba(0,74,173,0.45);
  --grad: linear-gradient(115deg, #1E5FBF, #4A8DFF);
  --grad-text: linear-gradient(120deg, #4A8DFF 0%, #9CC4FF 100%);
  --accent-green: #10B981;
  --accent-green-hover: #059669;
  --accent-red: #ef4444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }
h1, h2, h3, h4, h5, .section-title, .modal-title { font-family: var(--font-title); }
html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* BACKGROUND: grid + glow (Remakeit signature) */
body::before { display: none;
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 110% 70% at 50% -5%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 110% 70% at 50% -5%, #000 25%, transparent 78%);
}
body::after { display: none;
  content: "";
  position: fixed; top: -260px; left: 50%; transform: translateX(-50%);
  width: 1000px; height: 640px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, rgba(0,74,173,0.12) 38%, transparent 70%);
  filter: blur(8px);
}

/* CONTAINER */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* NAVBAR — floating pill */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 1rem 1rem 0; background: transparent; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 1.5rem; max-width: 1120px; margin: 0 auto; padding: 0 0.7rem 0 1.6rem; background: rgba(30,41,59,0.72); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); border: 1px solid rgba(148,163,184,0.35); border-radius: 999px; box-shadow: 0 8px 40px rgba(0,0,0,0.4); }
.nav-logo { font-size: 1.2rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.nav-logo span { background: var(--grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 0.6rem; align-items: center; }

/* BUTTONS — pill shaped */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.3rem; border-radius: 11px; font-family: var(--font); font-size: 0.875rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: box-shadow 0.2s ease, transform 0.15s ease, background 0.2s ease; white-space: nowrap; letter-spacing: -0.01em; }
/* Boutons bleus : dégradé animé (même design que « Se connecter ») */
.btn-primary, .btn-green, .btn-hero { background: linear-gradient(115deg, #1E5FBF, #4A8DFF, #9CC4FF, #4A8DFF, #1E5FBF); background-size: 300% 100%; animation: btnGradient 6s ease-in-out infinite, btnGlow 3.2s ease-in-out infinite; border: 1px solid rgba(255,255,255,0.18); color: #fff; }
.btn-primary:hover, .btn-green:hover, .btn-hero:hover { transform: translateY(-1px); }
@keyframes btnGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes btnGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(74,141,255,0.45), 0 12px 28px -10px rgba(0,20,50,0.6); } 50% { box-shadow: 0 0 22px 4px rgba(156,196,255,0.5), 0 12px 28px -10px rgba(0,20,50,0.6); } }
@media (prefers-reduced-motion: reduce) { .btn-primary, .btn-green, .btn-hero { animation: none; } }
.btn-ghost { background: rgba(100,116,139,0.12); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(100,116,139,0.2); border-color: rgba(148,163,184,0.5); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: #4A8DFF; color: #fff; background: rgba(74,141,255,0.1); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-lg { padding: 0.9rem 1.9rem; font-size: 1rem; border-radius: 11px; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; border-radius: 11px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* SECTION LABELS / PILL BADGES */
.section-label { display: inline-block; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: #9CC4FF; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; padding: 0.35rem 0.95rem; border-radius: 999px; margin-bottom: 1.25rem; }
.section-title { font-size: clamp(1.85rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 1rem; }
.section-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto; }
.gradient-text { background: var(--grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* FORMS */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; }
.form-input { width: 100%; background: rgba(100,116,139,0.12); border: 1px solid rgba(148,163,184,0.35); border-radius: 11px; padding: 0.8rem 1rem; color: var(--text); font-family: var(--font); font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.form-input:focus { outline: none; border-color: #4A8DFF; background: rgba(74,141,255,0.1); box-shadow: 0 0 0 3px rgba(74,141,255,0.18); }
.form-input::placeholder { color: var(--text-dim); }
/* iOS Safari : les <input type="time"> gardent une largeur intrinsèque et débordent
   des grilles si on ne neutralise pas l'apparence native. */
input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; box-sizing: border-box; }
input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.form-textarea { resize: vertical; min-height: 100px; }

/* CARDS */
.card { background: rgba(51,65,85,0.5); border: 1px solid rgba(148,163,184,0.35); border-radius: 20px; padding: 1.75rem; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65), inset 0 1px 0 rgba(148,163,184,0.15); }
.card-sm { padding: 1.25rem; }

/* AUTH LAYOUT */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.auth-box { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo a { font-size: 1.75rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.auth-logo a span { background: var(--grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-card { background: rgba(51,65,85,0.5); border: 1px solid rgba(148,163,184,0.35); border-radius: 20px; padding: 2.5rem; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65), inset 0 1px 0 rgba(148,163,184,0.15); }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.auth-card p.auth-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: #fff; text-decoration: none; font-weight: 700; }

/* ALERTS */
.alert { padding: 0.875rem 1rem; border-radius: 0.75rem; font-size: 0.875rem; margin-bottom: 1rem; }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25); color: #34d399; }

/* SPINNER */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SIDEBAR LAYOUT */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex-shrink: 0; background: rgba(13,17,23,0.8); backdrop-filter: blur(18px); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 1.5rem; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 50; }
.sidebar-logo { font-size: 1.35rem; font-weight: 800; margin-bottom: 2.5rem; padding: 0.5rem 0; letter-spacing: -0.02em; }
.sidebar-logo span { background: var(--grad-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.375rem; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 999px; text-decoration: none; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: all 0.2s; cursor: pointer; border: none; background: none; width: 100%; font-family: var(--font); }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: rgba(74,141,255,0.15); color: #9CC4FF; font-weight: 600; }
.nav-item-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.main-content { margin-left: 260px; flex: 1; min-width: 0; padding: 2rem; min-height: 100vh; max-width: calc(100vw - 260px); position: relative; background: var(--ink); }
/* Fond interne : même image que les pages login/questionnaire, en version très légère (voile sombre appuyé) */
.main-content::before {
  content: "";
  position: fixed; top: 0; left: 260px; right: 0; bottom: 0;
  z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(8,9,13,0.90) 0%, rgba(8,9,13,0.93) 55%, rgba(8,9,13,0.97) 100%),
    url('/img/login-bg.jpg');
  background-repeat: no-repeat, no-repeat;
  background-position: center top, center top;
  background-size: cover, cover;
}
@media (min-width: 901px) {
  .main-content::before {
    background-image:
      linear-gradient(180deg, rgba(8,9,13,0.90) 0%, rgba(8,9,13,0.93) 55%, rgba(8,9,13,0.97) 100%),
      url('/img/login-bg-desktop.jpg');
    background-position: center, center;
  }
}
.main-content > * { position: relative; z-index: 1; }
/* Écrans internes : fond uni sombre + cards en verre (charte Novyia) */
.main-content .card, .main-content .routine-card, .main-content .widget,
.main-content .stat-card, .main-content .panel, .main-content .table-wrap,
.main-content .progress-hero, .main-content .coach-card, .main-content .comeback-banner,
.main-content .insights-hero, .main-content .settings-card {
  background: rgba(51,65,85,0.5) !important;
  border: 1px solid rgba(148,163,184,0.35) !important;
  border-radius: 20px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65), inset 0 1px 0 rgba(148,163,184,0.15);
}

/* MOBILE NAV TOGGLE */
.mobile-nav-toggle { display: none; position: fixed; top: 1rem; left: 1rem; z-index: 200; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 999px; padding: 0.6rem; cursor: pointer; color: var(--text); font-size: 1.25rem; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-inner { padding: 0 0.6rem 0 1.2rem; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; max-width: 100vw; padding: 1rem; padding-top: 4rem; }
  .main-content::before { left: 0; }
  .mobile-nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-actions { gap: 0.4rem; }
  .nav-actions .btn { padding: 0.5rem 0.85rem; font-size: 0.8rem; }
  .auth-card { padding: 1.75rem 1.4rem; }
}

/* CHECKBOX */
.checkbox-label { display: flex; align-items: center; gap: 0.625rem; cursor: pointer; font-size: 0.9rem; user-select: none; }
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; }
.checkbox-label input:checked + .checkbox-custom { background: #4A8DFF; border-color: #4A8DFF; }
.checkbox-label input:checked + .checkbox-custom::after { content: "✓"; color: #fff; font-size: 0.75rem; font-weight: 700; }

/* RADIO */
.radio-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.radio-option { position: relative; }
.radio-option input[type="radio"] { display: none; }
.radio-option label { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 1.125rem; border-radius: 999px; border: 1px solid rgba(148,163,184,0.35); background: rgba(100,116,139,0.12); cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.radio-option input:checked + label { border-color: #4A8DFF; background: linear-gradient(115deg, rgba(30,95,191,0.35), rgba(74,141,255,0.25)); color: #fff; }

/* TOASTS */
.toast-host { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.625rem; max-width: 360px; }
.toast { display: flex; align-items: center; gap: 0.625rem; padding: 0.875rem 1.1rem; border-radius: 11px; background: rgba(30,41,59,0.94); border: 1px solid rgba(148,163,184,0.35); color: var(--text); font-size: 0.875rem; font-weight: 500; box-shadow: 0 12px 40px rgba(0,0,0,0.45); opacity: 0; transform: translateX(20px); transition: opacity 0.28s ease, transform 0.28s ease; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; font-size: 0.75rem; font-weight: 700; color: #fff; }
.toast-success { border-color: rgba(16,185,129,0.4); }
.toast-success .toast-icon { background: var(--accent-green); }
.toast-error { border-color: rgba(239,68,68,0.4); }
.toast-error .toast-icon { background: var(--accent-red); }
.toast-info .toast-icon { background: var(--accent); }
@media(max-width: 480px) { .toast-host { left: 1rem; right: 1rem; max-width: none; } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(7,6,13,0.7); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0.25s ease; }
.modal-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal { width: 100%; max-width: 420px; background: rgba(30,41,59,0.92); border: 1px solid rgba(148,163,184,0.35); border-radius: 20px; padding: 1.75rem; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65), inset 0 1px 0 rgba(148,163,184,0.15); transform: translateY(12px) scale(0.98); transition: transform 0.25s ease; }
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.625rem; }
.modal-message { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; line-height: 1.55; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
.btn-danger { background: var(--accent-red); color: #fff; border: 1px solid var(--accent-red); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* COOKIE CONSENT BANNER */
.cookie-banner { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 9999; max-width: 460px; margin: 0 auto; background: rgba(30,41,59,0.92); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); border: 1px solid rgba(148,163,184,0.35); border-radius: 20px; padding: 1.25rem 1.4rem; box-shadow: 0 24px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.03); transform: translateY(180%); opacity: 0; transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.4s ease; }
.cookie-banner.show { transform: translateY(0); opacity: 1; }
.cookie-banner h4 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.45rem; display: flex; align-items: center; gap: 0.5rem; }
.cookie-banner p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 1.1rem; }
.cookie-banner p a { color: #C7CEDB; text-decoration: underline; }
.cookie-banner p a:hover { color: #fff; }
.cookie-actions { display: flex; gap: 0.6rem; }
.cookie-actions .btn { flex: 1; text-align: center; justify-content: center; padding: 0.6rem 1rem; font-size: 0.85rem; }
@media (max-width: 520px) { .cookie-actions { flex-direction: column-reverse; } }

/* LEGAL PAGES */
.legal-page { max-width: 800px; margin: 6.5rem auto 4rem; padding: 2.5rem 2rem; background: rgba(51,65,85,0.5); border: 1px solid rgba(148,163,184,0.35); border-radius: 20px; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65), inset 0 1px 0 rgba(148,163,184,0.15); }
@media (max-width: 720px) { .legal-page { margin: 5.5rem 1rem 3rem; padding: 1.75rem 1.25rem; } }
.legal-page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 0.4rem; }
.legal-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2.5rem; }
.legal-page h2 { font-size: 1.2rem; font-weight: 700; margin: 2.5rem 0 0.75rem; }
.legal-page h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.legal-page p, .legal-page li { color: var(--text-muted); font-size: 0.95rem; line-height: 1.75; }
.legal-page ul { padding-left: 1.25rem; margin: 0.5rem 0 1rem; }
.legal-page li { margin-bottom: 0.4rem; }
.legal-page a { color: #C7CEDB; text-decoration: underline; }
.legal-page a:hover { color: #fff; }
.legal-back { display: inline-block; margin-top: 2.5rem; }
.legal-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.88rem; }
.legal-table th, .legal-table td { text-align: left; padding: 0.6rem 0.75rem; border: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
.legal-table th { color: var(--text); font-weight: 600; background: var(--surface); }

/* FOOTER LINKS */
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; margin-top: 1rem; }
.footer-links a { color: #C7CEDB; font-size: 0.82rem; text-decoration: underline; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* PREMIUM LOCKS & UPSELL */
.coach-locked { display: flex; align-items: flex-start; gap: 1rem; }
.coach-locked-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.premium-lock { text-align: center; max-width: 540px; margin: 2rem auto; background: linear-gradient(135deg, rgba(30,95,191,0.2), rgba(74,141,255,0.08)); border: 1px solid rgba(74,141,255,0.35); border-radius: 20px; padding: 2.5rem 2rem; }
.premium-lock-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.premium-lock h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.premium-lock p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1.25rem; }
.premium-lock-list { list-style: none; padding: 0; margin: 0 auto 1.5rem; max-width: 360px; text-align: left; display: flex; flex-direction: column; gap: 0.5rem; }
.premium-lock-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.premium-lock-list li::before { content: "✓"; color: #9CC4FF; font-weight: 700; }

/* Novyia image logo */
.brand-logo-img { height: 26px; width: auto; display: block; }
.sidebar-logo .brand-logo-img { height: 30px; }
.auth-logo .brand-logo-img { margin: 0 auto; height: 32px; }
footer .footer-logo .brand-logo-img, .footer-logo .brand-logo-img { height: 26px; margin-bottom: 0.75rem; }
