﻿/* /css/accueil.css — Dashboard (Accueil connecte)
   Design: Serif | Tokens: theme.css | Mobile-first 360px
   Redesign 2026-08-22
   ──────────────────────────────────────────────────────────────────────
   Roles non-negociables respectes :
   - Zero box-shadow, zero degradé (DESIGN.md)
   - Graisse <= 500 (DESIGN.md)
   - Une seule etincelle doree remplie par ecran (.acc-continue-cta)
   - Proprietes logiques CSS (jamais left/right)
   - prefers-reduced-motion sur toute animation
   - Tokens var(--token, fallback) -- jamais hex brut
   - Cairo pour tout noeud RTL
   Gold fill: .acc-continue-cta (one gold fill per screen) */

.acc-page *, .acc-page *::before, .acc-page *::after { box-sizing: border-box; margin: 0; padding: 0; }
.acc-page { background: var(--ardoise); color: var(--craie); font-family: var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100dvh; }

.acc-shell { padding-top: 72px; min-height: 100dvh; }
.acc-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5, 20px); max-width: 700px; margin: 0 auto; padding: 0 var(--space-4, 16px) calc(var(--space-9, 48px) + 20px); }
.acc-main { display: flex; flex-direction: column; gap: 0; }

.acc-surface { background: var(--ardoise-2); border: 1px solid rgba(232,245,232,.08); border-radius: var(--radius-md, 14px); padding: var(--space-5, 20px); }

.acc-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4, 16px); }
.acc-section-title { font-family: var(--font-head); font-size: var(--text-base, 14px); font-weight: 500; color: var(--craie); letter-spacing: -0.01em; }
.acc-section-link { font-size: var(--text-xs, 11px); color: var(--craie-doree); text-decoration: none; font-weight: 500; transition: color 0.18s ease; }
.acc-section-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════
   1. HERO ARDOISE — texture + overlay, greeting + chip filiere + avatar
   Max 30% du premier viewport (30dvh).
   ══════════════════════════════════════════════════════════════════════ */
.acc-hero {
  position: relative;
  background: var(--ardoise) url('/assets/hero/hero-fond.webp') center / cover no-repeat;
  isolation: isolate;
  padding: var(--space-9, 48px) var(--space-4, 16px) var(--space-6, 24px);
  min-height: 0;
  max-height: 30dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.acc-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(9, 26, 9, 0.55);
  pointer-events: none;
  z-index: 0;
}
.acc-hero > * { position: relative; z-index: 1; }
@media (max-width: 767px) {
  .acc-hero { background-image: url('/assets/hero/hero-fond-m.webp'); }
}

/* ── Greeting ──────────────────────────────────────────────────────── */
.acc-greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4, 16px); }
.acc-greeting-text { flex: 1; min-width: 0; }
.acc-greeting h2 { font-family: var(--font-head); font-size: var(--text-4xl, 34px); font-weight: 400; letter-spacing: -0.02em; color: var(--craie); line-height: 1.0; }
.acc-greeting .acc-name { color: var(--craie-doree); }

/* Chips inside hero */
.acc-chip-row { display: flex; align-items: center; gap: var(--space-2, 8px); margin-top: var(--space-2, 8px); flex-wrap: wrap; }
.acc-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(232,245,232,.06); border: 1px solid rgba(232,245,232,.10); border-radius: var(--radius-pill, 999px); padding: 5px 12px; font-size: var(--text-xs, 11px); font-weight: 400; color: rgba(232,245,232,.6); white-space: nowrap; }
.acc-chip svg { color: var(--craie-doree); flex-shrink: 0; }
.acc-chip .acc-chip-val { font-weight: 500; color: var(--craie); }

/* Avatar in hero */
.acc-avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ardoise-3); border: 1.5px solid rgba(232,245,232,.12); font-family: var(--font-head); font-size: 14px; font-weight: 500; color: var(--craie); text-decoration: none; flex-shrink: 0; transition: border-color 0.18s ease; }
.acc-avatar:hover { border-color: rgba(217,168,87,.35); }

/* ══════════════════════════════════════════════════════════════════════
   1b. STREAK RESUME — 1 ligne sous le hero
   Pastille doree + "Streak 12j +45 XP aujourd'hui"
   ══════════════════════════════════════════════════════════════════════ */
