/* ==========================================================================
   APP.CSS — Styles de l'interface connectée (formulaires, wizard, dashboard)
   Chargé uniquement par les pages applicatives (index, compte, wizard, etc.)
   ========================================================================== */

/* ── Transitions douces dark ↔ light ── */
*,
*::before,
*::after {
    transition:
        background-color 0.3s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.3s ease;
}
/* Exclure les éléments avec animation active pour ne pas casser hover/keyframes */
[class*="shimmer"]::after,
.chatbot-bubble.streaming::after,
#btnGenerer:not(:disabled) {
    transition: none !important;
}

/* Logo */
.header-logo { height: 40px; width: auto; }
.footer-logo { height: 32px; width: auto; opacity: 0.8; margin-bottom: 0.5rem; }
/* --- Dark mode: progress bar + step dots (forcé par bouton) --- */
:root.theme-dark .progress-fill {
    background: linear-gradient(90deg, var(--accent), var(--primary));
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
}

:root.theme-dark .step-dot.active .step-number {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--secondary);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
}

:root.theme-dark .step-dot.completed .step-number {
    border-color: var(--success);
    color: var(--success);
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.2);
}

/* --- Dark mode: progress bar + step dots (auto via OS) --- */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .progress-fill {
        background: linear-gradient(90deg, var(--accent), var(--primary));
        box-shadow: 0 0 15px rgba(96, 165, 250, 0.5);
    }

    :root:not(.theme-light) .step-dot.active .step-number {
        background-color: var(--primary);
        border-color: var(--primary);
        color: var(--secondary);
        box-shadow: 0 0 20px rgba(96, 165, 250, 0.4);
    }

    :root:not(.theme-light) .step-dot.completed .step-number {
        border-color: var(--success);
        color: var(--success);
        box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.2);
    }
}

/* ==========================================================================
   WIZARD LAYOUT (Split-screen sidebar + form)
   ========================================================================== */
.wizard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

.wizard-sidebar {
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.v-steps {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.v-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    transition: background var(--trans-fast), color var(--trans-fast), border-color var(--trans-fast);
    text-align: left;
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--text-muted);
    width: 100%;
}

.v-step:hover {
    background: rgba(37, 99, 235, 0.06);
}

.v-step.active {
    background: rgba(37, 99, 235, 0.12);
    border-left-color: var(--accent);
    color: var(--text-main);
    font-weight: 600;
}

.v-step.completed {
    color: var(--success);
    border-left-color: var(--success);
}

.v-step-num {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    transition: all var(--trans-fast);
}

.v-step.active .v-step-num {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--text-on-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.v-step.completed .v-step-num {
    border-color: var(--success);
    background: var(--success);
    color: var(--text-on-primary);
}

.v-step-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.helper-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.helper-box h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.helper-box p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================================================
   ADVERSE CARDS
   ========================================================================== */
.adverses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.adverse-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}
.adverse-card > * { margin-top: 0; margin-bottom: 0; }
.adverse-card > .form-group + .form-grid,
.adverse-card > .form-grid + .form-group { margin-top: 0.25rem; }

.adverse-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.adverse-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.adverse-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.btn-remove-adverse {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all var(--trans-fast);
}

.btn-remove-adverse:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.06);
}

/* ==========================================================================
   TIMELINE BUILDER
   ========================================================================== */
.timeline-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-entry {
    display: grid;
    grid-template-columns: 160px 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color var(--trans-fast);
}

.timeline-entry:hover {
    border-color: var(--accent);
}

.timeline-entry .tl-text {
    min-height: 2.5rem;
    resize: vertical;
}

.btn-remove-tl {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    font-size: 1.1rem;
    transition: color var(--trans-fast);
    align-self: center;
}

.btn-remove-tl:hover {
    color: var(--danger);
}

.btn-ghost {
    background: transparent;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.875rem;
    transition: all var(--trans-fast);
    width: 100%;
    text-align: center;
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(37, 99, 235, 0.04);
}

/* ==========================================================================
   WIZARD — RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .wizard-layout {
        grid-template-columns: 1fr;
    }
    .wizard-sidebar {
        position: static;
        order: -1;
    }
    .v-steps {
        flex-direction: row;
        overflow-x: auto;
    }
    .v-step {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        min-width: 70px;
        text-align: center;
        font-size: 0.75rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 8px 8px 0 0;
    }
    .v-step.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }
    .v-step.completed {
        border-left-color: transparent;
        border-bottom-color: var(--success);
    }
    .v-step-num {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
    }
    .helper-box {
        display: none;
    }
    .timeline-entry {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FORMULAIRE
   ========================================================================== */
.form-step {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.step-icon {
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius);
}

.step-header h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.step-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
/* Grille adresse : code postal étroit, ville large */
.form-grid.addr-grid {
    grid-template-columns: 140px 1fr;
}
.form-grid > .form-group { margin-bottom: 0; }

.form-group {
    margin-bottom: 1.5rem;
}
.form-group:last-child {
    margin-bottom: 0;
}

.form-group.full-width,
.form-grid > .form-grid {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.required {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--input-bg);
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background-color var(--trans-fast);
}
textarea { resize: vertical; }
.form-group > textarea { min-height: 120px; }

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .form-card,
    :root:not(.theme-light) .dossier-card,
    :root:not(.theme-light) .modal-box,
    :root:not(.theme-light) .recap-box {
        background-color: rgba(30, 41, 59, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
            0 10px 10px -5px rgba(0, 0, 0, 0.2);
    }
    :root:not(.theme-light) input,
    :root:not(.theme-light) textarea,
    :root:not(.theme-light) select {
        background-color: rgba(15, 23, 42, 0.4);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Mode sombre forcé via bouton utilisateur */
:root.theme-dark .form-card,
:root.theme-dark .dossier-card,
:root.theme-dark .modal-box,
:root.theme-dark .recap-box {
    background-color: rgba(30, 41, 59, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 10px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
:root.theme-dark input,
:root.theme-dark textarea,
:root.theme-dark select {
    background-color: rgba(15, 23, 42, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
:root.theme-dark input[type="checkbox"],
:root.theme-dark input[type="radio"] {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    accent-color: var(--primary);
}
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) input[type="checkbox"],
    :root:not(.theme-light) input[type="radio"] {
        background-color: transparent !important;
        border-color: rgba(255, 255, 255, 0.4) !important;
        accent-color: var(--primary);
    }
}

/* Animation d'erreur */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25%,
    75% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }
}

/* --- Cartes Sélectionnables (Catégories, Urgence, Ton) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.urgence-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.ton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.category-card,
.urgence-content,
.ton-content {
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--trans-fast), background-color var(--trans-fast), box-shadow var(--trans-fast);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.urgence-content,
.ton-content {
    text-align: center;
    padding: 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.category-card:hover,
.urgence-content:hover,
.ton-content:hover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.03);
}

.category-card.selected,
input:checked+.urgence-content,
input:checked+.ton-content {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.07);
    box-shadow: 0 0 0 1px var(--primary);
}

.cat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.cat-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9375rem;
}

.cat-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.urgence-card input,
.ton-card input {
    display: none;
}

.urgence-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.urgence-badge.faible {
    color: var(--text-muted);
}

.urgence-badge.moyen {
    color: var(--accent);
}

.urgence-badge.eleve {
    color: var(--warning);
}

.urgence-badge.critique {
    color: var(--danger);
}

.urgence-desc,
.ton-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
}

.ton-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary);
}

/* Recap */
.recap-wrapper {
    margin-top: 2rem;
}

.recap-titre {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.recap-box {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* ==========================================================================
   ZONES SPÉCIFIQUES (UPLOAD, RECAP, BROUILLON, PAIEMENT)
   ========================================================================== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--input-bg);
    margin-top: 0.5rem;
    transition: border-color var(--trans-fast), background-color var(--trans-fast);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.05);
}

.upload-zone svg {
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.875rem;
}

.upload-zone span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.recap-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.recap-row:last-child {
    border-bottom: none;
}

.remove-adverse {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 1rem;
    cursor: pointer;
    transition: background-color var(--trans-fast), border-color var(--trans-fast);
}

.remove-adverse:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* ==========================================================================
   MODALES (ERREUR / SUCCÈS / SSE)
   ========================================================================== */
#loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--surface);
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

#loader-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-align: center;
}

.loader-logs {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 80%;
    margin-bottom: 2rem;
}

#generationSteps {
    width: 100%;
    max-width: 400px;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: var(--radius);
}

/* ==========================================================================
   ESPACE PERSONNEL (compte.html)
   ========================================================================== */
.dossiers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dossier-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.dossier-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent);
}

