/* ================================================
   B2Breizh LinkedIn Express — Styles front
   Palette : bleu marine #1B3A6B + blanc #FFFFFF
   ================================================ */

:root {
    --b2b-primary:      #1B3A6B;
    --b2b-primary-dark: #132D54;
    --b2b-accent:       #2563EB;
    --b2b-success:      #059669;
    --b2b-warning:      #D97706;
    --b2b-danger:       #DC2626;
    --b2b-bg:           #F8FAFC;
    --b2b-white:        #FFFFFF;
    --b2b-border:       #E2E8F0;
    --b2b-text:         #1E293B;
    --b2b-text-muted:   #64748B;
    --b2b-radius:       8px;
    --b2b-shadow:       0 2px 8px rgba(27,58,107,.10);
    --b2b-shadow-lg:    0 8px 32px rgba(27,58,107,.16);
    --b2b-transition:   .2s ease;
}

/* ── Reset ── */
.b2bli-parcours * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.b2bli-parcours {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--b2b-text);
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── En-tête progression ── */
.b2bli-header-progression {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--b2b-primary);
    color: var(--b2b-white);
    border-radius: var(--b2b-radius);
    padding: 16px 24px;
    margin-bottom: 28px;
    box-shadow: var(--b2b-shadow);
}

.b2bli-xp-badge {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.b2bli-xp-total {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.5px;
}

.b2bli-xp-label {
    font-size: 13px;
    opacity: .8;
}

/* ── Boutons ── */
.b2bli-btn-primary,
.b2bli-btn-upgrade {
    background: var(--b2b-white);
    color: var(--b2b-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: var(--b2b-transition);
    font-size: 14px;
}

.b2bli-btn-primary:hover,
.b2bli-btn-upgrade:hover {
    background: var(--b2b-bg);
    transform: translateY(-1px);
}

.b2bli-btn-fiche {
    background: rgba(255,255,255,.15);
    color: var(--b2b-white);
    border: 1px solid rgba(255,255,255,.3);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--b2b-transition);
}

.b2bli-btn-fiche:hover {
    background: rgba(255,255,255,.25);
}

.b2bli-btn-save {
    background: transparent;
    color: var(--b2b-primary);
    border: 1px solid var(--b2b-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--b2b-transition);
}

.b2bli-btn-save:hover { background: var(--b2b-bg); }

.b2bli-btn-validate {
    background: var(--b2b-primary);
    color: var(--b2b-white);
    border: none;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--b2b-transition);
}

.b2bli-btn-validate:hover {
    background: var(--b2b-primary-dark);
}

.b2bli-btn-feedback {
    background: #EFF6FF;
    color: var(--b2b-accent);
    border: 1px solid #BFDBFE;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--b2b-transition);
}

.b2bli-btn-feedback:hover { background: #DBEAFE; }
.b2bli-btn-feedback:disabled { opacity:.5; cursor:not-allowed; }

/* ── Blocs ── */
.b2bli-blocs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.b2bli-bloc {
    background: var(--b2b-white);
    border-radius: var(--b2b-radius);
    box-shadow: var(--b2b-shadow);
    overflow: hidden;
}

.b2bli-bloc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-left: 4px solid var(--b2b-primary);
    cursor: pointer;
    user-select: none;
    transition: background var(--b2b-transition);
}

.b2bli-bloc-header:hover { background: var(--b2b-bg); }

.b2bli-bloc-icone {
    font-size: 24px;
    flex-shrink: 0;
}

.b2bli-bloc-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.b2bli-bloc-meta { flex: 1; min-width: 0; }

.b2bli-bloc-titre {
    font-size: 16px;
    font-weight: 700;
    color: var(--b2b-text);
    margin-bottom: 2px;
}

.b2bli-bloc-desc {
    font-size: 13px;
    color: var(--b2b-text-muted);
    margin-bottom: 4px;
}

.b2bli-bloc-stats {
    font-size: 12px;
    color: var(--b2b-text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.b2bli-bloc-progress-bar-wrap {
    width: 80px;
    height: 6px;
    background: var(--b2b-border);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.b2bli-bloc-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--b2b-primary);
    transition: width .4s ease;
}

.b2bli-bloc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--b2b-text-muted);
    font-size: 12px;
    padding: 4px;
    transition: transform var(--b2b-transition);
    flex-shrink: 0;
}

.b2bli-bloc.open .b2bli-bloc-toggle { transform: rotate(180deg); }

