/* =============================================================================
 * vigie — Espace démo : charte UITGuard dark futuriste
 * Palette : cyan #00d9ff / vert #00ff88 / magenta #ff00ff / bg #0a0a0f
 * Aucune ressource externe (pas de @import, pas de CDN).
 * Typo : Inter / Orbitron déjà installées sur le système (font-display: swap),
 * fallback system-ui pour garantir un rendu correct si absentes.
 * ========================================================================== */

:root {
    --bg: #0a0a0f;
    --bg-card: rgba(15, 15, 25, 0.85);
    --bg-card-solid: #0f0f19;
    --bg-input: rgba(0, 0, 0, 0.4);
    --border: rgba(0, 217, 255, 0.25);
    --border-strong: rgba(0, 217, 255, 0.5);
    --primary: #00d9ff;
    --primary-dim: #0099b3;
    --accent: #00ff88;
    --magenta: #ff00ff;
    --warn: #ff8800;
    --warn-bg: rgba(255, 136, 0, 0.08);
    --danger: #ff3355;
    --danger-bg: rgba(255, 51, 85, 0.08);
    --text: #ffffff;
    --text-mute: #b0b0c0;
    --text-faint: #707080;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-pill: 999px;
    --transition: 150ms ease-out;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Orbitron', 'Inter', system-ui, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
}

/* ====== Reset léger ====== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Respecte l'attribut HTML `hidden` partout (les regles `display:` des
   composants l'ecrasent sinon — exemple : .result-error apparaissait avant
   meme l'envoi de la requete). */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { text-decoration: underline; color: var(--accent); }

button { font-family: inherit; }
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px; left: 8px;
    background: var(--primary);
    color: #001018;
    padding: 0.5rem 1rem;
    z-index: 1000;
    font-weight: 600;
    border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; text-decoration: none; }

/* ====== Header ====== */
.page-header {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1rem 2rem;
    background: rgba(5, 5, 8, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 50;
}
.brand {
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--text);
    letter-spacing: 0.05em;
    text-transform: lowercase;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--text); }
.brand-mark.accent { color: var(--primary); }
.product {
    color: var(--text-mute);
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}
.user-tag {
    margin-left: auto;
    color: var(--text-mute);
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 217, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
}

/* ====== Nav démo ====== */
.demo-nav {
    display: flex; gap: 1.5rem;
    padding: 0.6rem 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    font-size: 0.95rem;
}
.demo-nav a {
    padding: 0.3rem 0.6rem;
    color: var(--text-mute);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}
.demo-nav a:hover { color: var(--text); text-decoration: none; }
.demo-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.demo-nav a.logout { margin-left: auto; color: var(--text-faint); }
.demo-nav a.logout:hover { color: var(--danger); }

/* ====== Container ====== */
.container {
    flex: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    width: 100%;
}

/* ====== Footer ====== */
.page-footer {
    padding: 1.5rem 1.5rem 2rem;
    text-align: center;
    color: var(--text-mute);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
}
.page-footer .footer-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.page-footer .sep { color: var(--text-faint); }
.page-footer .rgpd-foot { margin: 0.6rem 0 0; color: var(--text-faint); font-size: 0.8rem; }

/* =============================================================================
 * AUTH PAGE
 * ========================================================================== */
.auth-wrapper { display: flex; justify-content: center; padding-top: 2rem; }
.auth-card {
    width: 100%; max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
}
.auth-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin: 0 0 0.5rem;
    color: var(--text);
}
.auth-header .accent { color: var(--primary); }
.auth-header .lead {
    color: var(--text-mute);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ====== Form fields ====== */
.field { margin-bottom: 1.2rem; }
.field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    color: var(--text);
}
.field .required { color: var(--magenta); margin-left: 2px; }
.field input,
.field textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.18);
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 51, 85, 0.18);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input[type="text"]#code { font-family: var(--font-mono); letter-spacing: 0.1em; }
.field .hint {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-faint);
    font-size: 0.82rem;
}
.field .error {
    display: block;
    margin-top: 0.3rem;
    color: var(--danger);
    font-size: 0.82rem;
}

/* ====== Buttons ====== */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    text-decoration: none;
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #001018;
    width: 100%;
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.35);
    text-decoration: none;
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-secondary:hover { background: rgba(0, 255, 136, 0.1); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--text-mute);
    border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
    background: #ff4466;
    box-shadow: 0 4px 16px rgba(255, 51, 85, 0.35);
    text-decoration: none;
}

