/**
 * Jetons de design communs — espace référent (shell, pages auth, Tailwind arbitrary).
 * Chemin relatif depuis les pages sous referent/ : includes/referent_design_tokens.css
 */
:root {
    --ref-forest: #1b3022;
    --ref-forest-mid: #1f3828;
    --ref-forest-soft: #243d2d;
    --ref-accent: #4b7c5a;
    --ref-accent-hover: #5d9070;
    --ref-accent-muted: rgba(91, 142, 108, 0.35);
    --ref-accent-dark: #3d6b4c;
    --ref-page-bg: #f8f9f8;
    --ref-login-bg: #f8f9f8;
    --ref-subnav-bg: #e8ebe9;
    --ref-card-bg: #ffffff;
    --ref-text: #1a1f1c;
    --ref-text-muted: rgba(26, 31, 28, 0.65);
    /* alias sémantique (textes d’aide courts) */
    --ref-text-65: rgba(26, 31, 28, 0.65);
    --ref-text-90: rgba(26, 31, 28, 0.9);
    --ref-text-80: rgba(26, 31, 28, 0.8);
    --ref-text-70: rgba(26, 31, 28, 0.7);
    --ref-text-75: rgba(26, 31, 28, 0.75);
    --ref-text-60: rgba(26, 31, 28, 0.6);
    --ref-text-55: rgba(26, 31, 28, 0.55);
    --ref-text-50: rgba(26, 31, 28, 0.5);
    --ref-text-45: rgba(26, 31, 28, 0.45);
    --ref-text-40: rgba(26, 31, 28, 0.4);
    --ref-accent-05: rgba(75, 124, 90, 0.05);
    --ref-accent-10: rgba(75, 124, 90, 0.1);
    --ref-accent-12: rgba(75, 124, 90, 0.12);
    --ref-accent-15: rgba(75, 124, 90, 0.15);
    --ref-accent-20: rgba(75, 124, 90, 0.2);
    --ref-accent-25: rgba(75, 124, 90, 0.25);
    --ref-accent-ring: rgba(75, 124, 90, 0.3);
    --ref-border-soft: rgba(27, 48, 34, 0.1);
    --ref-subnav-bg-hover: #dde3df;
    --ref-radius-lg: 1rem;
    --ref-radius-md: 0.75rem;
    --ref-sidebar-item-radius: 0.8125rem;
    --ref-success-text: #3d523f;
}

.referent-gradient {
    background: linear-gradient(135deg, var(--ref-accent) 0%, var(--ref-accent-dark) 100%);
}

.referent-auth-body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--ref-login-bg);
    color: var(--ref-text);
    margin: 0;
}

.referent-auth-card {
    background: var(--ref-card-bg);
    border-radius: var(--ref-radius-lg);
    box-shadow: 0 4px 12px rgba(27, 48, 34, 0.08);
}

/* Cartes pages auth / démo (aligné shell) */
.referent-card {
    background: var(--ref-card-bg);
    border-radius: var(--ref-radius-lg);
    box-shadow: 0 4px 12px rgba(27, 48, 34, 0.08);
}

.font-heading {
    font-family: 'Lexend', sans-serif;
}

/**
 * Ligne éditoriale & micro-interactions — espace référent uniquement
 * (lié à referent_design_tokens.css, pas au site public vitrine.)
 */
:root {
    --ref-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ref-duration: 0.22s;
    --ref-shadow-lift: 0 10px 28px rgba(27, 48, 34, 0.1);
}

@media (prefers-reduced-motion: reduce) {
    .referent-card.referent-section,
    .referent-faq-item summary::after,
    .referent-photo-frame img,
    .referent-link-rich,
    .referent-btn-lift {
        transition: none !important;
    }
    .referent-photo-frame:hover img {
        transform: none !important;
    }
}

/* Sections dashboard : léger relief au survol */
@media (prefers-reduced-motion: no-preference) {
    .referent-card.referent-section {
        transition: box-shadow var(--ref-duration) var(--ref-ease), transform var(--ref-duration) var(--ref-ease), border-color var(--ref-duration) var(--ref-ease);
    }
    .referent-card.referent-section:hover {
        box-shadow: var(--ref-shadow-lift);
        transform: translateY(-2px);
        border-color: rgba(27, 48, 34, 0.1);
    }
}

/* Liens : soulignement progressif (couleur accent) */
.referent-link-rich {
    color: var(--ref-accent-dark);
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: color var(--ref-duration) var(--ref-ease), background-size var(--ref-duration) var(--ref-ease);
}
.referent-link-rich:hover {
    color: var(--ref-accent);
    background-size: 100% 2px;
}

/* Bouton gradient principal */
.referent-btn-lift {
    transition: transform var(--ref-duration) var(--ref-ease), box-shadow var(--ref-duration) var(--ref-ease), opacity var(--ref-duration) var(--ref-ease);
}
.referent-btn-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(61, 107, 76, 0.35);
}
.referent-btn-lift:active {
    transform: translateY(0);
}

/* Grille photos (page FAQ portail) */
.referent-photo-strip {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .referent-photo-strip {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.125rem;
    }
}
.referent-photo-frame {
    border-radius: var(--ref-radius-lg);
    overflow: hidden;
    border: 1px solid var(--ref-border-soft);
    background: var(--ref-subnav-bg);
    box-shadow: 0 2px 10px rgba(27, 48, 34, 0.06);
    transition: box-shadow var(--ref-duration) var(--ref-ease), transform var(--ref-duration) var(--ref-ease);
}
.referent-photo-frame:hover {
    box-shadow: var(--ref-shadow-lift);
    transform: translateY(-3px);
}
.referent-photo-frame img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ref-ease);
}
@media (min-width: 640px) {
    .referent-photo-frame img {
        height: 200px;
    }
}
.referent-photo-frame:hover img {
    transform: scale(1.04);
}
.referent-photo-caption {
    padding: 0.65rem 0.85rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--ref-text-70);
    background: var(--ref-card-bg);
    border-top: 1px solid var(--ref-border-soft);
}

