/* ============================================================
   CHARTE GRAPHIQUE AGENTIKA
   Primaire   : OR      #F59E0B (#fbbf24 → #f59e0b → #d97706)
   Secondaire : VIOLET  #7C3AED / #A855F7
   Toutes les couleurs sont regroupées dans le bloc :root.
   ============================================================ */

:root {
    /* ---- Palette de marque ---- */
    --gold:         #F59E0B;
    --gold-1:       #fbbf24;
    --gold-2:       #f59e0b;
    --gold-3:       #d97706;
    --purple:       #7C3AED;
    --purple-light: #A855F7;

    /* ---- Primaire : OR ---- */
    --ag-primary:       var(--gold-2);
    --ag-primary-light: var(--gold-1);
    --ag-primary-dark:  var(--gold-3);
    --ag-primary-soft:  rgba(245, 158, 11, .14);
    --ag-primary-ring:  rgba(245, 158, 11, .28);
    --ag-on-primary:    #1B1205;               /* texte sur fond or */

    /* ---- Secondaire : VIOLET ---- */
    --ag-secondary:      var(--purple);
    --ag-secondary-light: var(--purple-light);
    --ag-secondary-soft: rgba(124, 58, 237, .16);
    --ag-accent:         var(--purple-light);  /* liens, libellés, accents */
    --ag-accent-soft:    rgba(168, 85, 247, .14);

    /* ---- Dégradés ---- */
    --ag-gradient:        linear-gradient(135deg, #fbbf24 0%, #f59e0b 55%, #d97706 100%);
    --ag-gradient-alt:    linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
    --ag-gradient-duo:    linear-gradient(135deg, #f59e0b 0%, #A855F7 100%);
    --ag-gradient-soft:   linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(124, 58, 237, .12));

    /* ---- Fonds ---- */
    --ag-bg:            #08060F;
    --ag-bg-alt:        #0D0A18;
    --ag-surface:       #141020;
    --ag-surface-2:     #1B1630;
    --ag-border:        rgba(255, 255, 255, .08);
    --ag-border-strong: rgba(255, 255, 255, .16);

    /* ---- Sémantique ---- */
    --ag-success:       #32D583;
    --ag-warning:       var(--gold-1);
    --ag-danger:        #F97066;

    /* ---- Texte ---- */
    --ag-text:          #F7F5FF;
    --ag-text-soft:     #C9C4DB;
    --ag-muted:         #928CA8;

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

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

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

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 500px at 12% -10%, rgba(245, 158, 11, .20), transparent 62%),
        radial-gradient(820px 480px at 92% 6%, rgba(124, 58, 237, .22), transparent 62%);
    pointer-events: none;
    z-index: 0;
}

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

a { color: var(--ag-accent); text-decoration: none; }
a:hover { color: var(--ag-primary-light); text-decoration: underline; }

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

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

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

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

/* ---------- Badges & pills ---------- */
.ag-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem .9rem; border-radius: 999px;
    background: var(--ag-primary-soft); border: 1px solid rgba(245, 158, 11, .34);
    color: var(--gold-1); font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em;
}
.ag-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(--ag-border);
}
.ag-badge--dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- Cartes ---------- */
.ag-card {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 1.6rem;
    box-shadow: var(--ag-shadow);
}
.ag-card--glass { background: linear-gradient(180deg, rgba(27, 22, 48, .92), rgba(20, 16, 32, .92)); backdrop-filter: blur(12px); }
.ag-card--accent { border-color: rgba(245, 158, 11, .34); background-image: var(--ag-gradient-soft); }
.ag-card--purple { border-color: rgba(124, 58, 237, .38); background-image: linear-gradient(135deg, rgba(124, 58, 237, .18), rgba(168, 85, 247, .08)); }

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

/* ---------- Boutons ---------- */
.ag-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;
}
.ag-btn:hover { transform: translateY(-2px); text-decoration: none; }

/* Primaire : or, texte sombre pour le contraste */
.ag-btn--primary {
    background: var(--ag-gradient); color: var(--ag-on-primary);
    box-shadow: 0 12px 30px rgba(245, 158, 11, .34);
}
.ag-btn--primary:hover { color: var(--ag-on-primary); box-shadow: 0 16px 38px rgba(245, 158, 11, .44); }

/* Secondaire : violet */
.ag-btn--secondary {
    background: var(--ag-gradient-alt); color: #fff;
    box-shadow: 0 12px 30px rgba(124, 58, 237, .38);
}
.ag-btn--secondary:hover { color: #fff; }

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

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

/* ---------- Quiz ---------- */
.ag-progress { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.ag-progress__bar { height: 100%; width: 0; background: var(--ag-gradient); transition: width .35s ease; }

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

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

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

/* ---------- Barres de dimension ---------- */
.ag-bar { margin-bottom: 1.05rem; }
.ag-bar__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .4rem; font-size: .9rem; }
.ag-bar__name { font-weight: 600; }
.ag-bar__score { color: var(--ag-muted); font-variant-numeric: tabular-nums; }
.ag-bar__track { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.ag-bar__fill { height: 100%; border-radius: 999px; background: var(--ag-gradient); }
.ag-bar__fill--purple { background: var(--ag-gradient-alt); }

/* ---------- Listes rapport ---------- */
.ag-priority { display: flex; flex-direction: column; align-items: flex-start; }
.ag-priority__rank {
    width: 34px; height: 34px; flex: none; border-radius: 12px;
    display: grid; place-items: center; font-weight: 800; font-size: .95rem;
    background: var(--ag-gradient); color: var(--ag-on-primary);
    margin-bottom: .8rem;
}
.ag-priority h3 { margin: 0; }
.ag-priority > * { width: 100%; }
.ag-priority > .ag-priority__rank { width: 34px; }

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

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

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

.ag-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 ---------- */
.ag-admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.ag-sidebar {
    background: var(--ag-bg-alt); border-right: 1px solid var(--ag-border);
    padding: 1.5rem 1.1rem; display: flex; flex-direction: column; gap: 1.6rem;
}
.ag-nav { display: grid; gap: .3rem; }
.ag-nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem .9rem; border-radius: var(--ag-radius-sm);
    color: var(--ag-text-soft); font-size: .9rem; font-weight: 600; text-decoration: none;
}
.ag-nav a:hover { background: rgba(255, 255, 255, .05); color: var(--ag-text); text-decoration: none; }
.ag-nav a.is-active {
    background: var(--ag-primary-soft); color: var(--gold-1);
    border: 1px solid rgba(245, 158, 11, .34);
}

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

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

.ag-alert {
    padding: .9rem 1.1rem; border-radius: var(--ag-radius-sm);
    border: 1px solid rgba(50, 213, 131, .35); background: rgba(50, 213, 131, .1);
    color: #A6F4C5; font-size: .9rem; margin-bottom: 1.2rem;
}

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

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

/* ---------- Impression du rapport ---------- */
@media print {
    body { background: #fff; color: #111; }
    body::before, .ag-no-print { display: none !important; }
    .ag-card { box-shadow: none; border-color: #ddd; background: #fff; }
    h1, h2, h3, p, li, td, th { color: #111 !important; }
    .ag-priority__rank { background: var(--gold-2) !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .ag-bar__fill { background: var(--gold-2) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