.dossier-numero {
    font-weight: 700;
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.dossier-categorie {
    display: inline-block;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.dossier-description {
    color: var(--text-main);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.dossier-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dossier-expiry {
    color: var(--danger);
    font-weight: 500;
}

.compte-empty {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}

.compte-empty svg {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.compte-empty p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.dossier-card-left {
    flex: 1;
    min-width: 0;
}

.dossier-sep {
    margin: 0 0.2rem;
    color: var(--text-muted);
}

.btn-nouveau-dossier {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--primary);
    color: var(--surface);
    padding: .45rem 1.1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: .875rem;
    border: none;
    cursor: pointer;
    transition: background-color var(--trans-fast);
}

.btn-nouveau-dossier:hover {
    background: rgb(26, 49, 117); /* fallback */
    background: color-mix(in srgb, var(--primary) 85%, #000);
}

/* ==========================================================================
   TIMELINE PROCÉDURE (dossier-timeline)
   ========================================================================== */
.dossier-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.25rem 0 0.5rem;
}

.timeline-step {
    display: flex;
    gap: 1rem;
    position: relative;
}

.timeline-step+.timeline-step {
    margin-top: 0;
}

.timeline-step__dot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-step__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
    transition: background-color var(--trans-fast), color var(--trans-fast);
    position: relative;
    z-index: 1;
}

.timeline-step__connector {
    width: 2px;
    flex: 1;
    min-height: 1.75rem;
    background: var(--border);
    margin: 0.2rem 0;
}

/* États */
.timeline-step[data-status="done"] .timeline-step__icon {
    background: var(--success);
    color: var(--surface);
}

.timeline-step[data-status="active"] .timeline-step__icon {
    background: var(--accent);
    color: var(--surface);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.timeline-step[data-status="done"] .timeline-step__connector {
    background: var(--success);
}

.timeline-step[data-status="active"] .timeline-step__connector {
    background: linear-gradient(to bottom, var(--accent), var(--border));
}

/* Pulsation sur l'étape active */
.timeline-step[data-status="active"] .timeline-step__icon::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: timeline-pulse 2s ease-in-out infinite;
}

@keyframes timeline-pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(1.35);
    }
}

/* Contenu */
.timeline-step__body {
    padding: 0.25rem 0 1.5rem;
    flex: 1;
    min-width: 0;
}

.timeline-step__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.timeline-step__note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Étapes futures (pending) */
.timeline-step[data-status="pending"] .timeline-step__title {
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-step[data-status="pending"] .timeline-step__icon {
    background: var(--bg);
    border: 2px dashed var(--border);
}

/* État "skipped" — relance non applicable aux conditions du dossier */
.timeline-step[data-status="skipped"] .timeline-step__icon {
    background: transparent;
    border: 2px dashed var(--border);
    opacity: 0.45;
}

.timeline-step[data-status="skipped"] .timeline-step__title {
    color: var(--text-muted);
    font-weight: 400;
}

.timeline-step[data-status="skipped"] .timeline-step__connector {
    background: var(--border);
    opacity: 0.4;
}

/* Conditions visibles dans la timeline */
.timeline-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.condition-met {
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 500;
}

.condition-miss {
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .timeline-step[data-status="active"] .timeline-step__icon::after {
        animation: none;
    }
}

/* ==========================================================================
   STATUTS — système à 5 états (status-dot + status-badge)
   ========================================================================== */

/* Variables de statuts — compatibles dark mode via les couleurs existantes */
:root {
    --status-pending: var(--warning);
    /* Amber  — en attente d'envoi */
    --status-active: var(--accent);
    /* Blue   — en cours (= --accent) */
    --status-done: var(--success);
    /* Green  — terminé (= --success) */
    --status-failed: var(--danger);
    /* Red    — erreur (= --danger) */
    --status-paused: #8B5CF6;
    /* Purple — suspendu */
}

/* Point de statut — inline dans les cartes et listes */
.status-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot[data-status="pending"] {
    background: var(--status-pending);
}

.status-dot[data-status="active"] {
    background: var(--status-active);
    animation: timeline-pulse 2s ease-in-out infinite;
}

.status-dot[data-status="done"] {
    background: var(--status-done);
}

.status-dot[data-status="failed"] {
    background: var(--status-failed);
}

.status-dot[data-status="paused"] {
    background: var(--status-paused);
}

@media (prefers-reduced-motion: reduce) {
    .status-dot[data-status="active"] {
        animation: none;
    }
}

/* ==========================================================================
   CARTES RÉFÉRENCES LÉGALES (legal-card)
   ========================================================================== */
.legal-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.legal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.legal-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent);
}

.legal-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.legal-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.legal-badge--jurisprudence {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-surface-text);
    border-color: rgba(245, 158, 11, 0.25);
}

.legal-badge--admin {
    background: rgba(139, 92, 246, 0.1);
    color: #7C3AED;
    border-color: rgba(139, 92, 246, 0.25);
}

.legal-card__date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.legal-card__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.legal-card__excerpt {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    /* Troncature 3 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.legal-card__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.legal-card__link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

.legal-card__link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   MULTISELECT CHIPS (nature du problème)
   ========================================================================== */
.multiselect-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.chip-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.875rem;
    border: 1.5px solid var(--border);
    border-radius: 2rem;
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--trans-fast);
    user-select: none;
}

.chip-option:hover {
    border-color: var(--accent);
    background: rgb(239, 245, 255); /* fallback */
    background: color-mix(in srgb, var(--accent) 8%, var(--input-bg));
}

.chip-option input[type="checkbox"] {
    display: none;
}

.chip-option:has(input:checked) {
    border-color: var(--primary);
    background: rgb(228, 231, 246); /* fallback */
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary);
}

/* Fallback pour navigateurs sans :has() */
.chip-option.checked {
    border-color: var(--primary);
    background: rgb(228, 231, 246); /* fallback */
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary);
}

/* ==========================================================================
   ATTRIBUTION — Assignation des griefs aux parties adverses
   ========================================================================== */
.attribution-section {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: rgb(244, 245, 249); /* fallback */
    background: color-mix(in srgb, var(--primary) 5%, var(--surface));
    border: 1.5px solid rgb(187, 197, 220); /* fallback */
    border: 1.5px solid color-mix(in srgb, var(--primary) 20%, var(--border));
    border-radius: var(--radius);
}

.attribution-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 0.4rem;
}

.attribution-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.attribution-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgb(197, 206, 225); /* fallback */
    border-top: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
}

.attribution-row:first-child {
    border-top: none;
}

.attribution-adverse-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.attribution-problems {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.attribution-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 2rem;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--trans-fast);
}

.attribution-chip:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

.attribution-chip input[type="checkbox"] {
    display: none;
}

.attribution-chip:has(input:checked),
.attribution-chip.checked {
    border-color: var(--success);
    background: rgb(231, 248, 242); /* fallback */
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    color: var(--success);
    font-weight: 600;
}

/* ==========================================================================
   SWITCH PRO / PARTICULIER (Sprint 5)
   ========================================================================== */
.user-type-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg);
    padding: 0.35rem;
    border-radius: calc(var(--radius) + 0.25rem);
    border: 1px solid var(--border);
}

.type-pill {
    flex: 1;
    text-align: center;
    padding: 0.65rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: all var(--trans-fast);
    user-select: none;
    border: 1px solid transparent;
}

.type-pill:hover {
    color: var(--primary);
}

.type-pill.active {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

/* Gestion de l'affichage conditionnel */
.pro-only {
    display: none;
    /* Piloté par le JS et le style inline Jinja2 */
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   MEDIA QUERIES
   ========================================================================== */
/* --- Notification Toast (Auto-save confirmation) --- */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--secondary);
    color: var(--surface);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
}

.toast-notification.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

:root.theme-dark .toast-notification {
    background: var(--primary);
    color: var(--secondary);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .toast-notification {
        background: var(--primary);
        color: var(--secondary);
        box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
    }
}