.acc-streak-line {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  font-size: var(--text-sm, 12.5px);
  color: rgba(232,245,232,.6);
}
.acc-streak-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--craie-doree);
  flex-shrink: 0;
  animation: accStreakPulse 2s ease-in-out infinite;
}
.acc-streak-dot[data-active="false"] { background: rgba(232,245,232,.15); animation: none; }
.acc-streak-text { font-weight: 500; color: var(--craie); }
.acc-streak-xp { color: var(--craie-doree); font-weight: 500; }
@keyframes accStreakPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .acc-streak-dot { animation: none; } }

/* ══════════════════════════════════════════════════════════════════════
   2. PORTAL CARDS — grille 2x2
   Chaque card: icone + titre + donnee live.
   Geste: tap simple -> navigation.
   Feedback: filet dore 0.18s au tap (bande direct-feedback).
   Tap target >= 44px.
   ══════════════════════════════════════════════════════════════════════ */
.acc-portals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3, 12px);
  padding: var(--space-5, 20px) var(--space-4, 16px);
}
.acc-portal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3, 12px);
  padding: var(--space-5, 20px) var(--space-4, 16px);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-md, 14px);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
/* Tap feedback: filet dore qui s'etend */
.acc-portal::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid var(--craie-doree);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.acc-portal:active::after { opacity: 1; transform: scale(1); }
.acc-portal:focus-visible { outline: 2px solid var(--craie-doree); outline-offset: 2px; }

/* Active state (contextual: quiz du jour disponible) */
.acc-portal--active { border-color: rgba(217,168,87,.25); background: rgba(217,168,87,.12); }

