/* ============================================================
   CHARTE GRAPHIQUE HUMAN MARKETING (HMC)
   Dégradé de marque : #2a6eb4 30% → #4eb2a0 64% → #75c16d 100%
   Toutes les classes sont préfixées « hmc- » et toutes les
   variables « --hmc- » pour ne jamais entrer en conflit avec
   le CSS existant de humanmarketing.ma.
   ============================================================ */

:root {
    /* ---- Palette de marque ---- */
    --hmc-blue:        #2a6eb4;
    --hmc-blue-light:  #3d87d4;
    --hmc-blue-dark:   #1f5490;
    --hmc-teal:        #4eb2a0;
    --hmc-teal-light:  #6ecfbd;
    --hmc-green:       #75c16d;
    --hmc-green-light: #93d68c;

    /* ---- Dégradé principal (boutons, barres, accents) ---- */
    --hmc-gradient:      linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%);
    --hmc-gradient-rev:  linear-gradient(to top left, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%);
    --hmc-gradient-soft: linear-gradient(to bottom right, rgba(42, 110, 180, .18) 30%, rgba(78, 178, 160, .12) 64%, rgba(117, 193, 109, .10) 100%);

    /* ---- Rôles ---- */
    --hmc-primary:       var(--hmc-blue);
    --hmc-primary-light: var(--hmc-blue-light);
    --hmc-primary-dark:  var(--hmc-blue-dark);
    --hmc-primary-soft:  rgba(42, 110, 180, .16);
    --hmc-primary-ring:  rgba(78, 178, 160, .28);
    --hmc-on-primary:    #FFFFFF;
    --hmc-secondary:     var(--hmc-teal);
    --hmc-accent:        var(--hmc-teal-light);
    --hmc-accent-soft:   rgba(78, 178, 160, .14);

    /* ---- Fonds ---- */
    --hmc-bg:            #06101B;
    --hmc-bg-alt:        #0A1724;
    --hmc-surface:       #101E2C;
    --hmc-surface-2:     #16283A;
    --hmc-border:        rgba(255, 255, 255, .08);
    --hmc-border-strong: rgba(255, 255, 255, .16);

    /* ---- Sémantique ---- */
    --hmc-success:       var(--hmc-green);
    --hmc-warning:       #E0A93B;
    --hmc-danger:        #E8705F;

    /* ---- Texte ---- */
    --hmc-text:          #F2F7FB;
    --hmc-text-soft:     #BFCEDB;
    --hmc-muted:         #8598A8;

    /* ---- Divers ---- */
    --hmc-radius:        18px;
    --hmc-radius-sm:     12px;
    --hmc-shadow:        0 24px 60px rgba(0, 0, 0, .45);
    --hmc-font:          'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Base ---------- */
.hmc-shell *, .hmc-shell *::before, .hmc-shell *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--hmc-font);
    background: var(--hmc-bg);
    color: var(--hmc-text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 500px at 10% -12%, rgba(42, 110, 180, .28), transparent 62%),
        radial-gradient(760px 460px at 88% 4%, rgba(78, 178, 160, .20), transparent 62%),
        radial-gradient(700px 420px at 60% 100%, rgba(117, 193, 109, .12), transparent 62%);
    pointer-events: none;
    z-index: 0;
}

.hmc-shell { position: relative; z-index: 1; }

.hmc-shell a { color: var(--hmc-accent); text-decoration: none; }
.hmc-shell a:hover { color: var(--hmc-green-light); text-decoration: underline; }

.hmc-shell h1, .hmc-shell h2, .hmc-shell h3, .hmc-shell h4 {
    line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; letter-spacing: -.02em; color: var(--hmc-text);
}
.hmc-shell h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.hmc-shell h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.hmc-shell p  { color: var(--hmc-text-soft); }

.hmc-container { width: min(1180px, 92vw); margin-inline: auto; }
.hmc-container--narrow { width: min(860px, 92vw); }