@media (max-width: 768px) {
    .form-card {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid.addr-grid {
        grid-template-columns: 120px 1fr;
    }

    .form-navigation {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .dossier-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .recap-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .urgence-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ton-grid {
        grid-template-columns: 1fr;
    }

    .steps-indicator::before {
        display: none;
    }
}

@media (max-width: 420px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Skeleton Loading
   ========================================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius);
    display: inline-block;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* HTMX — animation de suppression de carte dossier */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   SKELETON LOADING (Chargement fluide)
   ========================================================================== */
.skeleton-card {
    height: 140px;
    /* Aligné sur la hauteur de tes .dossier-card */
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    animation: shimmerLoading 1.5s infinite;
}

@keyframes shimmerLoading {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-color-scheme: light) {
    .skeleton-card::after {
        background: linear-gradient(90deg,
                transparent,
                rgba(0, 0, 0, 0.03),
                transparent);
    }
}
/* ── Compte — classes déplacées depuis <style> ── */
.timeline-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}

.timeline-row:last-child {
    border-bottom: none;
}

.timeline-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.timeline-label {
    flex: 1;
    font-weight: 500;
}

.timeline-date {
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-mark-sent {
    padding: 2px 8px;
    font-size: .72rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-mark-sent:hover {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.btn-timeline-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .78rem;
    color: var(--primary);
    padding: .2rem 0;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .4rem;
}

.score-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.score-badge:hover {
    opacity: .8;
}

.score-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.score-panel {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.sp-section {
    margin: 14px 0;
}

.sp-section h4 {
    margin: 0 0 6px;
    font-size: .9rem;
    color: var(--text-main);
}

.sp-section ul {
    margin: 0;
    padding-left: 18px;
}

.sp-section li,
.sp-section p {
    font-size: .88rem;
    margin: 3px 0;
}

.chrono-row {
    display: flex;
    gap: .5rem;
    padding: .25rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .8rem;
}

.chrono-row:last-child {
    border-bottom: none;
}

.chrono-date {
    color: var(--text-muted);
    min-width: 82px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.statut-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
}

.statut-select:focus {
    outline: none;
    border-color: var(--primary);
}

.neg-entry {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: .78rem;
    padding: .25rem 0;
    border-bottom: 1px solid var(--border);
}

.neg-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.neg-form {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .5rem;
    padding: .6rem;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    max-width: 480px;
}

.neg-form select,
.neg-form input {
    font-size: .8rem;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.lien-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
}

.lien-badge a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.archive-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    background: var(--success-light);
    color: var(--success-surface-text);
    border: 1px solid var(--success-surface-border);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.archive-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .78rem;
    padding: .3rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.dossier-card-right {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-width: 140px;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    justify-content: center;
}

.btn-action-primary {
    background: var(--bg);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-action-dark {
    background: var(--secondary, #1B2A4A);
    color: var(--text-on-primary);
}
:root.theme-dark .btn-action-dark {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #1a2b4b 0%, #243b5f 100%);
}
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .btn-action-dark {
        border: 1px solid rgba(59, 130, 246, 0.3);
        background: linear-gradient(135deg, #1a2b4b 0%, #243b5f 100%);
    }
}

.btn-action-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-action-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger-surface-border);
}

.btn-action-green {
    background: transparent;
    color: var(--success);
    border-color: var(--success-surface-border);
}

.btn-action:hover {
    filter: brightness(.95);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: var(--surface);
    border-radius: 14px;
    padding: 1.75rem;
    max-width: 520px;
    width: 92vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .75rem;
}

.modal-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

#modal-apercu-inner {
    background: var(--surface);
    border-radius: 12px;
    width: min(92vw, 1100px);
    height: min(90vh, 820px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.apercu-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.apercu-tab {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: .75rem;
    font-weight: 500;
    white-space: nowrap;
}

.apercu-tab.active {
    background: var(--accent-light);
    border-color: var(--accent);
}

#regen-output {
    margin-top: .75rem;
    padding: .65rem;
    background: var(--input-bg);
    border-radius: 8px;
    font-size: .82rem;
    min-height: 2rem;
    color: var(--text-secondary);
}

.upgrade-box {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--info-surface), #e0f2fe);
    border: 1px solid var(--info-surface-border);
    border-radius: 12px;
}
.compte-rgpd-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.compte-rgpd-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-main);
}

.compte-rgpd-desc {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.compte-rgpd-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.compte-rgpd-btn-export {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

.compte-rgpd-btn-delete {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--danger-surface-border);
    background: var(--danger-light, #fff5f5);
    color: var(--danger, #dc2626);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

.compte-rgpd-msg {
    margin-top: .75rem;
    font-size: .85rem;
}

/* ── Admin — classes déplacées depuis <style> ── */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.stat-card .val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}

.stat-card .lbl {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .4rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-card.blue .val {
    color: var(--primary);
}

.stat-card.green .val {
    color: var(--success-surface-text);
}

.stat-card.red .val {
    color: var(--danger-surface-text);
}

.stat-card.amber .val {
    color: var(--warning-surface-text);
}

.admin-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.5rem 0 .75rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.admin-table th {
    text-align: left;
    padding: .55rem .75rem;
    background: var(--input-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .73rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
}

.badge-paid {
    background: var(--success-surface);
    color: var(--success-surface-text);
}

.badge-pending {
    background: var(--warning-surface);
    color: var(--warning-surface-text);
}

.admin-temo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .65rem;
}

.admin-temo-stars {
    color: var(--warning);
    font-size: .9rem;
    margin-bottom: .35rem;
}

.admin-temo-txt {
    font-size: .88rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 .5rem;
}

.admin-temo-meta {
    font-size: .75rem;
    color: var(--text-muted);
}

.btn-sm {
    padding: .4rem .85rem;
    font-size: .8rem;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    border: none;
}

.btn-approve {
    background: var(--success-surface);
    color: var(--success-surface-text);
}

.btn-approve:hover {
    background: var(--success-surface-border);
}

.btn-reject {
    background: var(--danger-surface);
    color: var(--danger-surface-text);
    margin-left: .4rem;
}

.btn-reject:hover {
    background: var(--danger-surface-border);
}

.metric-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.bar-fill {
    height: 8px;
    border-radius: 4px;
    transition: width .4s;
}

#auto-refresh-badge {
    display: inline-block;
    padding: .25rem .65rem;
    background: var(--success-surface);
    color: var(--success-surface-text);
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
}

#auto-refresh-badge.off {
    background: var(--bg);
    color: var(--text-muted);
}

.admin-btn-sm {
    font-size: .8rem;
    padding: .45rem .9rem;
}

.admin-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-title-h2 {
    margin: 0;
}

.admin-last-update {
    font-size: .8rem;
    color: var(--text-muted);
}

.admin-status-bar {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    align-items: center;
}

.admin-status-item {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-main);
}

.admin-status-icon {
    vertical-align: text-bottom;
    margin-right: 4px;
}

.admin-status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--border);
    color: var(--text-muted);
    margin-left: 5px;
}

.admin-metrics-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.admin-metrics-flex {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.admin-metric-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
    font-weight: 600;
}