/* FAQ portail : recherche, pastilles, accordéons */
.referent-faq-toolbar {
    position: sticky;
    top: 4.75rem;
    z-index: 20;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, var(--ref-page-bg) 72%, rgba(248, 249, 248, 0.92) 100%);
}
.referent-faq-search-wrap {
    position: relative;
    max-width: 26rem;
    margin: 0 auto 0.85rem;
}
.referent-faq-search-wrap svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.05rem;
    height: 1.05rem;
    color: var(--ref-text-50);
    pointer-events: none;
}
.referent-faq-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem 0.65rem 2.4rem;
    border-radius: var(--ref-radius-md);
    border: 1px solid var(--ref-border-soft);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--ref-card-bg);
    color: var(--ref-text);
    transition: border-color var(--ref-duration) var(--ref-ease), box-shadow var(--ref-duration) var(--ref-ease);
}
.referent-faq-search:focus {
    outline: none;
    border-color: var(--ref-accent);
    box-shadow: 0 0 0 3px var(--ref-accent-ring);
}
.referent-faq-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}
.referent-faq-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ref-text-80);
    background: var(--ref-card-bg);
    border: 1px solid var(--ref-border-soft);
    text-decoration: none;
    transition: background var(--ref-duration) var(--ref-ease), border-color var(--ref-duration) var(--ref-ease), transform var(--ref-duration) var(--ref-ease);
}
.referent-faq-pill:hover {
    background: var(--ref-accent-05);
    border-color: var(--ref-accent-20);
    color: var(--ref-text);
    transform: translateY(-1px);
}
.referent-faq-pill:focus-visible {
    outline: 2px solid var(--ref-accent);
    outline-offset: 2px;
}

.referent-faq-section-title {
    scroll-margin-top: 6rem;
    font-family: 'Lexend', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ref-text);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--ref-accent-15);
}
.referent-faq-section-title:first-of-type {
    margin-top: 0;
}

.referent-faq-item {
    border: 1px solid var(--ref-border-soft);
    border-radius: var(--ref-radius-md);
    margin-bottom: 0.5rem;
    background: var(--ref-card-bg);
    overflow: hidden;
    transition: border-color var(--ref-duration) var(--ref-ease), box-shadow var(--ref-duration) var(--ref-ease);
}
.referent-faq-item:hover {
    border-color: rgba(27, 48, 34, 0.14);
}
.referent-faq-item[open] {
    border-color: var(--ref-accent-25);
    box-shadow: 0 2px 10px rgba(27, 48, 34, 0.06);
}
.referent-faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    padding-right: 2.35rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ref-text);
    position: relative;
    user-select: none;
}
.referent-faq-item summary::-webkit-details-marker {
    display: none;
}
.referent-faq-item summary::after {
    content: "";
    position: absolute;
    right: 0.95rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--ref-text-50);
    border-bottom: 2px solid var(--ref-text-50);
    transform: translateY(-60%) rotate(45deg);
    transition: transform var(--ref-duration) var(--ref-ease);
}
.referent-faq-item[open] summary::after {
    transform: translateY(-25%) rotate(-135deg);
}
.referent-faq-item summary:hover {
    background: var(--ref-accent-05);
}
.referent-faq-answer {
    padding: 0 1rem 0.9rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--ref-text-70);
    border-top: 1px solid var(--ref-accent-05);
}
.referent-faq-answer a {
    color: var(--ref-accent-dark);
    font-weight: 600;
}
.referent-faq-answer a:hover {
    text-decoration: underline;
}

.referent-faq-hidden {
    display: none !important;
}

/* Tableau de bord — blocs réorganisables (accueil) */
#referent-dashboard-blocks {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.referent-dash-block {
    position: relative;
}
.referent-dash-drag-handle {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.5rem;
    margin: 0;
    border: 1px solid var(--ref-accent-20);
    border-radius: var(--ref-radius-md);
    background: var(--ref-card-bg);
    color: var(--ref-text-55);
    cursor: grab;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(27, 48, 34, 0.08);
    transition: background var(--ref-duration) var(--ref-ease), color var(--ref-duration) var(--ref-ease), border-color var(--ref-duration) var(--ref-ease);
}
.referent-dash-drag-label {
    white-space: nowrap;
}
.referent-dash-drag-handle:hover {
    background: var(--ref-accent-05);
    color: var(--ref-accent-dark);
    border-color: var(--ref-accent-25);
}
.referent-dash-drag-handle:active {
    cursor: grabbing;
}
.referent-dash-block--dragging {
    opacity: 0.55;
}
.referent-dash-block--drop-target {
    outline: 2px dashed var(--ref-accent);
    outline-offset: 4px;
    border-radius: var(--ref-radius-lg);
}
.referent-dash-sort-hint {
    margin: 0 0 0.25rem 0;
}
.referent-dash-sort-reset {
    font-size: 0.75rem;
    color: var(--ref-accent-dark);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 0 0.5rem;
    font-family: inherit;
}
.referent-dash-sort-reset:hover {
    color: var(--ref-forest);
}