/* ---------- Header / footer ---------- */
.hmc-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1.1rem 0;
    border-bottom: 1px solid var(--hmc-border);
}
.hmc-logo { display: flex; align-items: center; gap: .65rem; font-weight: 800; letter-spacing: .04em; color: var(--hmc-text); }
.hmc-logo img { height: 38px; width: auto; }
.hmc-logo:hover { text-decoration: none; }
.hmc-logo span {
    background: var(--hmc-gradient);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-size: .95rem;
}

.hmc-footer {
    margin-top: 4rem; padding: 2rem 0; border-top: 1px solid var(--hmc-border);
    color: var(--hmc-muted); font-size: .85rem;
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}

/* ---------- Badges & pills ---------- */
.hmc-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem .9rem; border-radius: 999px;
    background: var(--hmc-primary-soft); border: 1px solid rgba(78, 178, 160, .34);
    color: var(--hmc-teal-light); font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em;
}
.hmc-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .35rem .8rem; border-radius: 999px;
    font-size: .8rem; font-weight: 600;
    background: rgba(255, 255, 255, .06); border: 1px solid var(--hmc-border);
}
.hmc-badge--dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Cartes ---------- */
.hmc-card {
    background: var(--hmc-surface);
    border: 1px solid var(--hmc-border);
    border-radius: var(--hmc-radius);
    padding: 1.6rem;
    box-shadow: var(--hmc-shadow);
}
.hmc-card--glass { background: linear-gradient(180deg, rgba(22, 40, 58, .92), rgba(16, 30, 44, .92)); backdrop-filter: blur(12px); }
.hmc-card--accent { border-color: rgba(78, 178, 160, .34); background-image: var(--hmc-gradient-soft); }
.hmc-card--green  { border-color: rgba(117, 193, 109, .34); background-image: linear-gradient(to bottom right, rgba(117, 193, 109, .16), rgba(78, 178, 160, .08)); }

.hmc-grid { display: grid; gap: 1.1rem; }
.hmc-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.hmc-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hmc-grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------- Boutons ---------- */
.hmc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    padding: .95rem 1.7rem; border-radius: 999px; border: 1px solid transparent;
    font-family: inherit; font-size: .92rem; font-weight: 700; letter-spacing: .04em;
    cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    text-decoration: none;
}
.hmc-btn:hover { transform: translateY(-2px); text-decoration: none; }

.hmc-btn--primary {
    background: linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%) !important;
    color: var(--hmc-on-primary) !important;
    box-shadow: 0 12px 30px rgba(42, 110, 180, .38);
}
.hmc-btn--primary:hover { box-shadow: 0 16px 38px rgba(42, 110, 180, .48); }

.hmc-btn--secondary {
    background: linear-gradient(to top left, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%) !important;
    color: #fff !important;
    box-shadow: 0 12px 30px rgba(78, 178, 160, .34);
}

.hmc-btn--ghost { background: rgba(255, 255, 255, .05); border-color: var(--hmc-border-strong); color: var(--hmc-text); }
.hmc-btn--ghost:hover { border-color: var(--hmc-teal); color: var(--hmc-text); }
.hmc-btn--sm { padding: .55rem 1.05rem; font-size: .82rem; }
.hmc-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Formulaires ---------- */
.hmc-field { margin-bottom: 1.1rem; }
.hmc-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .45rem; color: var(--hmc-text); }
.hmc-label .req { color: var(--hmc-teal); }
.hmc-input, .hmc-select {
    width: 100%; padding: .85rem 1rem;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--hmc-border-strong); border-radius: var(--hmc-radius-sm);
    color: var(--hmc-text); font-family: inherit; font-size: .95rem;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.hmc-input:focus, .hmc-select:focus {
    outline: none; border-color: var(--hmc-teal);
    box-shadow: 0 0 0 4px var(--hmc-primary-ring);
}
.hmc-input::placeholder { color: var(--hmc-muted); }
.hmc-select option { background: var(--hmc-surface); color: var(--hmc-text); }
.hmc-error { color: var(--hmc-danger); font-size: .82rem; margin-top: .35rem; }
.hmc-checkbox { display: flex; gap: .75rem; align-items: flex-start; font-size: .88rem; color: var(--hmc-text-soft); }
.hmc-checkbox input { margin-top: .28rem; width: 18px; height: 18px; accent-color: var(--hmc-teal); flex: none; }