.b2bli-bloc-lock {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--b2b-text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* Module verrouillé */
.b2bli-locked .b2bli-bloc-header {
    opacity: .75;
}

/* ── Corps du bloc ── */
.b2bli-bloc-body {
    border-top: 1px solid var(--b2b-border);
    padding: 0;
}

.b2bli-lock-gate {
    padding: 24px;
    text-align: center;
}

.b2bli-upgrade-cta p {
    color: var(--b2b-text-muted);
    margin-bottom: 14px;
}

/* ── Quêtes ── */
.b2bli-quete {
    border-bottom: 1px solid var(--b2b-border);
    padding: 20px 24px;
    transition: background var(--b2b-transition);
}

.b2bli-quete:last-child { border-bottom: none; }
.b2bli-quete-validee { background: #F0FDF4; }

.b2bli-quete-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.b2bli-quete-num {
    background: var(--b2b-primary);
    color: var(--b2b-white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.b2bli-quete-validee .b2bli-quete-num {
    background: var(--b2b-success);
}

.b2bli-quete-titre {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.b2bli-quete-xp {
    font-size: 12px;
    color: var(--b2b-text-muted);
    font-weight: 500;
}

.b2bli-quete-statut {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
}

.b2bli-quete-statut.valide {
    background: #D1FAE5;
    color: var(--b2b-success);
}

.b2bli-quete-statut.en_cours {
    background: #FEF3C7;
    color: var(--b2b-warning);
}

/* Ressources */
.b2bli-quete-ressources {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.b2bli-ressource-link {
    font-size: 13px;
    color: var(--b2b-accent);
    text-decoration: none;
    background: #EFF6FF;
    padding: 4px 12px;
    border-radius: 4px;
    transition: var(--b2b-transition);
}

.b2bli-ressource-link:hover { background: #DBEAFE; }

/* Notion doc */
.b2bli-notion-doc {
    background: var(--b2b-bg);
    border: 1px solid var(--b2b-border);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 14px;
    color: var(--b2b-text);
}

/* Livrable */
.b2bli-livrable {
    font-size: 13px;
    color: var(--b2b-text-muted);
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #F1F5F9;
    border-radius: 6px;
    border-left: 3px solid var(--b2b-primary);
}

/* Formulaire */
.b2bli-form-reponse { margin-top: 4px; }

.b2bli-champ-groupe { margin-bottom: 16px; }

.b2bli-champ-groupe label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--b2b-text);
}

.b2bli-tip {
    font-size: 12px;
    color: var(--b2b-text-muted);
    margin-bottom: 6px;
    font-style: italic;
}

.b2bli-champ-groupe textarea,
.b2bli-field-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--b2b-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--b2b-text);
    resize: vertical;
    transition: border-color var(--b2b-transition);
}

.b2bli-champ-groupe textarea:focus,
.b2bli-field-group textarea:focus {
    outline: none;
    border-color: var(--b2b-primary);
    box-shadow: 0 0 0 3px rgba(27,58,107,.08);
}

.b2bli-champ-groupe textarea[readonly] {
    background: var(--b2b-bg);
    color: var(--b2b-text-muted);
    cursor: default;
}

.b2bli-validation-criteres {
    font-size: 13px;
    color: var(--b2b-text-muted);
    margin-bottom: 14px;
    padding: 10px;
    background: #F8F4FF;
    border-radius: 6px;
    border-left: 3px solid #7C3AED;
}

.b2bli-quete-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.b2bli-validated-msg {
    font-size: 14px;
    color: var(--b2b-success);
    font-weight: 600;
}

/* Feedback zone */
.b2bli-feedback-zone {
    margin-top: 14px;
    padding: 16px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
}

.b2bli-feedback-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--b2b-text);
    white-space: pre-wrap;
}

.b2bli-feedback-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--b2b-accent);
    font-size: 14px;
}

.b2bli-feedback-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: b2bli-spin .8s linear infinite;
    flex-shrink: 0;
}

@keyframes b2bli-spin { to { transform: rotate(360deg); } }

/* Messages flash */
.b2bli-quete-msg {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.b2bli-quete-msg.success {
    background: #D1FAE5;
    color: var(--b2b-success);
}

.b2bli-quete-msg.error {
    background: #FEE2E2;
    color: var(--b2b-danger);
}

/* ── Modale Fiche Profil ── */
.b2bli-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.b2bli-modal-inner {
    background: var(--b2b-white);
    border-radius: 12px;
    padding: 32px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--b2b-shadow-lg);
}

.b2bli-modal-inner h2 {
    font-size: 22px;
    color: var(--b2b-primary);
    margin-bottom: 6px;
}

.b2bli-modal-desc {
    font-size: 14px;
    color: var(--b2b-text-muted);
    margin-bottom: 24px;
}

.b2bli-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--b2b-text-muted);
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--b2b-transition);
}

.b2bli-modal-close:hover { background: var(--b2b-bg); color: var(--b2b-text); }

.b2bli-field-group { margin-bottom: 18px; }

.b2bli-field-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.b2bli-save-status {
    font-size: 13px;
    margin-left: 12px;
    color: var(--b2b-success);
}

/* ── Login required ── */
.b2bli-login-required {
    text-align: center;
    padding: 48px 24px;
    background: var(--b2b-bg);
    border-radius: var(--b2b-radius);
    border: 1px solid var(--b2b-border);
}

.b2bli-login-required p {
    font-size: 16px;
    margin-bottom: 18px;
    color: var(--b2b-text-muted);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .b2bli-header-progression { flex-direction: column; gap: 12px; text-align: center; }
    .b2bli-bloc-header { flex-wrap: wrap; }
    .b2bli-quete { padding: 16px; }
    .b2bli-quete-actions { flex-direction: column; align-items: flex-start; }
    .b2bli-modal-inner { padding: 20px; }
}
