/* ============================================================ */
/* Page Chronologie V3 - rendu des zones d'apercu (copie V3)    */
/* ============================================================ */

/* ---- Jetons V3 (portee : zones d'apercu) ---- */
.apercu-outil {
    --v3-surface-creux: #141a21;
    --v3-surface-fond: #11161c;
    --v3-surface-carte: #1a2129;
    --v3-surface-elevee: #222a34;
    --v3-surface-overlay: #2a3440;
    --v3-accent: #9ab8f7;
    --v3-accent-rgb: 154, 184, 247;
    --v3-accent-fort: #c9d8ff;
    --v3-succes-rgb: 116, 183, 141;
    --v3-texte: #e9eef6;
    --v3-muted: #a4afbf;
    --v3-lumiere-haute: rgba(255, 255, 255, 0.12);
    --v3-lumiere-basse: rgba(255, 255, 255, 0.08);
    --v3-bordure-douce: rgba(255, 255, 255, 0.08);
    --v3-ombre-carte: 0 6px 14px -10px rgba(0, 0, 0, 0.35);
    --v3-ombre-creux: inset 2px 2px 4px rgba(0, 0, 0, 0.28), inset -1px -1px 0 var(--v3-lumiere-basse);
    --v3-ombre-relief: inset 0 1px 0 var(--v3-lumiere-haute), 0 1px 0 rgba(0, 0, 0, 0.25);
    --v3-degrade-relief: linear-gradient(180deg, var(--v3-surface-elevee), var(--v3-surface-carte));
    --v3-degrade-relief-survol: linear-gradient(180deg, var(--v3-surface-overlay), var(--v3-surface-elevee));
    --v3-degrade-relief-bleu: linear-gradient(180deg, #3f5f9e, #2f4a7d);
    --v3-degrade-relief-bleu-survol: linear-gradient(180deg, #4a6aa8, #3d5a8f);
    --v3-surface-bleu-creux: #263d68;
    --v3-radius: 0.1875rem;
    --v3-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    --v3-espace-xxs: clamp(0.15rem, 0.13rem + 0.1vw, 0.25rem);
    --v3-espace-xs: clamp(0.3rem, 0.27rem + 0.15vw, 0.5rem);
    --v3-espace-sm: clamp(0.5rem, 0.45rem + 0.25vw, 0.7rem);
    --v3-espace-md: clamp(0.7rem, 0.62rem + 0.35vw, 0.95rem);
    --v3-espace-lg: clamp(0.9rem, 0.78rem + 0.5vw, 1.3rem);
    --v3-texte-xs: clamp(0.68rem, 0.66rem + 0.1vw, 0.75rem);
    --v3-texte-sm: clamp(0.78rem, 0.75rem + 0.14vw, 0.86rem);
    --v3-texte-xl: clamp(1.35rem, 1.1rem + 1vw, 1.9rem);
    --v3-chrono-date: clamp(4.5rem, 8vw, 5.5rem);
    --v3-chrono-line: calc(var(--v3-chrono-date) + clamp(0.75rem, 1.2vw, 1rem));
}

/* ---- La zone = l'ecran de l'outil (fond + grain + halos) ---- */
.apercu-outil {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    color-scheme: dark;
    color: var(--v3-texte);
    line-height: 1.5;
    padding: var(--v3-espace-lg);
    background-color: var(--v3-surface-fond);
    background-image:
        var(--v3-grain),
        radial-gradient(circle at 50% 50%, transparent 42%, rgba(0, 0, 0, 0.24) 100%),
        radial-gradient(circle at 86% 18%, rgba(var(--v3-accent-rgb), 0.14), transparent 29%),
        radial-gradient(circle at 12% 82%, rgba(var(--v3-accent-rgb), 0.12), transparent 26%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-carte), 0 18px 40px -24px rgba(0, 0, 0, 0.45);
}

.apercu-controls {
    padding: var(--v3-espace-md);
}

/* ---- Cartes accordeon (instructions / formulaires) ---- */
.apercu-outil .apercu-instructions,
.apercu-outil .formulaire-contexte,
.apercu-outil .formulaire-evenement {
    position: relative;
    padding: var(--v3-espace-sm);
    background-color: var(--v3-surface-carte);
    background-image: var(--v3-grain);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-carte);
}

/* Barre de titre d'accordeon (etat ouvert : fond eleve, liseré accent) */
.apercu-outil .apercu-instructions::before,
.apercu-outil .formulaire-contexte::before {
    display: block;
    margin: calc(var(--v3-espace-sm) * -1) calc(var(--v3-espace-sm) * -1) var(--v3-espace-sm);
    padding: var(--v3-espace-sm);
    font-weight: 600;
    color: var(--v3-accent-fort);
    background-color: var(--v3-surface-elevee);
    background-image: var(--v3-grain);
    border-left: 2px solid var(--v3-accent);
}

.apercu-outil .apercu-instructions::before {
    content: "A / Besoin d'aide ?";
}

.apercu-outil .formulaire-contexte::before {
    content: "B / Infos du dossier & Événements";
}

/* Trait lumineux en haut de carte (relief V3) */
.apercu-outil .apercu-instructions::after,
.apercu-outil .formulaire-contexte::after {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12) 25%, rgba(255, 255, 255, 0.12) 75%, transparent);
    pointer-events: none;
}

