/* ============================================================================
   Aide contextuelle — bouton flottant et panneau latéral.

   Le bouton reste discret : c'est un recours, pas un élément de navigation.
   Le panneau s'ouvre par la droite et ne bloque pas la lecture de la page.
   ============================================================================ */

.aide-trigger {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 850;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}
.aide-trigger:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}
.aide-trigger:focus-visible { outline: var(--focus-ring); }

/* --------------------------------------------------------------- Panneau */

.aide { position: fixed; inset: 0; z-index: 900; }

.aide__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .35);
    animation: aideFade .18s ease-out;
}

.aide__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(430px, 92vw);
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -12px 0 40px -12px rgba(17, 24, 39, .35);
    animation: aideSlide .22s cubic-bezier(.32, .72, 0, 1);
}

@keyframes aideFade  { from { opacity: 0; } }
@keyframes aideSlide { from { transform: translateX(28px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .aide__backdrop, .aide__panel { animation: none; }
    .aide-trigger:hover { transform: none; }
}

.aide__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}
.aide__eyebrow {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.aide__title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 650;
    line-height: 1.25;
}
.aide__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.aide__close:hover { background: var(--color-surface-alt); color: var(--color-text); }
.aide__close:focus-visible { outline: var(--focus-ring); }

.aide__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--space-5);
}

.aide__resume {
    margin: 0 0 var(--space-5);
    font-size: var(--font-size-base);
    line-height: 1.65;
    color: var(--color-text);
}

.aide__points {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.aide__point dt {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-primary);
    margin-bottom: 3px;
}
.aide__point dd {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--color-text);
}

.aide__warn {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--color-warning-light);
    border: 1px solid color-mix(in srgb, var(--color-warning) 35%, transparent);
}
.aide__warn-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #92400e;
    margin-bottom: 4px;
}
.aide__warn p { margin: 0; font-size: var(--font-size-sm); line-height: 1.6; }

.aide__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    font-size: var(--font-size-sm);
}

/* Empêche la page de défiler derrière le panneau. */
body.aide-open { overflow: hidden; }

/* Sur mobile, le bouton laisse la place aux actions principales. */
@media (max-width: 768px) {
    .aide-trigger { right: var(--space-3); bottom: var(--space-3); }
}