.admin-metric-bar-bg {
    flex: 1;
    background: var(--bg);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.admin-metric-value {
    font-size: .8rem;
    font-weight: 700;
    min-width: 36px;
}

.admin-metric-err {
    color: var(--danger-surface-text);
}

.admin-metric-warn {
    color: var(--warning-surface-text);
}

.admin-metric-ok {
    color: var(--success-surface-text);
}

.admin-metric-tokens {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-actions-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.admin-action-msg {
    font-size: .85rem;
    color: var(--success-surface-text);
    min-height: 1.2em;
    margin-bottom: 1rem;
}

.admin-temo-list {
    margin-bottom: 2rem;
}

.admin-table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-main-container {
    max-width: 1100px;
}

.admin-action-btn {
    font-size: .85rem;
}

.bar-fill-err {
    background: var(--danger);
    width: 0%;
}

.bar-fill-warn {
    background: var(--warning);
    width: 0%;
}

.bar-fill-ok {
    background: var(--success);
    width: 0%;
}

.admin-temo-loading {
    color: var(--text-muted);
    font-size: .85rem;
}

.admin-td-mono {
    font-family: monospace;
    font-size: .78rem;
}

.admin-td-desc {
    max-width: 180px;
    color: var(--text-muted);
}

.admin-td-date {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: .8rem;
}

.admin-td-center {
    text-align: center;
    color: var(--text-muted);
}

.admin-error-msg {
    padding: 2rem;
    color: var(--danger);
}

.admin-temo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-no-temo {
    color: var(--text-muted);
    font-size: .85rem;
}

.admin-user-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.admin-user-search-row {
    display: flex;
    gap: .6rem;
    margin-bottom: 1rem;
}

.admin-user-input {
    flex: 1;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .875rem;
}

.admin-user-result {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.admin-user-info {
    font-size: .88rem;
    color: var(--text-muted);
    margin-bottom: .85rem;
}

.admin-plan-buttons {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.admin-plan-label {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-plan-switch {
    padding: .4rem .9rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.btn-plan-switch:hover {
    border-color: var(--accent);
    color: var(--primary);
}

.btn-plan-switch.active {
    background: var(--primary);
    color: var(--surface);
    border-color: var(--primary);
}

.admin-plan-msg {
    margin-top: .65rem;
    font-size: .83rem;
    min-height: 1.2em;
}

/* ── Index — formulaire de création ── */
.js-hidden {
    display: none;
}

.freemium-banner {
    display: none;
    min-height: 44px;
    margin-bottom: 1rem;
    padding: .75rem 1.25rem;
    background: linear-gradient(90deg, #e0f2fe, var(--info-surface));
    border: 1px solid var(--info-surface-border);
    border-radius: 10px;
    font-size: .9rem;
    color: var(--info-surface-text);
    text-align: center;
}

.reprendre-section {
    display: none;
    margin-top: .75rem;
    padding: .75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.reprendre-select {
    flex: 1;
    min-width: 180px;
    font-size: .85rem;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.reprendre-btn {
    padding: 5px 14px;
    border-radius: 7px;
    border: none;
    background: var(--secondary, #1B2A4A);
    color: var(--surface);
    font-size: .83rem;
    font-weight: 600;
    cursor: pointer;
}

.reprendre-msg {
    font-size: .78rem;
    margin-top: .4rem;
}

.file-list-mt {
    margin-top: 1rem;
}

/* Auth modal (index.html) */
.modal-auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-auth-box {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-auth-title {
    margin: 0;
    color: var(--secondary);
}

.modal-auth-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    line-height: 1;
}

.modal-auth-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-auth-field {
    margin-bottom: 1rem;
}

.modal-auth-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

.modal-auth-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
}

.modal-auth-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.modal-auth-feedback {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.2em;
}

.modal-auth-footer {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.art-back--notop {
    margin-top: 0;
}

/* ── Cabinet invitation ── */
.invite-hint {
    font-size: .85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
}

/* ── Développeurs ── */
.api-doc-p {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: .5rem;
}

/* ── Profil ── */
.profil-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-disabled {
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-muted, #94a3b8);
    cursor: not-allowed;
}

.save-hint {
    font-size: .8rem;
    color: var(--text-muted, #94a3b8);
}

.save-feedback {
    font-size: .9rem;
    color: var(--success, #16a34a);
    display: none;
}

/* ── Partage ── */
.partage-header-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.partage-dossier-num {
    font-size: 1.1rem;
}

.partage-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.partage-doc-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem;
}

.partage-doc-loading {
    color: var(--text-secondary);
    font-size: .85rem;
}

.partage-desc {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: .5rem;
    font-style: italic;
}

.partage-readonly {
    font-size: .75rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

.viewer-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.viewer-placeholder-icon {
    margin-bottom: 1rem;
    display: block;
}

/* ── Dossier type ── */
.dt-main {
    padding: 2.5rem 0;
}

.dt-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.dt-info-grid {
    display: grid;
    gap: .75rem;
}

.dt-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    gap: .9rem;
    align-items: flex-start;
}

.dt-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.dt-info-icon--amber {
    background: var(--warning-surface);
}

.dt-info-icon--green {
    background: var(--success-surface);
}

.dt-info-icon--purple {
    background: #ede9fe;
}

.dt-info-label {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .3rem;
}

.dt-info-label--amber {
    color: var(--warning-surface-text);
}

.dt-info-label--green {
    color: var(--success-surface-text);
}

.dt-info-label--purple {
    color: #4c1d95;
}

.dt-info-text {
    margin: 0;
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.dt-link-dark {
    color: var(--primary);
    font-weight: 600;
}

.dt-cta-lg {
    font-size: 1rem;
}

.dt-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.dt-small-text {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .75rem;
}

/* ── Dossier-type : cas similaires (maillage interne) ── */
.dt-related {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem;
}

.dt-related-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.dt-related-card:hover,
.dt-case-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--accent);
}

.dt-related-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-main);
}

.dt-related-link {
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
}

/* ── Dossier-type : grille geo SEO (villes) ── */
.dt-geo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .5rem;
}

.dt-geo-link {
    display: block;
    padding: .55rem .9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    text-align: center;
    transition: border-color .2s, color .2s;
}

.dt-geo-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Dossier-type : étapes de la procédure ── */
.dt-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dt-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.dt-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent, #2563eb);
    color: var(--text-on-primary);
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: .15rem;
}

.dt-step-body {
    flex: 1;
    min-width: 0;
}

.dt-step-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 .3rem;
}

.dt-step-detail {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

.dt-guide-text {
    font-size: .92rem;
    color: var(--text-main);
    line-height: 1.7;
    margin: 0 0 1rem;
}

.compte-section-parrainage {
    margin-top: 2rem;
}

.compte-section-temoignage {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.compte-section-rgpd {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.compte-rgpd-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

.compte-rgpd-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 .5rem;
}

.compte-rgpd-desc {
    font-size: .85rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.compte-rgpd-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.compte-rgpd-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.compte-rgpd-btn-export {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
}

.compte-rgpd-btn-delete {
    border: 1px solid var(--danger-surface-border);
    background: var(--danger-light, #fff5f5);
    color: var(--danger, #dc2626);
}

.compte-rgpd-msg {
    margin-top: .75rem;
    font-size: .85rem;
}

/* Aperçu modal */
.apercu-tabs-list {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    flex: 1;
    overflow: auto;
}

.apercu-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
    margin-left: .5rem;
}

.apercu-iframe {
    flex: 1;
    border: none;
    border-radius: 0 0 12px 12px;
}

/* Modals shared */
.modal-desc {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-bottom: 1rem;
}

.modal-desc-sm {
    color: var(--text-secondary);
    font-size: .88rem;
    margin-bottom: .75rem;
}

.modal-label-block {
    display: block;
    margin-bottom: .75rem;
}

.modal-field-label {
    font-size: .85rem;
    font-weight: 600;
    display: block;
    margin-bottom: .3rem;
}

.modal-input {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    box-sizing: border-box;
    font-family: inherit;
}

.modal-row {
    display: flex;
    gap: .5rem;
}

.modal-flex-field {
    flex: 1;
}

.modal-error {
    display: none;
    color: var(--danger);
    font-size: .85rem;
    margin-top: .5rem;
}

.modal-actions-top {
    margin-top: 1rem;
}

.btn-action-danger-filled {
    background: var(--danger);
    color: var(--surface);
    border-color: var(--danger);
}

.modal-share-btns {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.modal-flex-btn {
    flex: 1;
}

.modal-share-result {
    margin-top: .75rem;
    display: none;
}

.modal-share-result-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.modal-share-url-row {
    display: flex;
    gap: .4rem;
    margin-top: .3rem;
}

.modal-share-url-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: .82rem;
    background: var(--input-bg);
}

.modal-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
}

.modal-notes-history {
    max-height: 160px;
    overflow-y: auto;
    padding: .5rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .82rem;
    white-space: pre-wrap;
    margin-bottom: .75rem;
    display: none;
}

.modal-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .88rem;
    resize: vertical;
    font-family: inherit;
}

/* Compte JS-generated HTML */
.account-load-error {
    color: var(--danger);
    text-align: center;
    padding: 2rem;
}

.plan-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-margin-auto {
    margin: 0 auto;
}

.upgrade-box-title {
    margin: 0 0 .75rem;
    font-weight: 700;
    color: #0369a1;
    font-size: 1rem;
}

.upgrade-btns-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

.btn-sub-essentiel {
    padding: 8px 18px;
    background: var(--info-surface-text);
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    font-family: inherit;
}

.btn-sub-pro {
    padding: 8px 18px;
    background: var(--success-surface-text);
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    font-family: inherit;
}

.btn-sub-cabinet {
    padding: 8px 18px;
    background: #4c1d95;
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    font-family: inherit;
}

.upgrade-note {
    margin: .5rem 0 0;
    font-size: .8rem;
    color: #0369a1;
}

.relance-badge-overdue {
    color: var(--warning);
}

.relance-badge-pending {
    color: var(--text-muted);
}

.relance-badge-sent {
    color: var(--success-surface-text);
}

.no-relances-msg {
    color: var(--text-secondary);
    font-size: .82rem;
}

.apercu-loading {
    font-size: .82rem;
    color: var(--text-muted);
}

.apercu-error {
    color: var(--danger);
    font-size: .82rem;
}

.score-title {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.score-close-btn {
    margin-top: 16px;
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    background: var(--secondary, #1B2A4A);
    color: var(--text-on-primary);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.lien-badge-item {
    margin-bottom: .3rem;
}

.lien-mini-btn {
    font-size: .78rem;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
}

.lien-del-btn {
    font-size: .78rem;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--danger-surface-border);
    background: var(--danger-light, #fff5f5);
    color: var(--danger, #dc2626);
    cursor: pointer;
    font-family: inherit;
}

.lien-mini-loading {
    font-size: .78rem;
    color: var(--text-muted);
}

.lien-mini-btns-row {
    margin-top: .5rem;
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.lien-none-msg {
    font-size: .78rem;
    color: var(--text-muted);
}

.lien-mini-error {
    font-size: .78rem;
    color: var(--danger);
}

/* Parrainage */
.parrainage-box {
    background: linear-gradient(135deg, var(--success-surface), #dcfce7);
    border: 1px solid var(--success-surface-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.parrainage-title {
    margin: 0 0 .35rem;
    font-weight: 700;
    color: var(--success-surface-text);
    font-size: 1rem;
}

.parrainage-desc {
    margin: 0 0 1rem;
    font-size: .88rem;
    color: var(--success-surface-text);
}

.parrainage-url-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.parrainage-url-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--success-surface-border);
    border-radius: 8px;
    font-size: .82rem;
    background: var(--surface);
    color: var(--success-surface-text);
    font-weight: 500;
}

.parrainage-copy-btn {
    padding: 8px 16px;
    background: var(--success-surface-text);
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .82rem;
    white-space: nowrap;
    font-family: inherit;
}

.parrainage-stats {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.parrainage-stat {
    text-align: center;
}

.parrainage-stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--success-surface-text);
}

.parrainage-stat-label {
    font-size: .72rem;
    color: var(--success-surface-text);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: .15rem;
}

/* Témoignage */
.temoignage-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.temoignage-title {
    margin: 0 0 .35rem;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.temoignage-desc {
    margin: 0 0 .85rem;
    font-size: .88rem;
    color: var(--text-secondary);
}

.stars-row {
    display: flex;
    gap: .25rem;
    margin-bottom: .75rem;
}

.star-btn {
    font-size: 1.6rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--border);
    padding: 2px;
    line-height: 1;
    font-family: inherit;
}

.temoignage-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .88rem;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.temoignage-submit-row {
    margin-top: .75rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.temoignage-submit-btn {
    padding: 8px 18px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: .88rem;
    font-family: inherit;
}

.temoignage-msg {
    font-size: .85rem;
}

.temoignage-success {
    background: var(--success-light);
    border: 1px solid var(--success-surface-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    color: var(--success-surface-text);
    font-weight: 600;
}

/* Négociation */
.neg-mini-loading {
    font-size: .78rem;
    color: var(--text-muted);
}

.neg-entry-date {
    color: var(--text-muted);
    margin-left: auto;
    font-size: .72rem;
}

.neg-none-msg {
    font-size: .78rem;
    color: var(--text-muted);
    padding: .3rem 0;
}

.neg-actions-row {
    margin-top: .6rem;
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.neg-action-btn {
    font-size: .78rem;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
}

.neg-propose-btn {
    font-size: .78rem;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #0ea5e9;
    background: var(--info-surface);
    color: #0369a1;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.neg-form-row {
    display: flex;
    gap: .4rem;
}

.neg-form-submit {
    flex: 1;
    padding: 5px;
    background: var(--secondary, #1B2A4A);
    color: var(--surface);
    border: none;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.neg-form-cancel {
    padding: 5px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .8rem;
    cursor: pointer;
    font-family: inherit;
}

.neg-form-msg {
    font-size: .78rem;
}

.neg-prop-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-main);
}

.neg-prop-submit {
    flex: 1;
    padding: 5px;
    background: var(--primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.neg-mini-error {
    font-size: .78rem;
    color: var(--danger);
}

/* Archivage */
.arch-mini-loading {
    font-size: .78rem;
    color: var(--text-muted);
}

.arch-none-msg {
    font-size: .78rem;
    color: var(--text-muted);
    margin: .3rem 0;
}

.arch-no-token {
    font-size: .78rem;
    color: var(--warning-surface-text);
}

.arch-date {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-main);
}

.arch-hash {
    font-family: monospace;
    font-size: .7rem;
    color: var(--text-muted);
}

.arch-cert-link {
    font-size: .75rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.arch-btn {
    margin-top: .5rem;
    padding: 5px 14px;
    background: var(--secondary, #1B2A4A);
    color: var(--surface);
    border: none;
    border-radius: 6px;
    font-size: .8rem;
    cursor: pointer;
    font-family: inherit;
}

.arch-msg {
    font-size: .78rem;
    margin-left: .5rem;
}

.arch-mini-error {
    font-size: .78rem;
    color: var(--danger);
}

/* Subscribe banner */
.subscribe-banner {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--success-surface-text);
    color: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Utility */
.ico-mr {
    margin-right: .3rem;
}

/* ── Partage (style block → style.css) ── */
.partage-header {
    background: linear-gradient(135deg, #1B2A4A, #2d4a7a);
    color: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.partage-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .75rem;
    font-size: .85rem;
    opacity: .85;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}

.doc-item:hover {
    background: var(--accent-light);
    border-color: var(--accent);
}

.doc-item.active {
    background: rgb(231, 240, 255); /* fallback */
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-color: var(--accent);
}

.doc-nom {
    flex: 1;
    font-size: .9rem;
    font-weight: 500;
}

.iframe-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--input-bg);
}

.iframe-wrap iframe {
    width: 100%;
    height: 75vh;
    border: none;
    display: block;
}

.badge-partage {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .2);
}

.partage-load-error {
    color: var(--danger);
    font-size: .85rem;
}

/* ── Dossier type (style block + inline → style.css) ── */
.dt-section {
    padding: 3rem 0;
}

.dt-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0 0 1.25rem;
}

.dt-hero {
    background: linear-gradient(145deg, #0d1b2e 0%, #1a2b4b 55%, #1E3A8A 100%);
    color: var(--text-on-dark-bg);
    padding: 3.5rem 1.5rem 3rem;
}

.dt-breadcrumb {
    font-size: .78rem;
    color: rgba(255, 255, 255, .6);
    margin-bottom: 1rem;
}

.dt-breadcrumb a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: .25rem .15rem;
}

.dt-breadcrumb a:hover {
    color: rgba(255, 255, 255, .9);
}

.dt-tag {
    display: inline-block;
    background: rgba(59, 130, 246, .25);
    color: var(--info-surface-border);
    font-size: .75rem;
    font-weight: 700;
    padding: .3rem .8rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dt-hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0 0 .9rem;
    line-height: 1.2;
}

.dt-hero p {
    color: rgba(255, 255, 255, .8);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 2rem;
    max-width: 640px;
}

.dt-cta {
    display: inline-block;
    padding: .9rem 2.2rem;
    background: var(--accent);
    color: var(--text-on-primary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    transition: background .15s, transform .15s;
}

.dt-cta:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.docs-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 2rem;
}

.doc-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: .75rem 1rem;
}

.doc-row-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #1E3A8A, #3b82f6);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-row-txt {
    font-size: .9rem;
    color: var(--text-main);
    font-weight: 500;
}

.dt-cta-bottom {
    background: linear-gradient(145deg, #0d1b2e 0%, #1a2b4b 55%, #1E3A8A 100%);
    color: var(--text-on-dark-bg);
    padding: 3rem 1.5rem;
    text-align: center;
}

.dt-cta-bottom h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 .65rem;
}

.dt-cta-bottom p {
    color: rgba(255, 255, 255, .7);
    margin: 0 0 1.75rem;
    font-size: .95rem;
}

/* ══════════════════════════════════════════════════════════════════
   Dossier Type — FAQ Accordion
   ══════════════════════════════════════════════════════════════════ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.faq-list .faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}

.faq-list .faq-item:hover {
    border-color: rgb(167, 180, 209); /* fallback */
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.faq-list .faq-item.open {
    border-color: rgb(148, 162, 199); /* fallback */
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    box-shadow: 0 2px 12px rgba(30, 58, 138, .08);
}

.faq-list .faq-question {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--text-main);
    user-select: none;
    line-height: 1.4;
    transition: color .15s;
}

.faq-list .faq-question:hover {
    color: var(--primary);
}

.faq-list .faq-arrow {
    font-size: 1rem;
    color: var(--text-muted);
    transition: transform .3s ease;
    flex-shrink: 0;
}

.faq-list .faq-item.open .faq-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-list .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4, 0, .2, 1), padding .35s cubic-bezier(.4, 0, .2, 1);
    padding: 0 1.25rem;
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.faq-list .faq-item.open .faq-answer {
    max-height: 600px;
    padding: 0 1.25rem 1.25rem;
}

/* ==========================================================================
   FORM CARD, INPUTS, STEPPER — base styles
   ========================================================================== */

/* ── Form Card ────────────────────────────────────── */
.form-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--shadow, 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.06));
}

/* ── Inputs — focus ring ────────────────────────── */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.12);
    outline: none;
}

/* ── Stepper — base styles ────────────────────────────── */
.step-number {
    background-color: var(--surface);
    border-color: var(--border-input);
    color: var(--text-muted);
}

.step-dot.active .step-number {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-primary);
    box-shadow: 0 2px 8px rgba(58, 134, 255, 0.25);
}

.step-dot.active {
    color: var(--accent);
}

.step-dot.completed .step-number {
    border-color: var(--success);
    color: var(--success);
    background-color: var(--success-light);
}

/* ── Progress bars — base styles ────────────────────────────────── */
.progress-bar {
    background-color: var(--bg);
    border: 1px solid var(--border);
    height: 6px;
    border-radius: 4px;
}

.progress-fill {
    background: var(--success);
    border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   Magic Upload — Analyseur Omnivore
   --------------------------------------------------------------------------- */
.magic-upload-section {
    margin-bottom: 1.5rem;
}

.magic-dropzone {
    border: 2px dashed var(--text-muted);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-muted);
}

.magic-dropzone:hover,
.magic-dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.magic-dropzone p {
    margin: 0.5rem 0 0;
}

.magic-dropzone .magic-hint {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.magic-spinner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
    color: var(--accent);
    font-weight: 500;
}

.magic-spinner .spinner-ring {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.magic-result {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.5rem;
}

.magic-result.magic-success {
    color: var(--success);
    font-weight: 500;
}

.magic-result.magic-error {
    color: var(--danger);
    font-weight: 500;
}

.magic-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.magic-separator::before,
.magic-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Dark theme */
:root.theme-dark .magic-dropzone {
    border-color: #475569;
    color: #94a3b8;
}

:root.theme-dark .magic-dropzone:hover,
:root.theme-dark .magic-dropzone.drag-over {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.06);
    color: #60a5fa;
}

:root.theme-dark .magic-separator {
    color: #64748b;
}

:root.theme-dark .magic-separator::before,
:root.theme-dark .magic-separator::after {
    background: #334155;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .magic-dropzone {
        border-color: #475569;
        color: #94a3b8;
    }
    :root:not(.theme-light) .magic-dropzone:hover,
    :root:not(.theme-light) .magic-dropzone.drag-over {
        border-color: #60a5fa;
        background: rgba(96, 165, 250, 0.06);
        color: #60a5fa;
    }
    :root:not(.theme-light) .magic-separator {
        color: #64748b;
    }
    :root:not(.theme-light) .magic-separator::before,
    :root:not(.theme-light) .magic-separator::after {
        background: #334155;
    }
}

/* Magic Upload — Alertes juridiques V2 */
.magic-alertes {
    margin-top: 0.75rem;
    border: 1px solid var(--warning-surface-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    background: rgba(251, 191, 36, 0.06);
}

.magic-alertes-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--warning-surface-text);
    margin-bottom: 0.5rem;
}

.magic-alerte {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.magic-alerte + .magic-alerte {
    border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.magic-alerte-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--warning-surface);
    color: var(--warning-surface-text);
}

.magic-alerte-desc {
    flex: 1;
    color: var(--text-main);
}

.magic-alerte-ref {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

:root.theme-dark .magic-alertes {
    border-color: #78350f;
    background: rgba(251, 191, 36, 0.04);
}

:root.theme-dark .magic-alertes-title {
    color: #fbbf24;
}

:root.theme-dark .magic-alerte-desc {
    color: #cbd5e1;
}

:root.theme-dark .magic-alerte-ref {
    color: #94a3b8;
}

:root.theme-dark .magic-alerte-badge {
    background: rgba(254, 243, 199, 0.1);
    color: #fbbf24;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .magic-alertes {
        border-color: #78350f;
        background: rgba(251, 191, 36, 0.04);
    }
    :root:not(.theme-light) .magic-alertes-title {
        color: #fbbf24;
    }
    :root:not(.theme-light) .magic-alerte-desc {
        color: #cbd5e1;
    }
    :root:not(.theme-light) .magic-alerte-ref {
        color: #94a3b8;
    }
    :root:not(.theme-light) .magic-alerte-badge {
        background: rgba(254, 243, 199, 0.1);
        color: #fbbf24;
    }
}

/* V3 — Intérêts de retard */
.magic-interets {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--success-surface), #d1fae5);
    border-radius: 0.5rem;
    border-left: 4px solid var(--success);
}

.magic-interet-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--success-surface-text);
}