/* ====== Spinner inline (boutons) ====== */
/* Respecte l'attribut HTML `hidden` (le CSS `display:inline-block` l'ecrase
   sinon) : le spinner ne tourne QUE quand le JS retire `hidden`. */
.btn-spinner[hidden] { display: none !important; }
.btn-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== Info / RGPD message ====== */
.info-message {
    display: flex; gap: 0.6rem; align-items: flex-start;
    background: var(--warn-bg);
    border: 1px solid rgba(255, 136, 0, 0.3);
    color: var(--text);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}
.info-message .info-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--warn);
    color: #1a0d00;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.rgpd-note {
    margin-top: 1.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 217, 255, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--text-mute);
    line-height: 1.55;
}
.rgpd-note strong { color: var(--primary); }
.footer-note {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-mute);
}
.footer-note .sep { margin: 0 0.4rem; color: var(--text-faint); }

/* =============================================================================
 * QUOTA BANNER (TICKET-025)
 * ========================================================================== */
.quota-banner {
    margin: 0 0 1.5rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 217, 255, 0.04);
    color: var(--text);
    font-size: 0.92rem;
    transition: background var(--transition), border-color var(--transition);
}
.quota-banner-inner {
    display: flex; align-items: center; gap: 0.7rem;
    flex-wrap: wrap;
}
.quota-banner .quota-icon {
    display: inline-flex; color: currentColor; flex-shrink: 0;
}
.quota-banner .quota-text { flex: 1; min-width: 0; }
.quota-banner strong { font-weight: 700; }
.quota-banner .quota-sep { color: var(--text-faint); margin: 0 0.5rem; }
.quota-banner .quota-refresh {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-mute);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex; align-items: center;
    transition: color var(--transition), border-color var(--transition);
}
.quota-banner .quota-refresh:hover { color: var(--text); border-color: var(--border-strong); }

.quota-banner.quota-loading { color: var(--text-faint); border-color: rgba(255,255,255,0.08); }
.quota-banner.quota-ok {
    background: rgba(0, 255, 136, 0.06);
    border-color: rgba(0, 255, 136, 0.35);
    color: var(--accent);
}
.quota-banner.quota-warn {
    background: var(--warn-bg);
    border-color: rgba(255, 136, 0, 0.4);
    color: var(--warn);
}
.quota-banner.quota-danger {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
    animation: pulse-danger 2s ease-in-out infinite;
}
@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 51, 85, 0); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 51, 85, 0.25); }
}

/* =============================================================================
 * PAGE INTRO
 * ========================================================================== */
.page-intro h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin: 0 0 0.5rem;
    color: var(--text);
}
.page-intro .lead {
    color: var(--text);
    margin: 0 0 0.5rem;
    font-size: 1rem;
}
.page-intro .muted, .muted {
    color: var(--text-mute);
    font-size: 0.9rem;
}
.page-intro code, code {
    background: rgba(255,255,255,0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--primary);
}

/* =============================================================================
 * AXES PAGE
 * ========================================================================== */
.axes-toolbar {
    display: flex; align-items: center; gap: 1rem;
    margin: 1.5rem 0 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.axes-toolbar .counter {
    display: inline-flex; align-items: baseline; gap: 0.2rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--primary);
    flex: 1;
}
.axes-toolbar .counter-sep { color: var(--text-faint); }
.axes-toolbar .counter-max { color: var(--text-mute); font-size: 1.1rem; }
.axes-toolbar .counter-label {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-mute);
    margin-left: 0.5rem;
}
.axes-toolbar .btn-primary { width: auto; padding: 0.6rem 1.2rem; }