/* Icon */
.acc-portal-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(232,245,232,.04);
  border: 1px solid rgba(232,245,232,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(232,245,232,.6);
  flex-shrink: 0;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.acc-portal:active .acc-portal-icon { color: var(--craie-doree); border-color: rgba(217,168,87,.25); background: rgba(217,168,87,.12); }
.acc-portal--active .acc-portal-icon { color: var(--craie-doree); background: rgba(217,168,87,.12); border-color: rgba(217,168,87,.25); }

/* Title + data */
.acc-portal-title { font-family: var(--font-head); font-size: var(--text-base, 14px); font-weight: 500; color: var(--craie); letter-spacing: -0.01em; }
.acc-portal-data { font-size: var(--text-xs, 11px); color: rgba(232,245,232,.6); line-height: 1.3; }
.acc-portal-data--highlight { color: var(--craie-doree); font-weight: 500; }

/* Notification badge */
.acc-portal-badge { position: absolute; top: var(--space-3, 12px); inset-inline-end: var(--space-3, 12px); width: 8px; height: 8px; border-radius: 50%; background: var(--craie-doree); }

/* RTL */
[dir="rtl"] .acc-portal-title { font-family: var(--font-arabic); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .acc-portal::after { transition: opacity 0.18s ease; transform: none; }
  .acc-portal:active::after { transform: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   3. BAC COUNTDOWN
   ══════════════════════════════════════════════════════════════════════ */
.acc-countdown { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3, 12px); flex-wrap: wrap; }
.acc-cd-left { display: flex; align-items: center; gap: var(--space-3, 12px); }
.acc-cd-number { font-family: var(--font-head); font-size: var(--text-2xl, 22px); font-weight: 500; color: var(--craie-doree); line-height: 1; background: rgba(217,168,87,.08); border: 1px solid rgba(217,168,87,.25); padding: 8px 12px; border-radius: var(--radius-sm, 8px); }
.acc-cd-info { display: flex; flex-direction: column; gap: 2px; }
.acc-cd-title { font-family: var(--font-head); font-size: var(--text-sm, 12.5px); font-weight: 500; color: var(--craie); }
.acc-cd-sub { font-size: var(--text-xs, 11px); color: rgba(232,245,232,.35); }
.acc-cd-tag { font-size: var(--text-xs, 11px); color: var(--craie-doree); background: rgba(217,168,87,.08); border: 1px solid rgba(217,168,87,.25); padding: 4px 10px; border-radius: var(--radius-pill, 999px); font-weight: 500; }
[dir="rtl"] .acc-cd-title { font-family: var(--font-arabic); }

/* ══════════════════════════════════════════════════════════════════════
   4. CONTINUE CARD — the hero element
   SEULE etincelle doree remplie de l'ecran (DESIGN.md role 1).
   ══════════════════════════════════════════════════════════════════════ */
.acc-continue { border-inline-start: 4px solid var(--craie-doree); display: flex; align-items: center; gap: var(--space-4, 16px); }
.acc-continue-icon { flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius-sm, 8px); background: rgba(217,168,87,.08); border: 1px solid rgba(217,168,87,.25); display: flex; align-items: center; justify-content: center; color: var(--craie-doree); }
.acc-continue-body { flex: 1; min-width: 0; }
.acc-continue-kicker { font-size: var(--text-xs, 11px); color: var(--craie-doree); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.acc-continue-path { font-family: var(--font-head); font-size: var(--text-lg, 16px); font-weight: 500; color: var(--craie); margin-top: 3px; }
.acc-continue-node { font-size: var(--text-sm, 12.5px); color: rgba(232,245,232,.6); margin-top: 3px; }
.acc-continue-meta { margin-top: 9px; }
.acc-continue-pos { font-size: var(--text-xs, 11px); color: rgba(232,245,232,.35); display: block; margin-bottom: 6px; }
.acc-continue-track { height: 4px; background: rgba(232,245,232,.08); border-radius: 2px; overflow: hidden; }
.acc-continue-fill { height: 100%; background: var(--craie-doree); border-radius: 2px; transition: width 1s cubic-bezier(.4,0,.2,1); }
.acc-continue-cta { position: relative; z-index: 1; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; background: var(--craie-doree); color: var(--ardoise); font-family: var(--font-body); font-size: var(--text-sm, 12.5px); font-weight: 500; border: none; border-radius: var(--radius-sm, 8px); padding: 11px 16px; text-decoration: none; transition: filter 0.18s ease; min-height: 44px; cursor: pointer; }
.acc-continue-cta:hover { filter: brightness(1.08); }
.acc-continue-cta:focus-visible { outline: 2px solid var(--craie-doree); outline-offset: 2px; }
.acc-continue-cta .acc-arr { transition: transform 0.18s ease; }
.acc-continue-cta:hover .acc-arr { transform: translateX(3px); }
[dir="rtl"] .acc-continue-cta:hover .acc-arr { transform: translateX(-3px) scaleX(-1); }
[dir="rtl"] .acc-continue-path, [dir="rtl"] .acc-continue-kicker { font-family: var(--font-arabic); }

/* ══════════════════════════════════════════════════════════════════════
   5. MON PARCOURS — pastilles
   ══════════════════════════════════════════════════════════════════════ */
.acc-path-preview { display: flex; flex-direction: column; gap: var(--space-3, 12px); }
.acc-pastilles { display: flex; gap: 8px; align-items: center; position: relative; padding: 0 4px; }
.acc-pastilles::before { content: ''; position: absolute; inset-inline: 14px; top: 50%; height: 2px; background: var(--card-border); }
.acc-pastille { width: 44px; height: 44px; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; background: var(--ardoise-2); border: 1.5px solid rgba(232,245,232,.12); font-size: var(--text-sm, 12.5px); font-weight: 400; color: rgba(232,245,232,.35); z-index: 1; cursor: pointer; transition: border-color .18s ease, color .18s ease; }
.acc-pastille.done { background: var(--craie-doree); border-color: var(--craie-doree); color: var(--ardoise); font-weight: 500; }
.acc-pastille.current { border-color: var(--craie); border-width: 2.5px; color: var(--craie); font-weight: 500; }
.acc-pastille.current::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--craie); opacity: 0; pointer-events: none; animation: accPulse 2.2s ease-out infinite; }
.acc-pastille.current.current-active::after { opacity: .5; }
@keyframes accPulse { 0%{opacity:.5;transform:scale(1)} 100%{opacity:0;transform:scale(1.3)} }
@media (prefers-reduced-motion:reduce){ .acc-pastille.current::after{animation:none;opacity:.25;transform:scale(1.1);} .acc-pastille{transition:none;} }
.acc-path-btn { width: 100%; min-height: 44px; }

/* ══════════════════════════════════════════════════════════════════════
   6. MA PROGRESSION — stats grid + level bar
   ══════════════════════════════════════════════════════════════════════ */
