/* ─── Arcademix LMS — Frontend Builder CSS ──────────────────────────────── */

/* ── Wrapper global ──────────────────────────────────────────────────────── */
.alms-frontend-builder{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#111827;max-width:960px;margin:0 auto;}

/* ── Header instructeur ──────────────────────────────────────────────────── */
.alms-fb-header{display:flex;justify-content:space-between;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.25rem 1.5rem;margin-bottom:1rem;flex-wrap:wrap;gap:1rem;}
.alms-fb-header__info{display:flex;align-items:center;gap:12px;}
.alms-fb-avatar{width:44px;height:44px;border-radius:50%;background:#ede9fe;color:#5b21b6;font-weight:700;font-size:15px;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.alms-fb-header__name{font-weight:700;font-size:15px;}
.alms-fb-header__role{font-size:12px;color:#6b7280;text-transform:uppercase;letter-spacing:.05em;}
.alms-fb-header__kpis{display:flex;gap:1.5rem;}
.alms-fb-kpi{text-align:center;}
.alms-fb-kpi .v{display:block;font-size:1.2rem;font-weight:700;color:#7c3aed;}
.alms-fb-kpi .l{display:block;font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.04em;}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.alms-fb-nav{display:flex;gap:.5rem;border-bottom:2px solid #e5e7eb;margin-bottom:1.5rem;flex-wrap:wrap;}
.alms-fb-nav__item{padding:.6rem 1.1rem;font-size:.875rem;font-weight:600;color:#6b7280;text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-2px;transition:color .15s,border-color .15s;}
.alms-fb-nav__item:hover,.alms-fb-nav__item--active{color:#7c3aed;border-bottom-color:#7c3aed;}
.alms-fb-nav__item--cta{margin-left:auto;background:#7c3aed;color:#fff;border-radius:8px;border-bottom:2px solid transparent;padding:.55rem 1.1rem;}
.alms-fb-nav__item--cta:hover{background:#5b21b6;color:#fff;}

/* ── Section ─────────────────────────────────────────────────────────────── */
.alms-fb-section{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.5rem 2rem;}
.alms-fb-section__header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:1.25rem;gap:1rem;}
.alms-fb-section__title{font-size:1.2rem;font-weight:700;margin:0 0 .25rem;}
.alms-fb-section__subtitle{font-size:.85rem;color:#6b7280;margin:0;}

/* ── Gate (accès refusé / pending) ──────────────────────────────────────── */
.alms-fb-gate{text-align:center;padding:3rem 2rem;}
.alms-fb-gate__icon{font-size:3rem;margin-bottom:1rem;}
.alms-fb-gate h3{font-size:1.25rem;font-weight:700;margin:0 0 .75rem;}
.alms-fb-gate p{color:#6b7280;margin-bottom:1.5rem;}
.alms-fb-gate--pending{background:#fffbeb;border-radius:12px;}
.alms-fb-gate--error{background:#fef2f2;border-radius:12px;}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.alms-fb-empty{text-align:center;padding:3rem 2rem;}
.alms-fb-empty__icon{font-size:3rem;margin-bottom:1rem;}
.alms-fb-empty h3{font-size:1.1rem;font-weight:700;margin:0 0 .5rem;}
.alms-fb-empty p{color:#6b7280;margin:0 0 1.5rem;}

/* ── Grid cours ──────────────────────────────────────────────────────────── */
.alms-fb-courses-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:1rem;}
.alms-fb-course-card{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;transition:box-shadow .15s;}
.alms-fb-course-card:hover{box-shadow:0 4px 16px rgba(0,0,0,.1);}
.alms-fb-course-card__thumb{aspect-ratio:16/9;position:relative;overflow:hidden;background:#f3f4f6;}
.alms-fb-course-card__thumb img{width:100%;height:100%;object-fit:cover;}
.alms-fb-course-card__thumb-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:2.5rem;background:linear-gradient(135deg,#ede9fe,#ddd6fe);}
.alms-fb-course-card__body{padding:1rem;}
.alms-fb-course-card__title{font-size:.9rem;font-weight:700;margin:0 0 .5rem;line-height:1.3;}
.alms-fb-course-card__meta{font-size:.78rem;color:#6b7280;display:flex;gap:1rem;margin-bottom:.75rem;}
.alms-fb-course-card__actions{display:flex;gap:.4rem;flex-wrap:wrap;}

/* ── Formulaire cours ────────────────────────────────────────────────────── */
.alms-fb-form{display:flex;flex-direction:column;gap:1.5rem;}
.alms-fb-form-block{border:1px solid #f3f4f6;border-radius:10px;padding:1.25rem;}
.alms-fb-form-block__title{font-size:.9rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#374151;margin:0 0 1rem;padding-bottom:.75rem;border-bottom:1px solid #f3f4f6;}
.alms-fb-form-block__desc{font-size:.83rem;color:#6b7280;margin:-.5rem 0 1rem;}
.alms-fb-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
.alms-fb-field{display:flex;flex-direction:column;gap:.35rem;margin-bottom:.85rem;}
.alms-fb-field--full{grid-column:1/-1;}
.alms-fb-field label{font-size:.83rem;font-weight:600;color:#374151;}
.alms-fb-field input[type="text"],
.alms-fb-field input[type="url"],
.alms-fb-field input[type="number"],
.alms-fb-field select,
.alms-fb-field textarea{padding:.6rem .85rem;border:1.5px solid #e5e7eb;border-radius:8px;font-size:.9rem;background:#f9fafb;transition:border-color .15s,background .15s;width:100%;}
.alms-fb-field input:focus,
.alms-fb-field select:focus,
.alms-fb-field textarea:focus{outline:none;border-color:#7c3aed;background:#fff;}
.alms-fb-field-hint{font-size:.75rem;color:#6b7280;}
.alms-fb-checkbox-label{display:flex;align-items:center;gap:.5rem;font-size:.85rem;cursor:pointer;}

/* ── Zone upload image couverture ────────────────────────────────────────── */
.alms-fb-thumb-upload-area{border:2px dashed #e5e7eb;border-radius:10px;padding:1.5rem;text-align:center;cursor:pointer;transition:border-color .15s,background .15s;min-height:120px;display:flex;align-items:center;justify-content:center;}
.alms-fb-thumb-upload-area:hover{border-color:#7c3aed;background:#faf5ff;}
#alms-fb-thumb-placeholder{display:flex;flex-direction:column;align-items:center;gap:.4rem;color:#9ca3af;pointer-events:none;}
.alms-fb-thumb-icon{font-size:2rem;display:block;}
#alms-fb-thumb-preview-img{border-radius:8px;max-width:100%;max-height:200px;object-fit:cover;pointer-events:none;}

/* ── Étapes progression formulaire ──────────────────────────────────────── */
.alms-fb-steps-hint{display:flex;align-items:center;gap:.75rem;justify-content:center;margin:.75rem 0;flex-wrap:wrap;}
.alms-fb-step{display:flex;align-items:center;gap:.4rem;opacity:.45;}
.alms-fb-step--active{opacity:1;}
.alms-fb-step__num{width:22px;height:22px;border-radius:50%;background:#e5e7eb;color:#374151;font-size:.72rem;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.alms-fb-step--active .alms-fb-step__num{background:#7c3aed;color:#fff;}
.alms-fb-step__label{font-size:.78rem;font-weight:500;color:#374151;}
.alms-fb-step__arrow{color:#9ca3af;font-size:.85rem;}

/* ── Actions formulaire ──────────────────────────────────────────────────── */
.alms-fb-form-actions{display:flex;gap:1rem;justify-content:flex-end;padding-top:.5rem;}
.alms-fb-notice-small{font-size:.78rem;color:#6b7280;text-align:center;margin:0;}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.alms-fb-btn{display:inline-flex;align-items:center;gap:.4rem;padding:.6rem 1.2rem;border-radius:8px;font-size:.875rem;font-weight:600;cursor:pointer;border:1.5px solid transparent;text-decoration:none;transition:background .15s,transform .1s,border-color .15s;}
.alms-fb-btn--primary{background:#7c3aed;color:#fff;border-color:#7c3aed;}
.alms-fb-btn--primary:hover{background:#5b21b6;border-color:#5b21b6;}
.alms-fb-btn--secondary{background:#f3f4f6;color:#374151;border-color:#e5e7eb;}
.alms-fb-btn--secondary:hover{background:#e5e7eb;}
.alms-fb-btn--ghost{background:transparent;color:#6b7280;border-color:#e5e7eb;}
.alms-fb-btn--ghost:hover{background:#f9fafb;}
.alms-fb-btn--danger{background:#fef2f2;color:#dc2626;border-color:#fecaca;}
.alms-fb-btn--danger:hover{background:#fee2e2;}
.alms-fb-btn--sm{padding:.4rem .85rem;font-size:.8rem;}
.alms-fb-btn--xs{padding:.25rem .6rem;font-size:.75rem;}
.alms-fb-btn--full{width:100%;justify-content:center;}
.alms-fb-btn:disabled{opacity:.55;cursor:not-allowed;transform:none;}

/* ── Curriculum builder ──────────────────────────────────────────────────── */
#alms-fb-sections-list{display:flex;flex-direction:column;gap:.75rem;margin-bottom:1rem;}
.alms-fb-section-block{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;background:#fff;}
.alms-fb-section-block__header{display:flex;align-items:center;gap:.75rem;padding:.8rem 1rem;background:#f9fafb;border-bottom:1px solid #f3f4f6;}
.alms-fb-section-block__title{flex:1;font-weight:600;font-size:.9rem;outline:none;border:none;background:transparent;padding:.2rem .4rem;border-radius:4px;}
.alms-fb-section-block__title:focus{background:#fff;box-shadow:0 0 0 2px #7c3aed;}
.alms-fb-section-block__actions{display:flex;gap:.4rem;}
.alms-fb-drag-handle{color:#9ca3af;cursor:grab;font-size:14px;flex-shrink:0;}
.alms-fb-lessons-list{list-style:none;margin:0;padding:0;}
.alms-fb-lesson-item{display:flex;align-items:center;gap:.65rem;padding:.6rem 1rem;border-bottom:1px solid #f9fafb;font-size:.85rem;}
.alms-fb-lesson-item:last-child{border-bottom:none;}
.alms-fb-lesson-type-icon{font-size:13px;color:#9ca3af;flex-shrink:0;}
.alms-fb-lesson-title{flex:1;font-weight:500;}
.alms-fb-lesson-actions{display:flex;gap:.35rem;margin-left:auto;}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.alms-fb-badge{display:inline-block;padding:.15rem .6rem;border-radius:999px;font-size:.7rem;font-weight:700;text-transform:uppercase;}
.alms-fb-badge--approved{background:#ecfdf5;color:#065f46;}
.alms-fb-badge--pending{background:#fffbeb;color:#92400e;}
.alms-fb-badge--draft{background:#f3f4f6;color:#374151;}
.alms-fb-badge--rejected{background:#fef2f2;color:#7f1d1d;}
.alms-fb-badge--preview{background:#eff6ff;color:#1e40af;}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.alms-fb-modal{position:relative;z-index:9999;}
.alms-fb-modal__overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);}
.alms-fb-modal__box{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:12px;width:560px;max-width:95vw;max-height:85vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.25);}
.alms-fb-modal__box--wide{width:720px;}
.alms-fb-modal__header{display:flex;justify-content:space-between;align-items:center;padding:1.25rem 1.5rem;border-bottom:1px solid #e5e7eb;}
.alms-fb-modal__header h3{margin:0;font-size:1rem;font-weight:700;}
.alms-fb-modal__close{background:none;border:none;cursor:pointer;font-size:18px;color:#6b7280;padding:.25rem;}
.alms-fb-modal__body{padding:1.25rem 1.5rem;}
.alms-fb-modal__footer{display:flex;gap:.75rem;justify-content:flex-end;padding:1rem 1.5rem;border-top:1px solid #e5e7eb;}

/* ── Notices ─────────────────────────────────────────────────────────────── */
.alms-fb-notice{padding:.8rem 1rem;border-radius:8px;font-size:.875rem;margin-bottom:1rem;}
.alms-fb-notice--success{background:#ecfdf5;border-left:4px solid #059669;color:#064e3b;}
.alms-fb-notice--error{background:#fef2f2;border-left:4px solid #dc2626;color:#7f1d1d;}
.alms-fb-notice--info{background:#eff6ff;border-left:4px solid #3b82f6;color:#1e40af;}

/* ── Table ───────────────────────────────────────────────────────────────── */
.alms-fb-table-wrap{overflow-x:auto;margin-top:1rem;}
.alms-fb-table{width:100%;border-collapse:collapse;font-size:.875rem;}
.alms-fb-table th{text-align:left;padding:.6rem .75rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:#6b7280;border-bottom:2px solid #e5e7eb;}
.alms-fb-table td{padding:.7rem .75rem;border-bottom:1px solid #f3f4f6;vertical-align:middle;}
.alms-fb-table tr:last-child td{border-bottom:none;}
.alms-fb-table small{display:block;color:#6b7280;font-size:.75rem;}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.alms-fb-progress{background:#e5e7eb;border-radius:999px;height:6px;overflow:hidden;margin-bottom:3px;}
.alms-fb-progress__bar{background:#7c3aed;height:100%;border-radius:999px;transition:width .3s;}

/* ── KPI cards revenus ───────────────────────────────────────────────────── */
.alms-fb-kpis-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:1.5rem;}
.alms-fb-kpi-card{background:#f9fafb;border-radius:10px;padding:1rem;text-align:center;}
.alms-fb-kpi-card .v{display:block;font-size:1.25rem;font-weight:700;color:#7c3aed;}
.alms-fb-kpi-card .l{display:block;font-size:.72rem;color:#6b7280;text-transform:uppercase;letter-spacing:.04em;margin-top:.3rem;}

/* ── Payout box ──────────────────────────────────────────────────────────── */
.alms-fb-payout-box{background:#f9fafb;border:1px solid #e5e7eb;border-radius:10px;padding:1.25rem;margin-bottom:1.5rem;}
.alms-fb-payout-box h3{margin:0 0 .35rem;font-size:.95rem;}
.alms-fb-payout-form{display:flex;gap:.75rem;align-items:center;margin-top:.85rem;flex-wrap:wrap;}
.alms-fb-payout-form input[type="number"]{padding:.6rem .85rem;border:1.5px solid #e5e7eb;border-radius:8px;font-size:.9rem;width:150px;}
.alms-fb-payout-form span{font-size:.85rem;color:#6b7280;font-weight:600;}

/* ── Quiz questions (dans modal) ─────────────────────────────────────────── */
.alms-fb-question-block{border:1px solid #e5e7eb;border-radius:8px;padding:1rem;margin-bottom:.75rem;}
.alms-fb-question-block__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem;}
.alms-fb-question-block__num{font-size:.75rem;font-weight:700;text-transform:uppercase;color:#7c3aed;}
.alms-fb-options-list{display:flex;flex-direction:column;gap:.4rem;margin:.5rem 0;}
.alms-fb-option-row{display:flex;align-items:center;gap:.5rem;}
.alms-fb-option-row input[type="text"]{flex:1;padding:.4rem .65rem;border:1px solid #e5e7eb;border-radius:6px;font-size:.85rem;}
.alms-fb-option-correct{width:16px;height:16px;cursor:pointer;}

@media(max-width:640px){
  .alms-fb-header{flex-direction:column;align-items:flex-start;}
  .alms-fb-grid-2{grid-template-columns:1fr;}
  .alms-fb-form-actions{flex-direction:column;}
  .alms-fb-courses-grid{grid-template-columns:1fr;}
  .alms-fb-modal__box{width:95vw;}
}