.axes-list-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    overflow: hidden;
}
.axes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.axes-table thead th {
    text-align: left;
    padding: 0.7rem 1rem;
    background: rgba(0, 217, 255, 0.05);
    color: var(--text-mute);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.axes-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.axes-table tbody tr:last-child td { border-bottom: none; }
.axes-table tbody tr:hover { background: rgba(0, 217, 255, 0.04); }
.axes-table .col-position { width: 50px; color: var(--text-faint); }
.axes-table .col-code { width: 18%; }
.axes-table .col-code code { font-size: 0.85rem; }
.axes-table .col-label { width: 22%; font-weight: 500; }
.axes-table .col-desc { color: var(--text-mute); font-size: 0.88rem; }
.axes-table .col-status { width: 80px; }
.axes-table .col-actions { width: 140px; text-align: right; white-space: nowrap; }
.axes-table .badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.axes-table .badge-active { background: rgba(0, 255, 136, 0.15); color: var(--accent); }
.axes-table .badge-inactive { background: rgba(255, 255, 255, 0.08); color: var(--text-faint); }
.axes-table .row-action {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-mute);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    margin-left: 0.4rem;
    transition: color var(--transition), border-color var(--transition);
}
.axes-table .row-action:hover { color: var(--text); border-color: var(--border-strong); }
.axes-table .row-action.danger:hover { color: var(--danger); border-color: var(--danger); }

.empty-state, .loading-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-mute);
}
.loading-state { display: flex; justify-content: center; align-items: center; gap: 0.6rem; }
.spinner {
    width: 18px; height: 18px;
    border: 2px solid var(--text-faint);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.cta-test {
    margin-top: 2rem;
    padding: 1.2rem 1.5rem;
    background: rgba(0, 255, 136, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: var(--radius);
    display: flex; align-items: center; gap: 1rem;
    flex-wrap: wrap;
}
.cta-test p { margin: 0; flex: 1; }

/* =============================================================================
 * MODALES
 * ========================================================================== */
.modal {
    position: fixed; inset: 0;
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    animation: fade-in 150ms ease-out;
}
.modal-content {
    position: relative;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%; max-width: 520px;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    animation: slide-up 200ms ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.3rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text);
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-mute);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.modal-body { padding: 1.3rem; }
.modal-body p { margin: 0 0 0.6rem; }
.modal-content form { padding: 1.3rem; }
.modal-footer {
    display: flex; gap: 0.6rem; justify-content: flex-end;
    padding: 1rem 1.3rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}
.modal-footer .btn-primary, .modal-footer .btn-danger { width: auto; }

/* =============================================================================
 * TEST PAGE
 * ========================================================================== */
.playground {
    margin-top: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}
.playground textarea { min-height: 140px; font-size: 0.95rem; }
.textarea-meta {
    display: flex; justify-content: flex-end;
    margin-top: 0.3rem;
}
.actions {
    display: flex; flex-wrap: wrap; gap: 0.7rem;
    margin-top: 1rem;
}
.actions .btn-primary { width: auto; padding: 0.6rem 1.5rem; }

/* ====== Résultat ====== */
.result {
    margin-top: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    animation: fade-in 200ms ease-out;
}
.result h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0 0 1rem;
    color: var(--primary);
}
.result-meta {
    display: flex; gap: 1.5rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}