.magic-interet-icon {
    font-size: 1.1rem;
}

.magic-interet-ref {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* V3 — Jurisprudences RAG */
.magic-jurisprudences {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    background: var(--info-surface);
    border-radius: 0.5rem;
    border-left: 4px solid var(--indigo);
}

.magic-jurisprudences-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--indigo);
    margin-bottom: 0.5rem;
}

.magic-jurisprudence {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    padding: 0.4rem 0;
}

.magic-jurisprudence + .magic-jurisprudence {
    border-top: 1px solid rgba(99, 102, 241, 0.15);
}

.magic-jurisprudence-ref {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--indigo);
}

.magic-jurisprudence-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.magic-jurisprudence-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-basis: 100%;
}

/* V3 — Dark theme */
:root.theme-dark .magic-interets {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: #34d399;
}

:root.theme-dark .magic-interet-badge {
    color: #6ee7b7;
}

:root.theme-dark .magic-interet-ref {
    color: #9ca3af;
}

:root.theme-dark .magic-jurisprudences {
    background: rgba(99, 102, 241, 0.08);
    border-left-color: #818cf8;
}

:root.theme-dark .magic-jurisprudences-title {
    color: #a5b4fc;
}

:root.theme-dark .magic-jurisprudence-ref {
    color: #a5b4fc;
}

