/* ─── Arcademix LMS — Frontend CSS ──────────────────────────────────────── */
:root{
  --alms-primary:#7c3aed;--alms-primary-dark:#5b21b6;
  --alms-success:#059669;--alms-warning:#d97706;--alms-danger:#dc2626;
  --alms-gray-50:#f9fafb;--alms-gray-100:#f3f4f6;--alms-gray-200:#e5e7eb;
  --alms-gray-500:#6b7280;--alms-gray-700:#374151;--alms-gray-900:#111827;
  --alms-radius:10px;--alms-shadow:0 1px 3px rgba(0,0,0,.1);
}
*{box-sizing:border-box;}

/* ── Catalogue ─────────────────────────────────────────────────────────── */
.alms-catalogue{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:24px;margin:2rem 0;}
.alms-course-card{background:#fff;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);overflow:hidden;text-decoration:none;color:inherit;display:flex;flex-direction:column;transition:box-shadow .15s,transform .15s;}
.alms-course-card:hover{box-shadow:0 8px 24px rgba(0,0,0,.12);transform:translateY(-2px);}
.alms-course-card__thumb{aspect-ratio:16/9;overflow:hidden;background:var(--alms-gray-100);position:relative;}
.alms-course-card__thumb img{width:100%;height:100%;object-fit:cover;}
.alms-course-card__thumb-placeholder{width:100%;height:100%;background:linear-gradient(135deg,var(--alms-primary) 0%,#a78bfa 100%);}
.alms-featured-badge{position:absolute;top:10px;left:10px;background:var(--alms-warning);color:#fff;font-size:11px;font-weight:700;padding:3px 8px;border-radius:4px;text-transform:uppercase;}
.alms-course-card__body{padding:1rem 1.1rem;display:flex;flex-direction:column;flex:1;gap:.5rem;}
.alms-course-card__level{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--alms-primary);}
.alms-course-card__title{font-size:1rem;font-weight:700;color:var(--alms-gray-900);margin:0;line-height:1.3;}
.alms-course-card__excerpt{font-size:.83rem;color:var(--alms-gray-500);margin:0;line-height:1.5;flex:1;}
.alms-course-card__footer{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:.75rem;border-top:1px solid var(--alms-gray-100);}
.alms-course-card__students{font-size:.78rem;color:var(--alms-gray-500);}
.alms-course-card__price{font-size:.95rem;font-weight:700;color:var(--alms-gray-900);}
.alms-price--free{color:var(--alms-success);}

/* ── Page cours ────────────────────────────────────────────────────────── */
.alms-course-page{max-width:900px;margin:0 auto;}
.alms-hero-video{margin-bottom:2rem;border-radius:var(--alms-radius);overflow:hidden;}
.alms-course-header{margin-bottom:1.5rem;}
.alms-course-meta-badges{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;}
.alms-badge{display:inline-block;padding:.2rem .7rem;border-radius:999px;font-size:.75rem;font-weight:600;}
.alms-badge--level{background:#ede9fe;color:#5b21b6;}
.alms-badge--lang{background:var(--alms-gray-100);color:var(--alms-gray-700);}
.alms-badge--duration{background:#ecfdf5;color:#065f46;}
.alms-badge--students{background:#eff6ff;color:#1e40af;}
.alms-outcomes-box,.alms-requirements-box{background:var(--alms-gray-50);border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1.25rem 1.5rem;margin:1.5rem 0;}
.alms-outcomes-box h3,.alms-requirements-box h3{font-size:1rem;font-weight:700;margin:0 0 .75rem;}
.alms-outcomes-box ul,.alms-requirements-box ul{margin:0;padding-left:1.25rem;}
.alms-outcomes-box li,.alms-requirements-box li{margin-bottom:.4rem;font-size:.9rem;}

/* ── Curriculum ────────────────────────────────────────────────────────── */
.alms-curriculum{margin:2rem 0;}
.alms-curriculum h3{font-size:1.1rem;font-weight:700;margin-bottom:1rem;}
.alms-section{margin-bottom:.75rem;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);overflow:hidden;}
.alms-section-header{display:flex;justify-content:space-between;align-items:center;padding:.8rem 1.1rem;background:var(--alms-gray-50);cursor:pointer;}
.alms-section-title{font-weight:600;font-size:.9rem;}
.alms-section-count{font-size:.78rem;color:var(--alms-gray-500);}
.alms-lessons-list{list-style:none;margin:0;padding:0;}
.alms-lesson-item{border-top:1px solid var(--alms-gray-100);}
.alms-lesson-link{display:flex;align-items:center;gap:.75rem;padding:.65rem 1.1rem;text-decoration:none;color:inherit;font-size:.875rem;transition:background .1s;}
.alms-lesson-link:hover{background:var(--alms-gray-50);}
.alms-lesson-link--locked{color:var(--alms-gray-500);cursor:default;}
.alms-lesson--done .alms-lesson-link{color:var(--alms-success);}
.alms-lesson-icon{width:22px;text-align:center;flex-shrink:0;}
.alms-lesson-name{flex:1;}
.alms-preview-badge{font-size:.7rem;background:#dbeafe;color:#1e40af;padding:1px 6px;border-radius:4px;}
.alms-lesson-dur{font-size:.75rem;color:var(--alms-gray-500);margin-left:auto;}

/* ── CTA box ────────────────────────────────────────────────────────────── */
.alms-cta-box{background:var(--alms-gray-50);border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1.5rem;margin:2rem 0;text-align:center;}
.alms-price{display:block;font-size:2rem;font-weight:800;color:var(--alms-gray-900);margin-bottom:1rem;}
.alms-price-cta{display:flex;flex-direction:column;align-items:center;gap:1rem;}

/* ── Boutons ─────────────────────────────────────────────────────────────  */
.alms-btn{display:inline-flex;align-items:center;gap:.4rem;padding:.65rem 1.4rem;border-radius:8px;font-size:.9rem;font-weight:600;cursor:pointer;border:none;text-decoration:none;transition:background .15s,transform .1s;}
.alms-btn--primary{background:var(--alms-primary);color:#fff;}
.alms-btn--primary:hover{background:var(--alms-primary-dark);transform:translateY(-1px);}
.alms-btn--secondary{background:var(--alms-gray-100);color:var(--alms-gray-700);}
.alms-btn--secondary:hover{background:var(--alms-gray-200);}
.alms-btn--large{padding:.85rem 2rem;font-size:1rem;}
.alms-btn--sm{padding:.4rem .9rem;font-size:.82rem;}
.alms-btn:disabled{opacity:.6;cursor:not-allowed;transform:none;}

/* ── Lecteur vidéo ───────────────────────────────────────────────────────── */
.alms-video-container{position:relative;user-select:none;}
.alms-video-ratio{position:relative;padding-top:56.25%;}
.alms-video-ratio iframe{position:absolute;inset:0;width:100%;height:100%;border:0;}
.alms-video-shield{position:absolute;inset:0;z-index:1;background:transparent;}

/* ── Leçon layout ────────────────────────────────────────────────────────── */
.alms-lesson-layout{display:grid;grid-template-columns:300px 1fr;gap:0;min-height:80vh;}
.alms-lesson-sidebar{background:var(--alms-gray-50);border-right:1px solid var(--alms-gray-200);overflow-y:auto;position:sticky;top:0;max-height:100vh;}
.alms-sidebar-header{padding:1rem;border-bottom:1px solid var(--alms-gray-200);}
.alms-back-link{font-size:.82rem;color:var(--alms-primary);text-decoration:none;font-weight:600;}
.alms-sidebar-progress{margin-top:.75rem;}
.alms-sidebar-nav{padding:.5rem 0;}
.alms-sidebar-section-title{padding:.5rem 1rem;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--alms-gray-500);background:var(--alms-gray-100);border-top:1px solid var(--alms-gray-200);}
.alms-sidebar-lesson{display:flex;align-items:center;gap:.5rem;padding:.55rem 1rem;text-decoration:none;color:var(--alms-gray-700);font-size:.82rem;transition:background .1s;}
.alms-sidebar-lesson:hover{background:var(--alms-gray-200);}
.alms-sidebar-lesson--active{background:var(--alms-primary);color:#fff;}
.alms-sidebar-lesson--done{color:var(--alms-success);}
.alms-sl-icon{width:18px;flex-shrink:0;text-align:center;}
.alms-sl-title{flex:1;}
.alms-sl-dur{font-size:.72rem;color:inherit;opacity:.7;}
.alms-lesson-main{padding:2rem;}
.alms-lesson-topbar{display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem;}
.alms-lesson-title{font-size:1.4rem;font-weight:700;margin:0;}
.alms-completed-badge{background:#ecfdf5;color:#065f46;padding:.25rem .75rem;border-radius:999px;font-size:.78rem;font-weight:600;white-space:nowrap;}
.alms-lesson-video{margin-bottom:1.5rem;border-radius:var(--alms-radius);overflow:hidden;}
.alms-lesson-content{margin-bottom:2rem;line-height:1.75;}
.alms-lesson-footer{margin-top:2rem;padding-top:1.5rem;border-top:1px solid var(--alms-gray-200);}
.alms-lesson-nav{display:flex;gap:1rem;justify-content:space-between;}

@media(max-width:768px){
  .alms-lesson-layout{grid-template-columns:1fr;}
  .alms-lesson-sidebar{display:none;}
}

/* ── Quiz ────────────────────────────────────────────────────────────────── */
.alms-quiz{max-width:700px;}
.alms-quiz-retry-notice{background:#fffbeb;border:1px solid #fcd34d;border-radius:8px;padding:.75rem 1rem;font-size:.875rem;margin-bottom:1.5rem;}
.alms-question{background:#fff;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1.25rem;margin-bottom:1rem;}
.alms-question-header{display:flex;justify-content:space-between;margin-bottom:.5rem;}
.alms-question-num{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--alms-primary);}
.alms-question-points{font-size:.75rem;color:var(--alms-gray-500);}
.alms-question-text{font-weight:600;margin-bottom:1rem;}
.alms-options-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem;}
.alms-options-list--tf{flex-direction:row;gap:1rem;}
.alms-option-label{display:flex;align-items:center;gap:.75rem;padding:.65rem 1rem;border:1.5px solid var(--alms-gray-200);border-radius:8px;cursor:pointer;transition:border-color .15s,background .15s;}
.alms-option-label:hover{border-color:var(--alms-primary);background:#faf5ff;}
.alms-option-label:has(input:checked){border-color:var(--alms-primary);background:#f5f3ff;}
.alms-open-answer{width:100%;padding:.65rem;border:1.5px solid var(--alms-gray-200);border-radius:8px;font-size:.9rem;resize:vertical;}
.alms-quiz-footer{margin-top:1.5rem;display:flex;flex-direction:column;gap:1rem;align-items:flex-start;}
.alms-quiz-result-card{text-align:center;padding:2rem;border-radius:var(--alms-radius);}
.alms-result--pass{background:#ecfdf5;border:1px solid #6ee7b7;}
.alms-result--fail{background:#fef2f2;border:1px solid #fca5a5;}
.alms-result-icon{font-size:3rem;margin-bottom:.5rem;}
.alms-result-score{font-size:2.5rem;font-weight:800;}

/* ── Progress bars ───────────────────────────────────────────────────────── */
.alms-progress-bar-wrap{background:var(--alms-gray-200);border-radius:999px;height:8px;overflow:hidden;margin:.4rem 0;}
.alms-progress-bar{background:var(--alms-primary);height:100%;border-radius:999px;transition:width .4s;}
.alms-progress-label{font-size:.75rem;color:var(--alms-gray-500);}

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.alms-dashboard{max-width:900px;margin:0 auto;}
.alms-dashboard-tabs{display:flex;gap:.5rem;border-bottom:2px solid var(--alms-gray-200);margin-bottom:1.5rem;}
.alms-tab{background:none;border:none;padding:.65rem 1.2rem;font-size:.9rem;font-weight:600;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;color:var(--alms-gray-500);transition:color .15s,border-color .15s;}
.alms-tab--active,.alms-tab:hover{color:var(--alms-primary);}
.alms-tab--active{border-bottom-color:var(--alms-primary);}
.alms-tab-panel{display:none;}
.alms-tab-panel--active{display:block;}
.alms-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:1rem;margin-bottom:1.5rem;}
.alms-kpi{background:#fff;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1rem;text-align:center;}
.alms-kpi__value{display:block;font-size:1.3rem;font-weight:700;color:var(--alms-primary);}
.alms-kpi__label{display:block;font-size:.72rem;color:var(--alms-gray-500);text-transform:uppercase;letter-spacing:.05em;margin-top:.3rem;}
.alms-my-courses,.alms-certs-grid{display:flex;flex-direction:column;gap:1rem;}
.alms-my-course-card{display:flex;justify-content:space-between;align-items:center;background:#fff;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1rem 1.25rem;gap:1rem;}
.alms-my-course-card__info{flex:1;}
.alms-my-course-card__title{font-weight:700;color:var(--alms-gray-900);text-decoration:none;font-size:.95rem;}
.alms-cert-card{display:flex;align-items:center;gap:1rem;background:#fff;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1rem 1.25rem;}
.alms-cert-card__icon{font-size:1.75rem;}
.alms-cert-card__body{flex:1;}
.alms-cert-card__body h4{margin:0 0 .2rem;font-size:.95rem;}
.alms-cert-card__body p{margin:0;font-size:.8rem;color:var(--alms-gray-500);}
.alms-payout-section{background:var(--alms-gray-50);border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:1.25rem;margin-top:1.5rem;}
.alms-payout-section h4{margin:0 0 .75rem;font-size:.95rem;}
.alms-payout-section form{display:flex;gap:.75rem;align-items:flex-end;}
.alms-payout-section input[type="number"]{padding:.6rem .8rem;border:1.5px solid var(--alms-gray-200);border-radius:8px;font-size:.9rem;width:160px;}
.alms-notice,.alms-empty{padding:.75rem 1rem;border-radius:8px;font-size:.875rem;}
.alms-notice--success{background:#ecfdf5;border-left:4px solid var(--alms-success);color:#064e3b;}
.alms-notice--error{background:#fef2f2;border-left:4px solid var(--alms-danger);color:#7f1d1d;}
.alms-empty{color:var(--alms-gray-500);}
.alms-cert-verify{background:#ecfdf5;border:1px solid #6ee7b7;border-radius:var(--alms-radius);padding:1rem 1.25rem;}

/* ── Formulaire candidature ──────────────────────────────────────────────── */
.alms-apply-form{max-width:640px;background:#fff;border:1px solid var(--alms-gray-200);border-radius:var(--alms-radius);padding:2.5rem;}
.alms-apply-form h2{margin:0 0 .5rem;font-size:1.5rem;}
.alms-apply-form p.subtitle{color:var(--alms-gray-500);margin:0 0 2rem;}
.alms-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
.alms-field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:1.1rem;}
.alms-field label{font-size:.85rem;font-weight:600;color:var(--alms-gray-700);}
.alms-field input,.alms-field select,.alms-field textarea{padding:.6rem .9rem;border:1.5px solid var(--alms-gray-200);border-radius:8px;font-size:.9rem;background:var(--alms-gray-50);transition:border-color .15s;}
.alms-field input:focus,.alms-field select:focus,.alms-field textarea:focus{outline:none;border-color:var(--alms-primary);background:#fff;}
.alms-field-hint{font-size:.75rem;color:var(--alms-gray-500);}
.alms-form-notice{padding:.8rem 1rem;border-radius:8px;margin-bottom:1rem;font-size:.875rem;}
.alms-form-notice--error{background:#fef2f2;color:#7f1d1d;}
.alms-form-notice--success{background:#ecfdf5;color:#064e3b;}

/* ─── Cartes catalogue améliorées v1.2 ─────────────────────────────────── */
.alms-catalogue{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1.5rem;margin:2rem 0;}
.alms-course-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;transition:transform .15s,box-shadow .15s;}
.alms-course-card:hover{transform:translateY(-3px);box-shadow:0 10px 30px rgba(0,0,0,.12);}
.alms-course-card__link{text-decoration:none;color:inherit;display:flex;flex-direction:column;flex:1;}
.alms-course-card__thumb{aspect-ratio:16/9;overflow:hidden;position:relative;background:linear-gradient(135deg,#ede9fe,#ddd6fe);}
.alms-course-card__thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.alms-course-card__thumb-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:3rem;color:rgba(124,58,237,.4);}
.alms-card-badge{position:absolute;top:10px;left:10px;padding:.25rem .65rem;border-radius:999px;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;}
.alms-card-badge--free{background:#059669;color:#fff;}
.alms-card-badge--featured{background:#d97706;color:#fff;}
.alms-course-card__body{padding:1rem 1.1rem;flex:1;display:flex;flex-direction:column;gap:.45rem;}
.alms-course-card__level{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#7c3aed;}
.alms-course-card__title{font-size:1rem;font-weight:700;color:#111827;margin:0;line-height:1.35;}
.alms-course-card__excerpt{font-size:.83rem;color:#6b7280;line-height:1.5;margin:0;flex:1;}
.alms-course-card__meta{display:flex;gap:.85rem;font-size:.75rem;color:#6b7280;margin-top:.25rem;}
.alms-course-card__footer{padding:.85rem 1.1rem;border-top:1px solid #f3f4f6;display:flex;justify-content:space-between;align-items:center;gap:.75rem;background:#fafbfc;}
.alms-course-card__price{font-size:1.05rem;font-weight:800;color:#111827;}
.alms-course-card__price--free{color:#059669;}
.alms-card-cta{padding:.5rem 1rem;background:#7c3aed;color:#fff;border:none;border-radius:7px;font-size:.82rem;font-weight:600;cursor:pointer;text-decoration:none;transition:background .15s;display:inline-flex;align-items:center;gap:.3rem;}
.alms-card-cta:hover{background:#5b21b6;color:#fff;}
.alms-card-cta--free{background:#059669;}
.alms-card-cta--free:hover{background:#047857;}
.alms-card-cta--enrolled{background:#3b82f6;}
.alms-card-cta--enrolled:hover{background:#2563eb;}
.alms-card-cta--buy{background:#7c3aed;}

/* ─── Profil utilisateur ───────────────────────────────────────────────── */
.alms-profile-wrap{max-width:760px;margin:0 auto;}
.alms-profile-header{display:flex;align-items:center;gap:1.25rem;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.5rem;margin-bottom:1.25rem;}
.alms-profile-avatar-wrap{position:relative;}
.alms-profile-avatar{width:88px;height:88px;border-radius:50%;object-fit:cover;border:3px solid #ede9fe;display:block;}
.alms-profile-avatar-btn{position:absolute;bottom:0;right:0;background:#7c3aed;color:#fff;border:none;border-radius:50%;width:30px;height:30px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;}
.alms-profile-name{font-size:1.25rem;font-weight:700;margin:0 0 .25rem;color:#111827;}
.alms-profile-role{font-size:.85rem;color:#6b7280;margin:0;}
.alms-profile-section{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.5rem;margin-bottom:1.25rem;}
.alms-profile-section__title{font-size:.95rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#374151;margin:0 0 1rem;padding-bottom:.65rem;border-bottom:1px solid #f3f4f6;}
.alms-profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:.85rem;margin-bottom:1rem;}
.alms-profile-field{display:flex;flex-direction:column;gap:.3rem;}
.alms-profile-field--full{grid-column:1/-1;}
.alms-profile-field label{font-size:.82rem;font-weight:600;color:#374151;}
.alms-profile-field input,.alms-profile-field textarea{padding:.6rem .85rem;border:1.5px solid #e5e7eb;border-radius:8px;font-size:.9rem;background:#f9fafb;transition:border-color .15s;}
.alms-profile-field input:focus,.alms-profile-field textarea:focus{outline:none;border-color:#7c3aed;background:#fff;}
@media(max-width:640px){.alms-profile-grid{grid-template-columns:1fr;}}

/* ─── Cartes d'achat dans dashboard ──────────────────────────────────────── */
.alms-purchases-list{display:flex;flex-direction:column;gap:1rem;}
.alms-purchase-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:1rem 1.25rem;}
.alms-purchase-card__head{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem;padding-bottom:.65rem;border-bottom:1px solid #f3f4f6;}
.alms-purchase-card__date{font-size:.78rem;color:#6b7280;margin-left:.5rem;}
.alms-purchase-card__items{list-style:none;margin:0;padding:0;}
.alms-purchase-card__items li{display:flex;justify-content:space-between;padding:.4rem 0;font-size:.88rem;}
.alms-purchase-card__items a{color:#7c3aed;text-decoration:none;}
.alms-purchase-card__items a:hover{text-decoration:underline;}
.alms-purchase-card__foot{display:flex;justify-content:space-between;align-items:center;margin-top:.75rem;padding-top:.65rem;border-top:1px solid #f3f4f6;}