.result-meta .meta-item { display: flex; flex-direction: column; gap: 0.1rem; }
.result-meta .meta-label {
    color: var(--text-faint);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.result-meta .meta-value { color: var(--text); font-weight: 500; }
.result-meta code { color: var(--text-mute); font-size: 0.82rem; }

.result-table {
    width: 100%;
    border-collapse: collapse;
}
.result-table thead th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    color: var(--text-mute);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.result-table tbody td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.result-table tbody tr:last-child td { border-bottom: none; }
.result-table .col-axis { width: 40%; }
.result-table .col-score { width: 80px; }
.result-table .col-axis .axis-label { font-weight: 500; color: var(--text); }
.result-table .col-axis .axis-code {
    color: var(--text-faint);
    font-size: 0.78rem;
    margin-left: 0.4rem;
    font-family: var(--font-mono);
}
.result-table .col-axis .axis-code::before { content: '('; }
.result-table .col-axis .axis-code::after  { content: ')'; }
/* Si le code est strictement identique au label, on masque le code parenthèse */
.result-table .col-axis .axis-code[data-same="true"] { display: none; }
.result-table .score-value {
    display: inline-block;
    min-width: 30px;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 700;
}

/* ====== Barres de scores 0-5 (vert → magenta) ====== */
.score-bar {
    display: flex; gap: 3px;
    align-items: center;
}
.score-bar .cell {
    width: 26px; height: 14px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    transition: background var(--transition);
}
.score-bar .cell.on.level-0 { background: var(--accent); }
.score-bar .cell.on.level-1 { background: var(--accent); }
.score-bar .cell.on.level-2 { background: #88dd44; }
.score-bar .cell.on.level-3 { background: #ffcc00; }
.score-bar .cell.on.level-4 { background: var(--warn); }
.score-bar .cell.on.level-5 { background: var(--magenta); box-shadow: 0 0 8px rgba(255, 0, 255, 0.5); }

.score-value.level-0,
.score-value.level-1 { background: rgba(0, 255, 136, 0.18); color: var(--accent); }
.score-value.level-2 { background: rgba(136, 221, 68, 0.18); color: #b7e87a; }
.score-value.level-3 { background: rgba(255, 204, 0, 0.18); color: #ffcc00; }
.score-value.level-4 { background: rgba(255, 136, 0, 0.18); color: var(--warn); }
.score-value.level-5 { background: rgba(255, 0, 255, 0.18); color: var(--magenta); }

/* ====== Erreur d'analyse ====== */
.result-error {
    display: flex; gap: 0.8rem; align-items: flex-start;
    margin-top: 2rem;
    padding: 1rem 1.2rem;
    background: var(--danger-bg);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    color: var(--text);
}
.result-error .error-icon {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem;
}
.result-error strong { display: block; margin-bottom: 0.2rem; }

/* =============================================================================
 * TOAST
 * ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    z-index: 200;
    pointer-events: none;
}
.toast {
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    box-shadow: var(--shadow-card);
    animation: slide-in-right 200ms ease-out;
    pointer-events: auto;
    max-width: 320px;
}
.toast.toast-success { border-color: var(--accent); }
.toast.toast-error { border-color: var(--danger); }
.toast.toast-warn { border-color: var(--warn); }
@keyframes slide-in-right {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* =============================================================================
 * END STATES (quota-exhausted / code-expired / client-disabled)
 * ========================================================================== */
.end-state {
    display: flex; justify-content: center;
    padding-top: 2rem;
}
.end-card {
    width: 100%; max-width: 540px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.end-icon {
    display: inline-flex;
    width: 96px; height: 96px;
    border-radius: 50%;
    align-items: center; justify-content: center;
    margin-bottom: 1.2rem;
    background: rgba(0, 217, 255, 0.05);
    border: 2px solid var(--border-strong);
}
.end-icon-quota { color: var(--warn); border-color: rgba(255, 136, 0, 0.4); background: var(--warn-bg); }
.end-icon-expired { color: var(--magenta); border-color: rgba(255, 0, 255, 0.4); background: rgba(255, 0, 255, 0.05); }
.end-icon-disabled { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.end-card h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    margin: 0 0 0.5rem;
}
.end-card .lead { color: var(--text); font-size: 1rem; margin: 0 0 1rem; }
.end-card p { color: var(--text-mute); line-height: 1.6; margin: 0 0 1rem; }
.end-actions {
    display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center;
    margin: 1.5rem 0 0.5rem;
}
.end-actions .btn-primary { width: auto; padding: 0.7rem 1.5rem; }
.rgpd-foot-card { margin-top: 1.5rem; text-align: left; }

/* =============================================================================
 * RESPONSIVE
 * ========================================================================== */
@media (max-width: 720px) {
    .page-header { padding: 0.8rem 1rem; gap: 0.7rem; }
    .product { display: none; }
    .demo-nav { padding: 0.6rem 1rem; gap: 0.7rem; font-size: 0.88rem; }
    .container { padding: 1.5rem 1rem 2rem; }
    .auth-card, .end-card { padding: 1.5rem; }
    .auth-header h1, .end-card h1, .page-intro h1 { font-size: 1.4rem; }

    .axes-table thead { display: none; }
    .axes-table tbody, .axes-table tr, .axes-table td { display: block; width: 100%; }
    .axes-table tr {
        margin-bottom: 0.8rem;
        background: rgba(0, 0, 0, 0.2);
        padding: 0.5rem;
        border-radius: var(--radius-sm);
    }
    .axes-table td { border: none; padding: 0.3rem 0.5rem; }
    .axes-table td::before {
        content: attr(data-label);
        display: inline-block;
        width: 5.5rem;
        font-size: 0.72rem;
        color: var(--text-faint);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .axes-table .col-actions { text-align: left; }

    .result-meta { gap: 0.8rem; }
    .actions { flex-direction: column; align-items: stretch; }
    .actions .btn-primary, .actions .btn-ghost { width: 100%; }

    .toast-container { right: 0.7rem; bottom: 0.7rem; left: 0.7rem; }
    .toast { max-width: none; }
}

/* =============================================================================
 * REDUCED MOTION (accessibilité)
 * ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .quota-banner.quota-danger { animation: none; }
}

/* =============================================================================
 * Ajouts UX (texte explicatif axes + chips exemples test)
 * ========================================================================== */

.info-box {
    margin: 1.5rem 0 2rem;
    padding: 1.2rem 1.4rem;
    background: rgba(0, 217, 255, 0.04);
    border: 1px solid rgba(0, 217, 255, 0.18);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text);
}
.info-box h2 {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--primary);
    letter-spacing: 0.04em;
}
.info-box ol { margin: 0 0 0.6rem 1.2rem; padding: 0; }
.info-box li { margin: 0.4rem 0; line-height: 1.5; color: var(--text-mute); }
.info-box li strong { color: var(--text); }
.info-box code { background: rgba(255,255,255,0.05); padding: 0 0.3rem; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.85em; }
.info-tip {
    margin: 0.8rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
    color: var(--text-mute);
    font-size: 0.9rem;
}

.toolbar-actions { display: flex; gap: 0.6rem; align-items: center; }

.samples {
    margin: 1.2rem 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.sample-chip {
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}
.sample-chip:hover {
    background: rgba(0, 217, 255, 0.12);
    border-color: var(--border-strong);
    color: var(--primary);
    transform: translateY(-1px);
}
.sample-chip:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =============================================================================
 * INTÉGRATION — onglets langage + snippets de code + patterns
 * ========================================================================== */
.integration-snippets { margin: 1.5rem 0 2rem; }
.integration-snippets > h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0 0 0.8rem;
}

.lang-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.8rem;
}
.lang-tab {
    background: rgba(0, 217, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.lang-tab:hover { background: rgba(0, 217, 255, 0.15); }
.lang-tab[aria-selected="true"] {
    background: rgba(0, 217, 255, 0.25);
    border-color: var(--primary);
    color: var(--primary);
}
.lang-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.code-block { position: relative; margin: 0 0 1.5rem; }
.code-block pre {
    background: #050508;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    color: #e0e0e8;
    margin: 0;
}
.code-block code { font-family: inherit; color: inherit; background: transparent; padding: 0; }
.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 217, 255, 0.12);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.code-copy-btn:hover { background: rgba(0, 217, 255, 0.25); }
.code-copy-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.endpoint-doc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    margin: 1.5rem 0;
}
.endpoint-doc h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 0.8rem;
    color: var(--primary);
}
.endpoint-doc p { margin: 0.4rem 0; }
.endpoint-doc pre {
    background: #050508;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #e0e0e8;
    margin: 0.4rem 0 1rem;
}
.endpoint-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.6rem;
}
.endpoint-doc th, .endpoint-doc td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}
.endpoint-doc th {
    color: var(--text-mute);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.endpoint-doc code {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--primary);
}

.patterns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}
.pattern-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.pattern-card h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin: 0 0 0.6rem;
    color: var(--primary);
}
.pattern-card pre {
    background: #050508;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    overflow-x: auto;
    color: #b0b0c0;
    margin: 0;
}
.pattern-card .pattern-use {
    margin: 0.6rem 0 0;
    color: var(--text-mute);
    font-size: 0.82rem;
}