/* ---------- Quiz ---------- */
.hmc-progress { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.hmc-progress__bar {
    height: 100%; width: 0;
    background: linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%) !important;
    transition: width .35s ease;
}

.hmc-question { display: none; }
.hmc-question.is-active { display: block; animation: hmcFade .35s ease; }
@keyframes hmcFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hmc-choices { display: grid; gap: .75rem; margin-top: 1.4rem; }
.hmc-choice { position: relative; display: block; cursor: pointer; }
.hmc-choice input { position: absolute; opacity: 0; pointer-events: none; }
.hmc-choice__box {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.05rem 1.25rem;
    border: 1px solid var(--hmc-border-strong); border-radius: var(--hmc-radius-sm);
    background: rgba(255, 255, 255, .03);
    transition: all .18s ease;
}
.hmc-choice:hover .hmc-choice__box { border-color: var(--hmc-teal); background: var(--hmc-accent-soft); }
.hmc-choice input:checked + .hmc-choice__box {
    border-color: var(--hmc-teal); background: var(--hmc-accent-soft);
    box-shadow: 0 0 0 3px var(--hmc-primary-ring);
}
.hmc-choice input:focus-visible + .hmc-choice__box { outline: 2px solid var(--hmc-teal); outline-offset: 2px; }
.hmc-choice__marker {
    width: 22px; height: 22px; flex: none; border-radius: 50%;
    border: 2px solid var(--hmc-border-strong); display: grid; place-items: center;
}
.hmc-choice input:checked + .hmc-choice__box .hmc-choice__marker { border-color: var(--hmc-teal); }
.hmc-choice input:checked + .hmc-choice__box .hmc-choice__marker::after {
    content: ''; width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%);
}
.hmc-quiz-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }

/* ---------- Jauge de score ---------- */
.hmc-gauge { display: grid; place-items: center; position: relative; }
.hmc-gauge svg { transform: rotate(-90deg); }
.hmc-gauge__value { position: absolute; text-align: center; }
.hmc-gauge__number { font-size: 3.2rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.hmc-gauge__unit { color: var(--hmc-muted); font-size: .85rem; font-weight: 600; }

/* ---------- Barres de dimension ---------- */
.hmc-bar { margin-bottom: 1.05rem; }
.hmc-bar__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .4rem; font-size: .9rem; }
.hmc-bar__name { font-weight: 600; }
.hmc-bar__score { color: var(--hmc-muted); font-variant-numeric: tabular-nums; }
.hmc-bar__track { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.hmc-bar__fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%) !important;
}

/* ---------- Listes rapport ---------- */
.hmc-priority { display: flex; flex-direction: column; align-items: flex-start; }
.hmc-priority__rank {
    width: 34px; height: 34px; flex: none; border-radius: 12px;
    display: grid; place-items: center; font-weight: 800; font-size: .95rem;
    background: linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%);
    color: #fff;
    margin-bottom: .8rem;
}
.hmc-priority h3 { margin: 0; }
.hmc-priority > * { width: 100%; }
.hmc-priority > .hmc-priority__rank { width: 34px; }

.hmc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.hmc-list li {
    display: flex; gap: .8rem; align-items: flex-start;
    padding: .85rem 1rem; border-radius: var(--hmc-radius-sm);
    background: rgba(255, 255, 255, .035); border: 1px solid var(--hmc-border);
    color: var(--hmc-text-soft); font-size: .93rem;
}
.hmc-list li::before { content: '▸'; color: var(--hmc-teal); font-weight: 700; }
.hmc-list--freins li::before { content: '!'; color: var(--hmc-warning); }