/* ---- Texte des instructions ---- */
.apercu-outil .apercu-instructions p {
    margin: 0;
    padding: 0.1rem 0;
    color: var(--v3-texte);
    font-size: var(--v3-texte-sm);
}

.apercu-outil .apercu-instructions strong {
    color: var(--v3-texte);
    font-weight: 700;
}

/* ---- Formulaires ---- */
.apercu-outil .formulaire-contexte,
.apercu-outil .formulaire-evenement {
    gap: var(--v3-espace-sm);
}

.apercu-outil .groupe-champs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--v3-espace-sm);
}

.apercu-outil .champ {
    display: flex;
    flex: 1 1 15rem;
    max-width: 100%;
    min-width: 0;
    flex-direction: column;
}

.apercu-outil .champ-radio {
    margin-top: var(--v3-espace-xs);
}

.apercu-outil label {
    display: block;
    margin-bottom: var(--v3-espace-xxs);
    font-size: var(--v3-texte-sm);
    font-weight: 500;
    color: var(--v3-texte);
}

/* ---- Saisies creuses ---- */
.apercu-outil input[type="text"],
.apercu-outil input[type="date"],
.apercu-outil textarea {
    width: 100%;
    padding: var(--v3-espace-xs);
    font: inherit;
    font-size: var(--v3-texte-sm);
    color: var(--v3-texte);
    background-color: var(--v3-surface-creux);
    border: 1px solid var(--v3-bordure-douce);
    border-radius: var(--v3-radius);
    caret-color: var(--v3-accent);
    box-shadow: var(--v3-ombre-creux);
    transition: box-shadow 0.2s ease;
}

.apercu-outil input[type="text"]:focus,
.apercu-outil input[type="date"]:focus,
.apercu-outil textarea:focus {
    outline: none;
    box-shadow: var(--v3-ombre-creux), 0 0 0 3px rgba(var(--v3-accent-rgb), 0.18);
}

.apercu-outil input::placeholder,
.apercu-outil textarea::placeholder {
    color: var(--v3-muted);
    opacity: 0.75;
}

.apercu-outil textarea {
    min-height: 6rem;
    resize: vertical;
}

/* ---- Pastilles radio (relief) ---- */
.apercu-outil .radio-groupe {
    display: flex;
    flex-wrap: wrap;
    margin-top: var(--v3-espace-xs);
    gap: var(--v3-espace-xs);
}

.apercu-outil .radio-option {
    display: inline-flex;
    max-width: 100%;
    padding: var(--v3-espace-xxs) var(--v3-espace-xs);
    gap: var(--v3-espace-xs);
    font-size: var(--v3-texte-sm);
    color: var(--v3-texte);
    background: var(--v3-degrade-relief);
    border: 1px solid var(--v3-bordure-douce);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-relief);
}

/* ---- Zone de selection de fichiers (creux pointille accent) ---- */
.apercu-outil .zone-fichiers {
    display: flex;
    min-height: clamp(3.5rem, 10vw, 4.5rem);
    padding: var(--v3-espace-sm);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background-color: var(--v3-surface-creux);
    border: 1px dashed rgba(var(--v3-accent-rgb), 0.45);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-creux);
}

.apercu-outil .zone-fichiers-texte {
    margin: 0;
    padding: 0;
    text-align: center;
    cursor: pointer;
    user-select: none;
    font-size: var(--v3-texte-sm);
    color: var(--v3-muted);
}