:root.theme-dark .magic-jurisprudence-desc {
    color: #d1d5db;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .magic-interets {
        background: rgba(16, 185, 129, 0.08);
        border-left-color: #34d399;
    }
    :root:not(.theme-light) .magic-interet-badge {
        color: #6ee7b7;
    }
    :root:not(.theme-light) .magic-interet-ref {
        color: #9ca3af;
    }
    :root:not(.theme-light) .magic-jurisprudences {
        background: rgba(99, 102, 241, 0.08);
        border-left-color: #818cf8;
    }
    :root:not(.theme-light) .magic-jurisprudences-title {
        color: #a5b4fc;
    }
    :root:not(.theme-light) .magic-jurisprudence-ref {
        color: #a5b4fc;
    }
    :root:not(.theme-light) .magic-jurisprudence-desc {
        color: #d1d5db;
    }
}

/* ==========================================================================
   LIGHT MODE — Sections à gradient sombre (partage, dossier type, doc-items)
   Correctifs contraste thème clair — ajoutés v10.7
   ========================================================================== */

/* ── Partage header ── */
:root.theme-light .partage-header {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    color: var(--secondary);
}
:root.theme-light .badge-partage {
    background: rgba(26, 43, 75, 0.1);
    color: var(--text-main);
}
@media (prefers-color-scheme: light) {
    :root:not(.theme-dark) .partage-header {
        background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
        color: var(--secondary);
    }
    :root:not(.theme-dark) .badge-partage {
        background: rgba(26, 43, 75, 0.1);
        color: var(--text-main);
    }
}

/* ── Dossier type hero + CTA bas de page ── */
@media (prefers-color-scheme: light) {
    :root:not(.theme-dark) .dt-hero,
    :root:not(.theme-dark) .dt-cta-bottom {
        background: linear-gradient(145deg, #EFF6FF 0%, #DBEAFE 60%, #E0E7FF 100%);
        color: var(--secondary);
    }
    :root:not(.theme-dark) .dt-breadcrumb,
    :root:not(.theme-dark) .dt-breadcrumb a {
        color: var(--text-muted);
    }
    :root:not(.theme-dark) .dt-breadcrumb a:hover {
        color: var(--text-main);
    }
    :root:not(.theme-dark) .dt-tag {
        background: rgba(59, 130, 246, 0.12);
        border: 1px solid rgba(59, 130, 246, 0.3);
        color: var(--accent);
    }
    :root:not(.theme-dark) .dt-hero p {
        color: var(--text-secondary);
    }
    :root:not(.theme-dark) .dt-cta-bottom h2 {
        color: var(--secondary);
    }
    :root:not(.theme-dark) .dt-cta-bottom p {
        color: var(--text-secondary);
    }
}
:root.theme-light .dt-hero,
:root.theme-light .dt-cta-bottom {
    background: linear-gradient(145deg, #EFF6FF 0%, #DBEAFE 60%, #E0E7FF 100%);
    color: var(--secondary);
}
:root.theme-light .dt-breadcrumb,
:root.theme-light .dt-breadcrumb a {
    color: var(--text-muted);
}
:root.theme-light .dt-breadcrumb a:hover {
    color: var(--text-main);
}
:root.theme-light .dt-tag {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent);
}
:root.theme-light .dt-hero p {
    color: var(--text-secondary);
}
:root.theme-light .dt-cta-bottom h2 {
    color: var(--secondary);
}
:root.theme-light .dt-cta-bottom p {
    color: var(--text-secondary);
}

/* ── Doc-row icon ── */
.doc-row-icon {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
}

/* ── Doc-item hover/active — dark mode explicite ── */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .doc-item:hover {
        background: rgba(14, 165, 233, 0.1);
        border-color: #0ea5e9;
    }
    :root:not(.theme-light) .doc-item.active {
        background: rgba(14, 165, 233, 0.15);
        border-color: #0ea5e9;
    }
}
:root.theme-dark .doc-item:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: #0ea5e9;
}
:root.theme-dark .doc-item.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: #0ea5e9;
}