/* =============================================================================
 * Modes de déploiement (cards SaaS vs on-premise) — page Mise en œuvre
 * ========================================================================== */

.deployment-modes { margin: 2rem 0 2.5rem; }
.deployment-modes > h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text);
    margin: 0 0 1rem;
}

.deployment-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
    margin: 1rem 0 1.5rem;
}

.deployment-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform var(--transition), border-color var(--transition);
}
.deployment-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.deployment-card header { display: flex; flex-direction: column; gap: 0.4rem; }
.deployment-card h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin: 0;
    color: var(--primary);
}

.deployment-card.deployment-onprem { border-left: 3px solid var(--accent); }
.deployment-card.deployment-onprem h3 { color: var(--accent); }
.deployment-card.deployment-saas    { border-left: 3px solid var(--primary); }

.deployment-badge {
    display: inline-block;
    align-self: flex-start;
    background: rgba(0, 217, 255, 0.18);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.deployment-badge-alt {
    background: rgba(0, 255, 136, 0.18);
    color: var(--accent);
}

.deployment-card p {
    margin: 0;
    color: var(--text-mute);
    font-size: 0.92rem;
    line-height: 1.55;
}

.deployment-features {
    list-style: none;
    margin: 0.3rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text);
    font-size: 0.88rem;
}