/* ---- Boutons (relief V3) ---- */
.apercu-outil .bouton {
    display: inline-flex;
    min-height: 2.5rem;
    max-width: 100%;
    padding: var(--v3-espace-xs) var(--v3-espace-md);
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    font-size: var(--v3-texte-sm);
    font-weight: 500;
    color: var(--v3-texte);
    background: var(--v3-degrade-relief);
    border: 1px solid var(--v3-bordure-douce);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-relief);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.apercu-outil .bouton:hover {
    background: var(--v3-degrade-relief-survol);
}

.apercu-outil .bouton:active {
    background: var(--v3-surface-creux);
    box-shadow: var(--v3-ombre-creux);
}

.apercu-outil .bouton-principal {
    background: var(--v3-degrade-relief-bleu);
    border-color: rgba(var(--v3-accent-rgb), 0.3);
}

.apercu-outil .bouton-principal:hover {
    background: var(--v3-degrade-relief-bleu-survol);
}

.apercu-outil .bouton-principal:active {
    background: var(--v3-surface-bleu-creux);
}

.apercu-outil .groupe-boutons {
    display: flex;
    margin-top: var(--v3-espace-sm);
    flex-wrap: wrap;
    gap: var(--v3-espace-sm);
}

/* ---- Chronologie ---- */
.apercu-outil .chronologie {
    position: relative;
    margin-top: var(--v3-espace-md);
}

.apercu-outil .chronologie::before {
    content: "";
    position: absolute;
    left: var(--v3-chrono-line);
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(var(--v3-accent-rgb), 0.22);
    pointer-events: none;
}

.apercu-outil .evenement {
    position: relative;
    margin-bottom: var(--v3-espace-md);
    padding-left: calc(var(--v3-chrono-line) + var(--v3-espace-md));
}

.apercu-outil .date-evenement {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--v3-chrono-date);
    padding-right: var(--v3-espace-sm);
    font-size: var(--v3-texte-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    word-break: normal;
    hyphens: none;
    color: var(--v3-muted);
    text-align: right;
}

.apercu-outil .carte {
    background-color: var(--v3-surface-carte);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-carte);
    padding: var(--v3-espace-sm);
}

.apercu-outil .titre-ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--v3-espace-xs);
    margin-bottom: var(--v3-espace-xs);
}

.apercu-outil .categorie {
    display: inline-block;
    padding: var(--v3-espace-xxs) var(--v3-espace-xs);
    font-size: var(--v3-texte-xs);
    font-weight: 500;
    color: var(--v3-texte);
    background-color: var(--v3-surface-creux);
    border: 1px solid var(--v3-bordure-douce);
    border-radius: var(--v3-radius);
    box-shadow: var(--v3-ombre-creux);
    white-space: nowrap;
}

.apercu-outil .titre-evenement {
    margin: 0;
    font-size: calc(var(--v3-texte-sm) * 1.2);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--v3-texte);
}

.apercu-outil .description {
    margin-bottom: var(--v3-espace-xs);
    font-size: var(--v3-texte-sm);
    line-height: 1.55;
    hyphens: auto;
    color: var(--v3-texte);
}

/* ---- Entete (titre du dossier) ---- */
.apercu-outil .entete {
    text-align: center;
    margin-bottom: var(--v3-espace-md);
    padding-bottom: var(--v3-espace-md);
    border-bottom: 1px solid rgba(var(--v3-accent-rgb), 0.2);
}

.apercu-outil .entete h1,
.apercu-outil .entete .nom-dossier {
    margin: 0 0 var(--v3-espace-sm);
    font-size: var(--v3-texte-xl);
    font-weight: 700;
    line-height: 1.15;
    color: var(--v3-texte);
}

.apercu-outil .sous-titre {
    margin-bottom: var(--v3-espace-xs);
    font-size: var(--v3-texte-sm);
    color: var(--v3-muted);
}

.apercu-outil .devise {
    font-size: var(--v3-texte-sm);
    color: var(--v3-accent);
    font-style: italic;
}

/* ---- Zone 5 : barre de controles ---- */
.apercu-outil .controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--v3-espace-xs);
    align-items: center;
}

