/* ============================================================
   LEARNIFY — Feuille de style globale
   Couleurs principales : Indigo #4F46E5 · Ambre #F59E0B
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: #F8F7FF;
  color: #1E1B4B;
  line-height: 1.65;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F0EEFF; }
::-webkit-scrollbar-thumb { background: #C4BFFC; border-radius: 3px; }

/* ── CSS VARIABLES ── */
:root {
  --indigo: #4F46E5;
  --indigo-dark: #3730A3;
  --indigo-light: #818CF8;
  --indigo-pale: #EEF2FF;
  --amber: #F59E0B;
  --amber-dark: #D97706;
  --amber-pale: #FFFBEB;
  --emerald: #10B981;
  --rose: #F43F5E;
  --sky: #0EA5E9;
  --bg: #F8F7FF;
  --bg2: #FFFFFF;
  --border: #E0DEFF;
  --text: #1E1B4B;
  --text2: #4C4980;
  --text3: #9CA3AF;
  --shadow-sm: 0 1px 3px rgba(79,70,229,.07), 0 2px 8px rgba(79,70,229,.05);
  --shadow: 0 4px 16px rgba(79,70,229,.10), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(79,70,229,.15), 0 4px 16px rgba(0,0,0,.06);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 { font-family: 'Syne', sans-serif; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { color: var(--text2); }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ── LAYOUT ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section-sm { padding: 56px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.text-center { text-align: center; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 50px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 2px solid transparent; transition: var(--transition);
  position: relative; overflow: hidden; white-space: nowrap;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background .2s;
  border-radius: inherit;
}
.btn:hover::after { background: rgba(255,255,255,.12); }
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--indigo); color: #fff; border-color: var(--indigo); box-shadow: 0 4px 20px rgba(79,70,229,.35); }
.btn-primary:hover { background: var(--indigo-dark); border-color: var(--indigo-dark); box-shadow: 0 8px 30px rgba(79,70,229,.45); transform: translateY(-2px); }
.btn-amber { background: var(--amber); color: #1E1B4B; border-color: var(--amber); box-shadow: 0 4px 20px rgba(245,158,11,.3); font-weight: 700; }
.btn-amber:hover { background: var(--amber-dark); border-color: var(--amber-dark); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(245,158,11,.4); }
.btn-outline { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn-outline:hover { background: var(--indigo-pale); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: 50%; }

/* ── CARDS ── */
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.badge-indigo { background: var(--indigo-pale); color: var(--indigo-dark); }
.badge-amber { background: var(--amber-pale); color: var(--amber-dark); }
.badge-emerald { background: #ECFDF5; color: #065F46; }
.badge-rose { background: #FFF1F2; color: #9F1239; }
.badge-sky { background: #F0F9FF; color: #0C4A6E; }
.badge-gray { background: #F9FAFB; color: #374151; border: 1px solid #E5E7EB; }

/* ── PROGRESS BAR ── */
.progress-wrap { background: #E0DEFF; border-radius: 99px; overflow: hidden; }
.progress-fill {
  border-radius: 99px; transition: width .8s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.progress-fill::after {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 50%; background: white;
  box-shadow: 0 0 0 2px currentColor;
}
.progress-h4 { height: 4px; }
.progress-h8 { height: 8px; }
.progress-indigo { background: var(--indigo); color: var(--indigo); }
.progress-amber { background: var(--amber); color: var(--amber); }
.progress-emerald { background: var(--emerald); color: var(--emerald); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 7px; }
.form-input {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--bg2); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.form-input::placeholder { color: var(--text3); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234C4980' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── NAVBAR ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 68px; background: rgba(248,247,255,.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); transition: var(--transition);
}
.navbar-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo-icon {
  width: 36px; height: 36px; background: var(--indigo); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.nav-logo-text { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--indigo); }
.nav-logo-text span { color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 7px 16px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text2); cursor: pointer; transition: var(--transition); border: none; background: none;
}
.nav-link:hover { color: var(--indigo); background: var(--indigo-pale); }
.nav-link.active { color: var(--indigo); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--indigo), var(--sky));
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: white; cursor: pointer; flex-shrink: 0;
}

/* ── HAMBURGER ── */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE NAV ── */
.mobile-nav {
  display: none; position: fixed; top: 68px; left: 0; right: 0; z-index: 999;
  background: white; border-bottom: 1px solid var(--border); padding: 16px 24px;
  flex-direction: column; gap: 4px; box-shadow: var(--shadow-lg);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  color: var(--text2); cursor: pointer; transition: var(--transition);
}
.mobile-nav-link:hover { background: var(--indigo-pale); color: var(--indigo); }

/* ── FOOTER ── */
.footer { background: var(--text); color: rgba(255,255,255,.7); padding: 60px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-logo-text { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; color: white; margin-bottom: 12px; }
.footer-logo-text span { color: var(--amber); }
.footer-desc { font-size: 14px; line-height: 1.7; max-width: 260px; }
.footer-heading { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: white; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.footer-link { display: block; font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 10px; cursor: pointer; transition: color .2s; }
.footer-link:hover { color: var(--amber); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 28px; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { font-size: 13px; }

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 28px; right: 28px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-radius: var(--radius); background: white; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--indigo); min-width: 280px; pointer-events: auto;
  animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) both;
}
.toast.success { border-color: var(--emerald); }
.toast.warning { border-color: var(--amber); }
.toast.error { border-color: var(--rose); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-msg { font-size: 14px; font-weight: 500; color: var(--text); }
@keyframes toastIn { from { opacity:0; transform: translateX(60px) scale(.9); } to { opacity:1; transform: translateX(0) scale(1); } }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000; background: rgba(30,27,75,.5);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: white; border-radius: var(--radius-lg); padding: 36px; max-width: 500px;
  width: 100%; box-shadow: var(--shadow-lg); transform: scale(.92) translateY(20px);
  transition: transform .3s cubic-bezier(.34,1.2,.64,1);
}
.modal-backdrop.open .modal-box { transform: scale(1) translateY(0); }
.modal-title { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 14px; color: var(--text2); margin-bottom: 24px; }
.modal-close { float: right; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text3); margin-top: -4px; transition: color .2s; }
.modal-close:hover { color: var(--rose); }

/* ── STAT CARD ── */
.stat-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text3); margin-top: 2px; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 8px; }
.stat-up { color: var(--emerald); }
.stat-icon { font-size: 28px; opacity: .25; float: right; margin-top: -4px; }

/* ── SECTION LABEL ── */
.section-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--indigo); margin-bottom: 14px; }
.section-label::before, .section-label::after { content:''; height:1.5px; width:24px; background:var(--indigo); border-radius:2px; }

/* ── QUIZ OPTIONS ── */
.quiz-option {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition); margin-bottom: 10px; background: white;
}
.quiz-option:hover { border-color: var(--indigo-light); background: var(--indigo-pale); }
.quiz-option.selected { border-color: var(--indigo); background: var(--indigo-pale); }
.quiz-option.correct { border-color: var(--emerald); background: #ECFDF5; }
.quiz-option.wrong { border-color: var(--rose); background: #FFF1F2; }
.quiz-letter {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  flex-shrink: 0; transition: var(--transition);
}
.quiz-option.selected .quiz-letter { background: var(--indigo); border-color: var(--indigo); color: white; }
.quiz-option.correct .quiz-letter { background: var(--emerald); border-color: var(--emerald); color: white; }
.quiz-option.wrong .quiz-letter { background: var(--rose); border-color: var(--rose); color: white; }

/* ── VIDEO PLAYER ── */
.video-container {
  background: #0F0E1A; border-radius: var(--radius); overflow: hidden;
  position: relative; aspect-ratio: 16/9; cursor: pointer;
}
.video-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; transition: opacity .3s;
}
.play-btn-big {
  width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.5); display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: white; transition: var(--transition);
}
.play-btn-big:hover { background: rgba(255,255,255,.25); transform: scale(1.1); }
.video-controls-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); padding: 20px 16px 10px;
  display: flex; align-items: center; gap: 10px;
}
.video-seek { flex: 1; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; }
.video-seek-fill { height: 100%; background: var(--amber); border-radius: 2px; transition: width .3s; }
.vbtn { background: none; border: none; color: rgba(255,255,255,.8); font-size: 15px; cursor: pointer; padding: 4px 6px; transition: color .15s; }
.vbtn:hover { color: white; }
.video-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(255,255,255,.7); }