.deployment-use {
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
    color: var(--text-mute);
    font-size: 0.88rem;
}

.deployment-hybrid {
    margin: 1.5rem 0 0;
}
.deployment-hybrid h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--magenta);
}
.deployment-hybrid p { font-size: 0.88rem; color: var(--text-mute); margin: 0; line-height: 1.55; }

/* =============================================================================
 * Page Exemple en direct (demo-integration-example)
 * ========================================================================== */

.example-section { margin: 2rem 0; }
.example-section > h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--primary);
    margin: 0 0 0.6rem;
}

/* Sliders de seuil */
.thresholds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.threshold-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem 1rem;
}
.threshold-item label { display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.4rem; }
.threshold-item label code { color: var(--text-faint); font-size: 0.78rem; font-family: var(--font-mono); }
.threshold-row { display: flex; align-items: center; gap: 0.6rem; }
.threshold-slider { flex: 1; accent-color: var(--primary); cursor: pointer; }
.threshold-value {
    min-width: 1.5rem;
    text-align: center;
    font-family: var(--font-mono);
    color: var(--primary);
    font-weight: 700;
}

/* Formulaire simulé (style « blog post ») */
.simulated-form {
    background: var(--bg-card);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 1.5rem 1.8rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-card);
}
.simulated-form h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: var(--text);
}
.simulated-form .field { margin-bottom: 1rem; }
.simulated-form .actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }

.example-samples {
    display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
    margin: 0.6rem 0 1rem;
}

/* Résultats */
.result-success, .result-rejected {
    display: flex; gap: 0.9rem; align-items: flex-start;
    margin: 1rem 0;
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    border-left: 4px solid;
}
.result-success {
    background: rgba(0, 255, 136, 0.08);
    border-color: var(--accent);
    color: var(--text);
}
.result-rejected {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--text);
}
.success-icon, .error-icon {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.success-icon { background: var(--accent); color: #001008; }
.error-icon   { background: var(--danger); color: #fff; }

.result-success strong, .result-rejected strong { display: block; margin-bottom: 0.2rem; font-size: 0.98rem; }
.result-success .muted, .result-rejected .muted { font-size: 0.85rem; margin: 0.3rem 0; }
.rejected-tech-note { margin-top: 0.6rem !important; font-size: 0.78rem !important; opacity: 0.8; }

.score-detail { margin-top: 0.6rem; }
.score-list { list-style: none; padding: 0; margin: 0.4rem 0; display: flex; flex-direction: column; gap: 0.3rem; }
.score-line {
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    gap: 0.6rem;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.score-line.ok { border-left: 3px solid var(--accent); }
.score-line.faulty { border-left: 3px solid var(--danger); }
.score-axis { font-weight: 600; }
.score-value-mini { font-family: var(--font-mono); color: var(--primary); }
.score-threshold { font-family: var(--font-mono); color: var(--text-mute); font-size: 0.8rem; }
.score-status { text-align: right; font-size: 0.82rem; }
.score-line.ok .score-status { color: var(--accent); }
.score-line.faulty .score-status { color: var(--danger); }

/* Zone détail API (developer) */
.api-detail-expandable { margin: 1rem 0; }
.api-detail-expandable summary {
    cursor: pointer;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    font-weight: 500;
}
.api-detail-expandable summary:hover { background: rgba(0, 217, 255, 0.08); }
.api-detail-content { padding: 1rem 0 0; }
.api-detail-content h4 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-mute);
    margin: 0.8rem 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.api-detail-content pre { background: #050508; border: 1px solid var(--border); border-radius: var(--radius-sm);
                          padding: 0.9rem; overflow-x: auto; font-family: var(--font-mono);
                          font-size: 0.78rem; line-height: 1.5; color: #e0e0e8; margin: 0; }

.example-cta { border-left: 3px solid var(--primary); }
.example-cta h3 { margin: 0 0 0.4rem; color: var(--primary); font-family: var(--font-display); font-size: 1rem; }