.apercu-outil .champ-recherche {
    padding: var(--v3-espace-xs) var(--v3-espace-sm);
}

/* ---- Etiquette version (hero) ---- */
.herotime-version {
    display: inline-block;
    margin: 0 0 var(--space-sm);
    padding: 0.18rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bleu-ardoise-fonce);
    background: var(--orange-clair);
    border-radius: 999px;
}

/* ---- Note du hero ---- */
.herotime-note {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- Intro de la section fonctionnalites ---- */
.features-lead {
    max-width: 46rem;
    margin: 0 auto var(--space-lg);
    font-size: var(--font-base);
    color: var(--text-muted);
    line-height: var(--line-height);
}

/* ---- Etiquette "Nouveau" sur les cartes fonctionnalites ---- */
.feature-new {
    display: inline-block;
    margin-right: 0.3rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bleu-ardoise-fonce);
    background: var(--orange-clair);
    border-radius: 999px;
    vertical-align: middle;
}

/* ---- Encart mise a jour (anciennes versions) ---- */
/* Panneau "creux" version light (rappel du creux V3, sans dark) */
.download .instructions {
    background: #f6f7f9;
    border: 1px solid #e4e7eb;
    border-radius: var(--radius-md);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05), inset -1px -1px 0 #ffffff;
}

/* Souche "a detacher" dans la carte de telechargement */
.download-card-souche {
    position: relative;
    margin: var(--space-lg) calc(-1 * var(--space-lg)) 0;
    padding: var(--space-lg) var(--space-lg) 0;
    border-top: 2px dashed #dde2e8;
    text-align: left;
}

.download-card-souche::before,
.download-card-souche::after {
    content: "";
    position: absolute;
    top: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--blanc-doux);
}

.download-card-souche::before {
    left: -10px;
}

.download-card-souche::after {
    right: -10px;
}

.download-card-souche h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.download-card-souche p {
    margin-bottom: 0;
}

/* ---- Figures d'apercu + legende ---- */
.apercu-figure {
    flex: 1 1 30rem;
    min-width: 0;
    margin: 0;
}

.apercu-mention {
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
}

/* ---- Zone 2 : deux lignes nettes (4 champs / type d'adoption) ---- */
.apercu-outil .formulaire-contexte .champ {
    flex: 1 1 0;
}

.apercu-outil .champ-radio {
    flex: 1 1 100%;
}

/* ---- Boutons Modifier / Supprimer des cartes de la chronologie ---- */
.apercu-outil .actions-evenement {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--v3-espace-xs);
    margin-top: var(--v3-espace-xs);
}

.apercu-outil .actions-evenement .bouton {
    padding: var(--v3-espace-xxs) var(--v3-espace-sm);
    font-size: var(--v3-texte-xs);
}

/* Correction specificite : le bloc type d'adoption occupe sa propre ligne */
.apercu-outil .formulaire-contexte .champ-radio {
    flex: 1 1 100%;
}

/* ---- Renvoi vers les reseaux sociaux (bloc telechargement) ---- */
.instructions-reseaux {
    margin-top: var(--space-sm);
    color: var(--text-muted);
}

/* FAQ */
.faq-section {
    max-width: 60rem;
    margin: 0 auto var(--section-space);
    text-align: left;
}

.faq-section h2 {
    text-align: center;
    margin-bottom: var(--space-md);
}

/* FAQ (meme rendu que les autres pages, page.css n'est pas chargee ici) */
details.faq {
    background: var(--blanc-doux);
    border: 1px solid var(--gris-perle);
    margin: 0 0 1rem 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

details.faq > summary {
    padding: 1rem 1.5rem;
    line-height: 1.35;
    cursor: pointer;
    position: relative;
    list-style: none;
    padding-right: clamp(1.5rem, 4vw, 2.5rem);
    min-height: 44px;
    transition: all 0.3s ease;
}

details.faq > summary::-webkit-details-marker {
    display: none;
}

details.faq > summary::before {
    content: '';
    position: absolute;
    right: clamp(1rem, 3vw, 1.25rem);
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--gris-neutre);
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

details.faq[open] > summary::before {
    background: #2ecc71;
}

.faq-content {
    padding-bottom: 1rem;
    padding-left: 1.5rem;
}

.faq-content p {
    margin-bottom: 1.2em;
}

details.faq[open] .faq-content {
    background: var(--blanc-pur);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