/* ── LESSON SIDEBAR ── */
.lesson-item-side {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
  border-left: 3px solid transparent; margin-bottom: 2px;
}
.lesson-item-side:hover { background: var(--indigo-pale); }
.lesson-item-side.active { background: var(--indigo-pale); border-color: var(--indigo); }
.lesson-num-dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ── TESTIMONIALS ── */
.testimonial-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; position: relative; overflow: hidden;
}
.testimonial-card::before {
  content: '"'; position: absolute; top: 10px; right: 20px; font-size: 80px;
  font-family: 'Syne', sans-serif; color: var(--indigo-pale); line-height: 1;
}
.testimonial-text { font-size: 15px; color: var(--text2); line-height: 1.8; margin-bottom: 20px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.t-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: white; flex-shrink: 0; }
.t-name { font-weight: 700; font-size: 14px; color: var(--text); }
.t-role { font-size: 12px; color: var(--text3); }
.stars { color: var(--amber); font-size: 14px; margin-bottom: 12px; }

/* ── HOW IT WORKS ── */
.step-card { text-align: center; padding: 32px 24px; }
.step-number {
  width: 56px; height: 56px; border-radius: 50%; background: var(--indigo);
  color: white; font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(79,70,229,.3);
}
.step-icon { font-size: 40px; margin-bottom: 16px; display: block; }
.step-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.step-desc { font-size: 14px; color: var(--text2); }