.acc-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: var(--space-4, 16px); }
.acc-stat { background: var(--ardoise-2); border: 1px solid rgba(232,245,232,.08); border-radius: var(--radius-sm, 8px); padding: 14px 12px; text-align: center; }
.acc-stat-val { font-family: var(--font-head); font-size: var(--text-2xl, 22px); font-weight: 500; line-height: 1; }
.acc-stat-val--streak { color: var(--orange-alerte); }
.acc-stat-val--xp { color: var(--craie-doree); }
.acc-stat-val--lessons { color: var(--bleu-info); }
.acc-stat-label { font-size: 10px; color: rgba(232,245,232,.35); margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }
.acc-level-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.acc-level-name { font-family: var(--font-head); font-size: var(--text-xl, 19px); font-weight: 500; color: var(--craie-doree); line-height: 1; }
.acc-level-label { font-size: var(--text-sm, 12.5px); color: rgba(232,245,232,.6); font-weight: 400; }
.acc-level-remaining { font-size: var(--text-xs, 11px); color: var(--craie-doree); font-weight: 500; margin-inline-start: auto; }
.acc-level-bar { height: 6px; background: rgba(232,245,232,.08); border-radius: 3px; overflow: hidden; }
.acc-level-fill { height: 100%; width: 0%; background: var(--craie-doree); border-radius: 3px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.acc-level-bar-label { display: flex; justify-content: space-between; font-size: var(--text-xs, 11px); color: rgba(232,245,232,.35); margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════════════
   7. MA FILIERE — progress bars per subject
   ══════════════════════════════════════════════════════════════════════ */
.acc-subjects { display: flex; flex-direction: column; }
.acc-subject { display: flex; align-items: center; gap: var(--space-3, 12px); padding: 12px 0; border-bottom: 1px solid rgba(232,245,232,.06); }
.acc-subject:last-child { border-bottom: none; }
.acc-subject-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.acc-subject-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.acc-subject-name { font-size: var(--text-sm, 12.5px); font-weight: 400; color: var(--craie); }
.acc-subject-bar { height: 3px; background: rgba(232,245,232,.06); border-radius: 2px; overflow: hidden; }
.acc-subject-bar-fill { height: 100%; background: var(--craie-doree); border-radius: 2px; transition: width 0.8s cubic-bezier(.4,0,.2,1); }
.acc-subject-count { font-size: var(--text-xs, 11px); color: rgba(232,245,232,.35); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* Toast */
.acc-toast { position: fixed; inset-inline-start: 50%; bottom: calc(62px + env(safe-area-inset-bottom) + 84px); transform: translateX(-50%) translateY(12px); background: var(--craie); color: var(--ardoise); font: 500 14px var(--font-body); padding: 10px 16px; border-radius: var(--radius-sm, 8px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 40; white-space: nowrap; max-width: 90vw; }
.acc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Skeleton */
.acc-skeleton { background: rgba(232,245,232,.06); border-radius: 4px; animation: accSkeletonPulse 1.5s ease-in-out infinite; }
@keyframes accSkeletonPulse { 0%,100%{opacity:.4} 50%{opacity:.15} }
@media (prefers-reduced-motion:reduce){ .acc-skeleton{animation:none;} }

/* Enter animations */
.acc-enter { opacity: 0; transform: translateY(12px); animation: accEnter .4s ease forwards; animation-delay: var(--acc-enter-delay, 0ms); }
@keyframes accEnter { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion:reduce){ .acc-enter{animation:none;opacity:1;transform:none;} }

/* RTL */
[dir="rtl"] .acc-greeting h2, [dir="rtl"] .acc-section-title { font-family: var(--font-arabic); }
[dir="rtl"] .acc-greeting-meta { flex-direction: row-reverse; }

/* Responsive */
@media (max-width: 768px) {
  .acc-grid { padding: var(--space-4, 16px) var(--space-4, 16px) calc(var(--space-9, 48px) + 20px); gap: var(--space-4, 16px); }
  .acc-greeting { flex-direction: column; align-items: flex-start; }
  .acc-continue { flex-direction: column; align-items: stretch; gap: 16px; }
  .acc-continue-cta { justify-content: center; }
}
@media (min-width: 1024px) {
  .acc-grid { max-width: 1080px; padding: var(--space-7, 32px) var(--space-8, 40px) var(--space-9, 48px); grid-template-columns: 1fr 360px; align-items: start; }
  .acc-portals { max-width: 1080px; margin: 0 auto; grid-template-columns: repeat(4, 1fr); padding: var(--space-6, 24px) var(--space-8, 40px); }
  .acc-streak-line { max-width: 1080px; margin: 0 auto; padding-inline: var(--space-8, 40px); }
  .acc-hero { padding-inline: var(--space-8, 40px); }
}

/* Brand */
.acc-brand { display: inline-flex; align-items: center; font-family: var(--font-head); font-weight: 500; font-size: 22px; color: var(--craie); letter-spacing: -.03em; text-decoration: none; }
.acc-brand .bm-comma { color: var(--craie-doree); font-size: 26px; margin-inline-start: 1px; }