/* ---------- Statistiques admin ---------- */
.hmc-kpi { padding: 1.3rem 1.4rem; }
.hmc-kpi__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--hmc-muted); font-weight: 600; }
.hmc-kpi__value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; margin-top: .35rem; }
.hmc-kpi__delta { font-size: .82rem; font-weight: 600; }
.hmc-kpi__delta--up { color: var(--hmc-green); }
.hmc-kpi__delta--down { color: var(--hmc-danger); }

.hmc-table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.hmc-table th {
    text-align: left; padding: .8rem .9rem; color: var(--hmc-muted);
    font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
    border-bottom: 1px solid var(--hmc-border); white-space: nowrap;
}
.hmc-table th a { color: var(--hmc-muted); }
.hmc-table th a:hover { color: var(--hmc-teal); }
.hmc-table td { padding: .85rem .9rem; border-bottom: 1px solid var(--hmc-border); vertical-align: middle; }
.hmc-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.hmc-table a { color: var(--hmc-text); font-weight: 600; }
.hmc-table a:hover { color: var(--hmc-teal-light); }
.hmc-table-wrap { overflow-x: auto; }

.hmc-score-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 52px; padding: .28rem .6rem; border-radius: 999px;
    font-weight: 700; font-size: .84rem; font-variant-numeric: tabular-nums;
}

/* ---------- Sidebar admin ---------- */
.hmc-admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.hmc-sidebar {
    background: var(--hmc-bg-alt); border-right: 1px solid var(--hmc-border);
    padding: 1.5rem 1.1rem; display: flex; flex-direction: column; gap: 1.6rem;
}
.hmc-nav { display: grid; gap: .3rem; }
.hmc-nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem .9rem; border-radius: var(--hmc-radius-sm);
    color: var(--hmc-text-soft); font-size: .9rem; font-weight: 600; text-decoration: none;
}
.hmc-nav a:hover { background: rgba(255, 255, 255, .05); color: var(--hmc-text); text-decoration: none; }
.hmc-nav a.is-active {
    background: var(--hmc-gradient-soft); color: #fff;
    border: 1px solid rgba(78, 178, 160, .34);
}

.hmc-admin__main { padding: 1.8rem 2rem 4rem; overflow-x: hidden; }

.hmc-filters { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; }
.hmc-filters .hmc-field { margin-bottom: 0; }
.hmc-filters .hmc-input, .hmc-filters .hmc-select { min-width: 170px; padding: .6rem .8rem; font-size: .88rem; }

.hmc-alert {
    padding: .9rem 1.1rem; border-radius: var(--hmc-radius-sm);
    border: 1px solid rgba(117, 193, 109, .35); background: rgba(117, 193, 109, .1);
    color: #C6EBC1; font-size: .9rem; margin-bottom: 1.2rem;
}

.hmc-muted { color: var(--hmc-muted); }
.hmc-small { font-size: .84rem; }
.hmc-mt { margin-top: 1.6rem; }
.hmc-mt-lg { margin-top: 2.6rem; }
.hmc-flex { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.hmc-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hmc-center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hmc-admin { grid-template-columns: 1fr; }
    .hmc-sidebar { flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--hmc-border); }
    .hmc-nav { display: flex; }
    .hmc-admin__main { padding: 1.2rem; }
}
@media (max-width: 640px) {
    .hmc-card { padding: 1.2rem; }
    .hmc-quiz-nav { flex-direction: column-reverse; }
    .hmc-quiz-nav .hmc-btn { width: 100%; }
}

/* ---------- Impression du rapport ---------- */
@media print {
    body { background: #fff; color: #111; }
    body::before, .hmc-no-print { display: none !important; }
    .hmc-card { box-shadow: none; border-color: #ddd; background: #fff; }
    .hmc-shell h1, .hmc-shell h2, .hmc-shell h3, .hmc-shell p, .hmc-list li, .hmc-table td, .hmc-table th { color: #111 !important; }
    .hmc-priority__rank, .hmc-bar__fill {
        background: linear-gradient(to bottom right, #2a6eb4 30%, #4eb2a0 64%, #75c16d 100%) !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
}