/* ── Legal Trust Badge — signal de confiance audit Legifrance ── */
.legal-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 1.5rem auto;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    background: rgb(236, 242, 251); /* fallback */
    background: color-mix(in srgb, var(--accent, #3A86FF) 6%, var(--surface, #F7F8FB));
    border: 1px solid rgba(59, 130, 246, 0.15); /* fallback */
    border: 1px solid color-mix(in srgb, var(--accent, #3A86FF) 15%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: center;
    width: fit-content;
}
.legal-trust-badge svg {
    color: var(--success);
    flex-shrink: 0;
}
.legal-trust-badge__sep {
    width: 1px;
    height: 0.9rem;
    background: rgba(59, 130, 246, 0.2); /* fallback */
    background: color-mix(in srgb, var(--accent, #3A86FF) 20%, transparent);
}
.legal-trust-badge__date {
    opacity: 0.7;
    font-size: 0.72rem;
}
:root.theme-dark .legal-trust-badge {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.15);
}
:root.theme-dark .legal-trust-badge svg {
    color: #4ade80;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .legal-trust-badge {
        background: rgba(59, 130, 246, 0.08);
        border-color: rgba(59, 130, 246, 0.15);
    }
    :root:not(.theme-light) .legal-trust-badge svg {
        color: #4ade80;
    }
}

/* ============================================================
   UX Phase 5 — Micro-interactions, inline errors, skeletons
   ============================================================ */

/* Button press feedback */
.btn-hero:active,
.btn-plan:active,
.ct-btn:active,
.btn-primary:active,
[type="submit"]:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Async loading state for buttons (Stripe checkout, form submit) */
.btn-async-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-async-loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Inline form validation error messages */
.field-error-msg {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
    font-weight: 500;
    animation: fadeInUp 0.2s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading placeholders */
.skeleton {
    background: linear-gradient(90deg,
        var(--border) 25%,
        var(--surface-raised, var(--surface)) 50%,
        var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
.skeleton-card {
    height: 120px;
    border-radius: var(--radius);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reduced motion: disable all new animations */
@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; background: var(--border); }
    .field-error-msg { animation: none; }
    .btn-hero:active, .btn-plan:active, .ct-btn:active,
    .btn-primary:active, [type="submit"]:active {
        transform: none;
    }
}

/* ==========================================================================
   LIGHT MODE — specific overrides (not covered by var() alone)
   ========================================================================== */

/* Dark buttons stay dark in light mode (intentional) */
:root.theme-light .btn-action-dark,
:root.theme-light .reprendre-btn,
:root.theme-light .neg-form-submit,
:root.theme-light .arch-btn,
:root.theme-light .score-close-btn {
    background: #1E3A8A;
    color: #fff;
}
/* ── Upgrade box ── */
:root.theme-light .upgrade-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-color: #bae6fd;
}

/* ── Freemium banner ── */
:root.theme-light .freemium-banner {
    background: linear-gradient(90deg, #e0f2fe, #dbeafe);
    border-color: #93c5fd;
    color: #1e40af;
}

/* ── Badge paid/pending (admin) ── */
.badge-paid {
    background: var(--success-light);
    color: var(--success-surface-text);
}
.badge-pending {
    background: var(--warning-light);
    color: var(--warning-surface-text);
}

/* ── Parrainage box ── */
:root.theme-light .parrainage-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
}

/* ==========================================================================
   HERO LIGHT MODE — Override global toutes pages
   Classes : .mkt-hero, .mkd-hero, .res-hero, .about-hero, .tarifs-hero,
             .blog-hero, .ann-hero, .author-hero, .art-hero
   (.hero et .dt-hero ont déjà leurs overrides dans landing.css / plus haut)
   ========================================================================== */

/* ── prefers-color-scheme: light (automatique) ── */
@media (prefers-color-scheme: light) {
    :root:not(.theme-dark) .mkt-hero,
    :root:not(.theme-dark) .mkd-hero,
    :root:not(.theme-dark) .res-hero,
    :root:not(.theme-dark) .about-hero,
    :root:not(.theme-dark) .tarifs-hero,
    :root:not(.theme-dark) .blog-hero,
    :root:not(.theme-dark) .ann-hero,
    :root:not(.theme-dark) .author-hero,
    :root:not(.theme-dark) .art-hero {
        background: linear-gradient(135deg, #EFF6FF 0%, #F0F4FF 50%, #F8FAFC 100%) !important;
        color: var(--secondary) !important;
    }
    :root:not(.theme-dark) .mkt-hero::before,
    :root:not(.theme-dark) .mkd-hero::before {
        display: none !important;
    }
    :root:not(.theme-dark) .mkt-hero h1,
    :root:not(.theme-dark) .mkd-hero h1,
    :root:not(.theme-dark) .res-hero h1,
    :root:not(.theme-dark) .about-hero h1,
    :root:not(.theme-dark) .tarifs-hero h1,
    :root:not(.theme-dark) .blog-hero h1,
    :root:not(.theme-dark) .ann-hero h1,
    :root:not(.theme-dark) .author-hero h1,
    :root:not(.theme-dark) .art-hero h1 {
        color: var(--secondary) !important;
    }
    :root:not(.theme-dark) .mkt-hero p,
    :root:not(.theme-dark) .mkd-hero p,
    :root:not(.theme-dark) .mkd-hero-desc,
    :root:not(.theme-dark) .res-hero p,
    :root:not(.theme-dark) .res-hero .intro,
    :root:not(.theme-dark) .about-hero p,
    :root:not(.theme-dark) .tarifs-hero p,
    :root:not(.theme-dark) .blog-hero p,
    :root:not(.theme-dark) .ann-hero p,
    :root:not(.theme-dark) .author-hero p,
    :root:not(.theme-dark) .art-hero .intro {
        color: var(--text-secondary) !important;
    }
    :root:not(.theme-dark) .mkt-hero-badge,
    :root:not(.theme-dark) .mkd-hero-badge,
    :root:not(.theme-dark) .res-hero .badge,
    :root:not(.theme-dark) .art-hero .art-cat {
        background: rgba(59, 130, 246, 0.1) !important;
        border-color: rgba(59, 130, 246, 0.3) !important;
        color: var(--accent) !important;
    }
}

/* ── :root.theme-light (toggle utilisateur) ── */
:root.theme-light .mkt-hero,
:root.theme-light .mkd-hero,
:root.theme-light .res-hero,
:root.theme-light .about-hero,
:root.theme-light .tarifs-hero,
:root.theme-light .blog-hero,
:root.theme-light .ann-hero,
:root.theme-light .author-hero,
:root.theme-light .art-hero,
:root.theme-light .faq-hero,
:root.theme-light .di-hero,
:root.theme-light .hub-hero,
:root.theme-light .contact-hero,
:root.theme-light .trial-hero {
    background: linear-gradient(135deg, #EFF6FF 0%, #F0F4FF 50%, #F8FAFC 100%) !important;
    background-color: #EFF6FF !important;
    color: var(--text-main) !important;
}
:root.theme-light .mkt-hero::before,
:root.theme-light .mkd-hero::before,
:root.theme-light .faq-hero::before {
    display: none !important;
}
:root.theme-light .mkt-hero h1,
:root.theme-light .mkd-hero h1,
:root.theme-light .res-hero h1,
:root.theme-light .about-hero h1,
:root.theme-light .tarifs-hero h1,
:root.theme-light .blog-hero h1,
:root.theme-light .ann-hero h1,
:root.theme-light .author-hero h1,
:root.theme-light .art-hero h1,
:root.theme-light .faq-hero h1,
:root.theme-light .di-hero h1,
:root.theme-light .hub-hero h1,
:root.theme-light .contact-hero h1,
:root.theme-light .trial-hero h1 {
    color: var(--text-main) !important;
}
:root.theme-light .mkt-hero p,
:root.theme-light .mkd-hero p,
:root.theme-light .mkd-hero-desc,
:root.theme-light .res-hero p,
:root.theme-light .res-hero .intro,
:root.theme-light .about-hero p,
:root.theme-light .tarifs-hero p,
:root.theme-light .blog-hero p,
:root.theme-light .ann-hero p,
:root.theme-light .author-hero p,
:root.theme-light .art-hero .intro,
:root.theme-light .faq-hero p,
:root.theme-light .di-hero p,
:root.theme-light .hub-hero p,
:root.theme-light .hub-hero .intro,
:root.theme-light .contact-hero p,
:root.theme-light .trial-hero p {
    color: var(--text-secondary) !important;
}
:root.theme-light .mkt-hero-badge,
:root.theme-light .mkd-hero-badge,
:root.theme-light .res-hero .badge,
:root.theme-light .art-hero .art-cat,
:root.theme-light .faq-hero .badge,
:root.theme-light .di-hero .badge,
:root.theme-light .hub-hero .badge,
:root.theme-light .trial-hero .badge {
    background: rgba(58, 134, 255, 0.1) !important;
    border-color: rgba(58, 134, 255, 0.3) !important;
    color: var(--accent) !important;
}

/* ── Breadcrumbs dans les heros (texte blanc→muted en light) ── */
:root.theme-light .res-breadcrumb,
:root.theme-light .res-breadcrumb a,
:root.theme-light .art-breadcrumb,
:root.theme-light .art-breadcrumb a {
    color: var(--text-muted) !important;
}
:root.theme-light .res-breadcrumb a:hover,
:root.theme-light .art-breadcrumb a:hover {
    color: var(--text-main) !important;
}
@media (prefers-color-scheme: light) {
    :root:not(.theme-dark) .res-breadcrumb,
    :root:not(.theme-dark) .res-breadcrumb a,
    :root:not(.theme-dark) .art-breadcrumb,
    :root:not(.theme-dark) .art-breadcrumb a {
        color: var(--text-muted) !important;
    }
    :root:not(.theme-dark) .res-breadcrumb a:hover,
    :root:not(.theme-dark) .art-breadcrumb a:hover {
        color: var(--text-main) !important;
    }
}
/* ── FAQ hero — search bar light mode (texte invisible si blanc sur clair) ── */
:root.theme-light .faq-search {
    background: rgba(30, 58, 138, 0.06) !important;
    border-color: var(--border-input) !important;
    color: var(--text-main) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
:root.theme-light .faq-search::placeholder {
    color: var(--text-muted) !important;
}
:root.theme-light .faq-search:focus {
    border-color: var(--accent) !important;
    background: var(--surface) !important;
}
:root.theme-light .faq-search-wrap svg {
    color: var(--text-muted) !important;
}
/* ==========================================================================
   CROSS-BROWSER COMPATIBILITY — Hero gradients + input resets + placeholders
   Chrome 90+, Firefox 90+, Safari 14+, Edge 90+, iOS Safari 14+
   ========================================================================== */

/* ── Hero gradient fallback pour anciens navigateurs ── */
:root.theme-light .mkt-hero,
:root.theme-light .mkd-hero,
:root.theme-light .res-hero,
:root.theme-light .about-hero,
:root.theme-light .tarifs-hero,
:root.theme-light .blog-hero,
:root.theme-light .ann-hero,
:root.theme-light .author-hero,
:root.theme-light .art-hero,
:root.theme-light .hero,
:root.theme-light .dt-hero,
:root.theme-light .faq-hero,
:root.theme-light .di-hero,
:root.theme-light .hub-hero,
:root.theme-light .contact-hero,
:root.theme-light .trial-hero {
    background-color: #EFF6FF; /* fallback si gradient non supporté */
}

/* ── Placeholder opacity Firefox ── */
input::-moz-placeholder,
textarea::-moz-placeholder {
    opacity: 1;
    color: var(--text-muted);
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   FEEDBACK SURFACES — semantic utility classes (light/dark responsive)
   ========================================================================== */
.feedback-success {
    background: var(--success-surface);
    border: 1px solid var(--success-surface-border);
    color: var(--success-surface-text);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-size: .95rem;
    line-height: 1.6;
}
.feedback-error {
    background: var(--danger-surface);
    border: 1px solid var(--danger-surface-border);
    color: var(--danger-surface-text);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: .9rem;
}
.feedback-warning {
    background: var(--warning-surface);
    border: 1px solid var(--warning-surface-border);
    color: var(--warning-surface-text);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-size: .95rem;
    text-align: center;
}

/* ==========================================================================
   RESPONSIVE — Mobile-first media queries
   ========================================================================== */

/* ── Mobile ≤ 640px ── */
@media (max-width: 640px) {
    /* Hero sections */
    .hero h1,
    .faq-hero h1,
    .tarifs-hero h1,
    .di-hero h1,
    .hub-hero h1,
    .blog-hero h1,
    .contact-hero h1,
    .about-hero h1,
    .author-hero h1,
    .ann-hero h1,
    .trial-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    }

    .hero,
    .faq-hero,
    .tarifs-hero,
    .di-hero,
    .hub-hero,
    .blog-hero,
    .contact-hero,
    .about-hero,
    .author-hero,
    .ann-hero,
    .art-hero,
    .res-hero,
    .mkt-hero,
    .mkd-hero,
    .dt-hero,
    .trial-hero {
        padding: 2rem 1rem !important;
    }

    /* Sections padding */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Stats bar stack */
    .stats-bar,
    .hero-stats {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* Grid cards → single column */
    .grid-3,
    .grid-4,
    .features-grid,
    .creer-features .features-grid {
        grid-template-columns: 1fr !important;
    }

    /* Pricing cards stack */
    .pricing-cards,
    .tarifs-grid {
        grid-template-columns: 1fr !important;
    }

    /* CTA buttons stack */
    .cta-group,
    .hero-cta,
    .faq-cta-btns {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    .cta-group a,
    .cta-group button,
    .hero-cta a,
    .hero-cta button,
    .faq-cta-btns .btn {
        width: 100% !important;
        text-align: center !important;
    }

    /* Tables overflow */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* Touch targets min 48px */
    .btn,
    .faq-cat,
    .faq-question,
    a.btn-hero,
    a.btn-hero-outline,
    button {
        min-height: 48px;
    }

    /* Prevent iOS zoom on inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Blog cards stack */
    .blog-grid {
        grid-template-columns: 1fr !important;
    }

    /* Annuaire cards stack */
    .ann-grid {
        grid-template-columns: 1fr !important;
    }

    /* Dossier index cards stack */
    .di-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hub calculators stack */
    .hub-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ── Tablet 641px — 1024px ── */
@media (min-width: 641px) and (max-width: 1024px) {
    .grid-3,
    .grid-4,
    .features-grid,
    .creer-features .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .pricing-cards,
    .tarifs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .ann-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .di-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hub-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================================================
   CROSS-BROWSER — iOS Safari, Firefox, vendor prefixes
   ========================================================================== */

/* ── iOS Safari input reset ── */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ── iOS Safari smooth scroll on overflow ── */
.table-wrapper,
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* ── Firefox scrollbar ── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ── Safari backdrop-filter ── */
.header,
.faq-search {
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* ==========================================================================
   RESPONSIVE MOBILE — Samsung Galaxy S25 Ultra (412px CSS viewport)
   Audit 2026-03-19 : header, wizard stepper, inputs, upload, chatbot, pills
   ========================================================================== */

/* ── 1. Global overflow prevention ── */
@media (max-width: 768px) {
    *, *::before, *::after {
        box-sizing: border-box;
    }
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    .container,
    .main,
    .main-content,
    section,
    .form-card,
    .wizard-layout,
    .upload-zone,
    .magic-dropzone {
        max-width: 100vw;
        min-width: 0;
        box-sizing: border-box;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .form-card {
        margin-left: .75rem;
        margin-right: .75rem;
    }

    /* ── 2. Header: burger à gauche, theme toggle à droite, CTA dans mobile-nav ── */
    .header-inner { position: relative; }
    .hamburger-btn {
        display: block;
        position: absolute;
        left: .75rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }
    .logo { margin-left: 2.75rem; }
    .header-nav-actions .header-nav-link,
    .header-nav-actions .nav-dropdown,
    .header-nav-actions .btn-header-login,
    .header-nav-actions .btn-header-signup {
        display: none;
    }

    /* ── 3. All form inputs: prevent overflow ── */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    select,
    textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ── 4. Upload zones: prevent text overflow ── */
    .upload-zone,
    .magic-dropzone {
        max-width: 100%;
        overflow: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .upload-zone p,
    .upload-zone span,
    .magic-dropzone p,
    .magic-dropzone .magic-hint {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* ── 5. Type pills (Particulier / Professionnel): prevent truncation ── */
    .user-type-selector {
        flex-wrap: wrap;
    }
    .type-pill {
        min-width: 0;
        font-size: 0.8rem;
        padding: 0.55rem 0.25rem;
        word-break: break-word;
    }

    /* ── 6. Headings: fluid sizing ── */
    h1 { font-size: clamp(1.5rem, 6vw, 2.5rem); }
    h2 { font-size: clamp(1.25rem, 5vw, 2rem); }
    .page-header h1 { font-size: clamp(1.375rem, 5.5vw, 2rem); }

    /* ── 7. Grids: stack on mobile ── */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .cta-group,
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    .cta-group a,
    .cta-group button,
    .btn-group a,
    .btn-group button {
        width: 100%;
        text-align: center;
    }

    /* ── 8. Tables: horizontal scroll ── */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── 9. Chatbot FAB: smaller on mobile ── */
    .chatbot-fab {
        width: 44px;
        height: 44px;
    }
    .chatbot-fab svg {
        width: 20px;
        height: 20px;
    }
    .chatbot-fab-badge {
        width: 10px;
        height: 10px;
    }
    .chatbot-fab-tooltip {
        display: none;
    }
}

/* ── 10. Wizard stepper: scrollable + hide scrollbar on small screens ── */
@media (max-width: 640px) {
    .v-steps {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding: 0.25rem;
    }
    .v-steps::-webkit-scrollbar {
        display: none;
    }
    .v-step {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.4rem 0.35rem;
        min-width: 56px;
        flex-shrink: 0;
        text-align: center;
        font-size: 0.7rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 8px 8px 0 0;
    }
    .v-step.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }
    .v-step.completed {
        border-left-color: transparent;
        border-bottom-color: var(--success);
    }
    .v-step-num {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 0.65rem;
    }
    .v-step-label {
        font-size: 0.65rem;
    }

    /* Category grid: 2 columns minimum */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .category-card {
        padding: 0.75rem 0.5rem;
    }
    .cat-name {
        font-size: 0.75rem;
    }
    .cat-desc {
        font-size: 0.65rem;
    }

    /* Urgence grid: stack */
    .urgence-grid {
        grid-template-columns: 1fr;
    }

    /* Step header: compact */
    .step-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ── 11. Very small screens (≤375px) ── */
@media (max-width: 375px) {
    .container {
        padding-left: .75rem;
        padding-right: .75rem;
    }
    .form-card {
        margin-left: .5rem;
        margin-right: .5rem;
        padding: 1rem;
    }
    .category-grid {
        grid-template-columns: 1fr;
    }
    .form-grid.addr-grid {
        grid-template-columns: 1fr;
    }
    .type-pill {
        flex: 1 1 100%;
    }
    .user-type-selector {
        flex-wrap: wrap;
    }
    .adverse-card {
        padding: 1rem;
    }
    .upload-zone {
        padding: 1.25rem .75rem;
    }
    .magic-dropzone {
        padding: 1.25rem .75rem;
    }
    .toast {
        right: .75rem;
        left: .75rem;
        max-width: none;
    }
}

/* ==========================================================================
   TOAST NOTIFICATIONS — Accessible (role=alert)
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    color: var(--text-on-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}
.toast-visible { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--success, #10B981); }
.toast-error { background: var(--danger, #EF4444); }
.toast-info { background: var(--accent, #3B82F6); }
.toast-warning { background: var(--warning, #F59E0B); color: #1a1a1a; }

/* ==========================================================================
   BLOG ARTICLE — Reusable content components
   ========================================================================== */

/* Marketplace promo banner (dark mode compatible) */
.mkt-promo {
    margin: 24px 0;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    font-size: 0.95em;
    color: var(--text-main);
}
.mkt-promo strong { color: var(--text-main); }
.mkt-promo a { color: var(--primary); font-weight: 600; }
.mkt-promo a:hover { text-decoration: underline; }

/* CTA banner (dark mode compatible) */
.calc-cta {
    margin: 24px 0;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}
.calc-cta .calc-cta__text {
    margin: 0 0 0.5rem;
    font-size: 0.95em;
    color: var(--text-main);
}
.calc-cta .calc-cta__btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: var(--text-on-primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    transition: opacity 0.15s;
}
.calc-cta .calc-cta__btn:hover { opacity: 0.85; }

/* Steps grid — "Procédure en N étapes" */
.art-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.art-step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 10px;
}
.art-step-card h4 {
    color: var(--primary);
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
}
.art-step-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Pitfalls grid — "Pièges fréquents / Erreurs à éviter" */
.art-pitfalls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.art-pitfall-card {
    background: var(--danger-surface);
    border-left: 4px solid var(--danger);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
}
.art-pitfall-card strong {
    color: var(--danger-surface-text, var(--text-main));
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}
.art-pitfall-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Upsell Cards — Tunnel de Conversion (Phase 11) ── */
.upsell-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0 0.5rem;
}

.upsell-card {
    position: relative;
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.upsell-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* Standard card — no extra treatment */
.upsell-card--standard {
    border-color: var(--border-card);
}

/* Premium card — glassmorphism + accent glow */
.upsell-card--premium {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 2px solid var(--accent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 20px color-mix(in srgb, var(--success) 18%, transparent);
}

.upsell-card--premium:hover {
    box-shadow: 0 0 28px color-mix(in srgb, var(--success) 30%, transparent);
    transform: translateY(-2px);
}

/* Badge */
.upsell-card__badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.upsell-card__badge--standard {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.upsell-card__badge--premium {
    background: var(--success-surface);
    color: var(--success-surface-text);
}

/* Typography */
.upsell-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.upsell-card__desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
    flex: 1;
}

.upsell-card__price {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.upsell-card--premium .upsell-card__price {
    color: var(--accent);
}

/* CTA Button */
.upsell-card__btn {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.45rem 1rem;
    border-radius: 7px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s, transform 0.15s;
}

.upsell-card__btn--standard {
    background: var(--surface);
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.upsell-card__btn--standard:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    opacity: 1;
}

.upsell-card__btn--premium {
    background: var(--accent);
    color: var(--text-on-primary);
    border: none;
}

.upsell-card__btn--premium:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* Responsive — single column on mobile */
@media (max-width: 768px) {
    .upsell-container {
        grid-template-columns: 1fr;
    }
}

/* Dark mode — premium card glass needs explicit override for correct tint */
:root.theme-dark .upsell-card--premium {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
}

:root.theme-dark .upsell-card__badge--standard {
    background: var(--bg-overlay);
    border-color: var(--border-muted);
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .upsell-card--premium {
        background: color-mix(in srgb, var(--primary) 12%, var(--surface));
        box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent);
    }
    :root:not(.theme-light) .upsell-card__badge--standard {
        background: var(--bg-overlay);
        border-color: var(--border-muted);
    }
}