/* ── FEATURE CARD ── */
.feature-card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; transition: var(--transition);
}
.feature-card:hover { border-color: var(--indigo-light); box-shadow: var(--shadow); transform: translateY(-3px); }
.feature-icon { font-size: 36px; margin-bottom: 16px; display: block; }
.feature-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.feature-desc { font-size: 14px; color: var(--text2); line-height: 1.7; }

/* ── HERO PATTERN ── */
.hero-bg {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #1E1B4B 100%);
  position: relative; overflow: hidden;
}
.hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(79,70,229,.4) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(245,158,11,.2) 0%, transparent 50%);
}
.hero-dots {
  position: absolute; inset: 0; opacity: .08;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 32px 32px;
}
.hero-content { position: relative; z-index: 1; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes pulse { 0%,100% { transform:scale(1); } 50% { transform:scale(1.05); } }
@keyframes float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-10px); } }
@keyframes shimmer { from { left:-100%; } to { left:200%; } }
.anim-fade-up { animation: fadeUp .6s ease both; }
.anim-fade-up-2 { animation: fadeUp .6s .12s ease both; }
.anim-fade-up-3 { animation: fadeUp .6s .24s ease both; }
.anim-fade-up-4 { animation: fadeUp .6s .36s ease both; }
.anim-float { animation: float 4s ease-in-out infinite; }
.anim-pulse { animation: pulse 2s ease-in-out infinite; }

/* ── CODE BLOCK ── */
.code-block {
  background: #0F0E1A; color: #E0E7FF; font-family: 'JetBrains Mono', monospace;
  font-size: 13px; padding: 20px 22px; border-radius: var(--radius); line-height: 1.9;
  overflow-x: auto; margin: 16px 0;
}
.ck { color: #93C5FD; } /* keyword */
.cf { color: #6EE7B7; } /* function */
.cs { color: #FCD34D; } /* string */
.cc { color: #6B7280; } /* comment */
.cn { color: #F9A8D4; } /* number */

/* ── SKELETON LOADER ── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 400% 100%; animation: skeleton 1.5s ease infinite; border-radius: 6px; }
@keyframes skeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .nav-links, .nav-actions .btn { display: none; }
  .hamburger { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .section { padding: 56px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .hero-cta { flex-direction: column; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
}
