/**
 * Module « Mon dossier ISN ».
 *
 * Ne redéclare rien de ce que `mt-shell.css` porte déjà : champs, boutons,
 * alertes, `.mt-cluster`, `.mt-list`, `.mt-empty` viennent de là. Ce fichier
 * n'ajoute que ce qui lui est propre — les cartes de culture, le bloc
 * identité, le total. Mêmes crans (`--mt-*`), tout en px (thème agrikole,
 * `html{font-size:62.5%}`, les rem sont un piège).
 */

/* ----- En-tête de page --------------------------------------------------- */

.mt-isn-dossier__hd {
    padding-bottom: var(--mt-space-4, 16px);
    border-bottom: 1px solid var(--mt-line, #e5dfd4);
}

.mt-isn-dossier__hd h2 { margin-bottom: var(--mt-space-2, 8px); }

.mt-isn-dossier__lede {
    max-width: 70ch;
    margin: 0 0 var(--mt-space-3, 12px);
    color: var(--mt-text, #3c4139);
    font-size: var(--mt-fs-body, 16px);
}

.mt-isn-dossier__pas-indemnisation p { margin: 0; max-width: 70ch; }
.mt-isn-dossier__pas-indemnisation p + p { margin-top: var(--mt-space-2, 8px); }

/* ----- Les deux volets ---------------------------------------------------- */

/* POST_MORTEM #3 : un `display` d'auteur bat le `[hidden]` du user-agent par
   origine de cascade. Ce volet n'en a pas aujourd'hui — la règle est le garde-fou
   pour le jour où on lui en donnera un. */
.mt-isn-dossier__etape[hidden] { display: none; }

/* Volet ciblé par le focus au changement d'étape : pas de halo, il n'est pas
   cliquable — le lecteur d'écran, lui, y trouve son point de reprise. */
.mt-isn-dossier__etape:focus { outline: none; }

.mt-isn-dossier__suite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mt-space-3, 12px) var(--mt-space-4, 16px);
    margin-top: var(--mt-space-5, 24px);
    padding: var(--mt-space-4, 16px);
    background: var(--mt-surface-warm, #f4efe7);
    border-radius: var(--mt-radius-lg, 16px);
}

.mt-isn-dossier__suite p {
    flex: 1 1 320px;
    max-width: 70ch;
    margin: 0;
    color: var(--mt-text, #3c4139);
    font-size: var(--mt-fs-body, 16px);
}

.mt-isn-dossier__suite strong { color: var(--mt-ink, #2b3128); }
.mt-isn-dossier__suite .mt-btn { flex: none; }

/* ----- Étape 2 : les deux sorties ----------------------------------------- */

.mt-isn-dossier__sorties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--mt-space-3, 12px);
}

.mt-isn-dossier__sortie {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--mt-space-2, 8px);
    padding: var(--mt-space-4, 16px);
    background: var(--mt-surface, #fff);
    border: 1px solid var(--mt-line, #e5dfd4);
    border-radius: var(--mt-radius-lg, 16px);
}

.mt-isn-dossier__sortie h4 {
    margin: 0;
    color: var(--mt-brand-strong, #14655f);
    font-size: var(--mt-fs-title, 18px);
    font-weight: 700;
}

.mt-isn-dossier__sortie p {
    max-width: 60ch;
    margin: 0;
    color: var(--mt-text, #3c4139);
    font-size: var(--mt-fs-annex, 13.5px);
}

.mt-isn-dossier__officiel {
    margin-top: var(--mt-space-4, 16px);
}

.mt-isn-dossier__officiel p { max-width: 70ch; margin: 0; }
.mt-isn-dossier__officiel p + p { margin-top: var(--mt-space-2, 8px); }

.mt-isn-dossier__final {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-3, 12px);
    margin-top: var(--mt-space-6, 32px);
    padding-top: var(--mt-space-4, 16px);
    border-top: 1px solid var(--mt-line, #e5dfd4);
}

/* ----- Les sources du barème ---------------------------------------------- */

.mt-isn-dossier__method h4 {
    margin: var(--mt-space-4, 16px) 0 var(--mt-space-2, 8px);
    color: var(--mt-brand-strong, #14655f);
    font-size: var(--mt-fs-body, 16px);
    font-weight: 700;
}

.mt-isn-dossier__sources li { max-width: 70ch; }
.mt-isn-dossier__sources li + li { margin-top: var(--mt-space-2, 8px); }

/* ----- Étapes ------------------------------------------------------------- */

.mt-isn-dossier__step { margin-top: var(--mt-space-6, 32px); }

.mt-isn-dossier__h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--mt-space-3, 12px);
}

.mt-isn-dossier__h-act {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2, 8px);
    margin-left: auto;
}

.mt-isn-dossier__n {
    display: grid;
    flex: none;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #fff;
    font-size: var(--mt-fs-annex, 13.5px);
    font-weight: 700;
    background: var(--mt-brand, #1a8781);
    border-radius: var(--mt-radius-pill, 999px);
}

.mt-isn-dossier__hint {
    max-width: 70ch;
    margin: 0 0 var(--mt-space-4, 16px);
}

.mt-isn-dossier__f-full { grid-column: 1 / -1; }

/* Le bloc Irrigation n'apparaît que pour l'aléa sécheresse, à la suite des
   champs de l'étape : il lui faut sa respiration et son filet, sinon son titre
   flotte sous le champ précédent. Et son titre est un intitulé de GROUPE — même
   encre que les libellés voisins, pas le teal des titres d'étape, qui le
   faisait passer pour une section de plus. */
.mt-isn-dossier__irrigation {
    margin-top: var(--mt-space-5, 24px);
    padding-top: var(--mt-space-4, 16px);
    border-top: 1px solid var(--mt-line, #e5dfd4);
}

.mt-isn-dossier__irrigation[hidden] { display: none; }

.mt-isn-dossier__irrigation h4 {
    margin: 0 0 var(--mt-space-1, 4px);
    color: var(--mt-ink, #2b3128);
    font-size: var(--mt-fs-body, 16px);
    font-weight: 700;
}

.mt-isn-dossier__irrigation .mt-note { margin: 0 0 var(--mt-space-3, 12px); }

/* ----- Étape 3 : les cultures --------------------------------------------- */

.mt-isn-dossier__card {
    background: var(--mt-surface, #fff);
    border: 1px solid var(--mt-line, #e5dfd4);
    border-radius: var(--mt-radius-lg, 16px);
    box-shadow: var(--mt-shadow-sm, 0 1px 2px rgba(43, 49, 40, .06));
}

/* Le chevron d'une carte repliée : le nom de la culture et son estimation, et
   rien d'autre — c'est tout ce qui reste visible d'une carte fermée. */
.mt-isn-dossier__sum {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mt-space-2, 8px) var(--mt-space-3, 12px);
    padding: var(--mt-space-3, 12px) var(--mt-space-4, 16px);
    list-style: none;
    cursor: pointer;
}

.mt-isn-dossier__sum::-webkit-details-marker { display: none; }

.mt-isn-dossier__sum::after {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 3px;
    border-right: 2px solid var(--mt-muted, #6c7266);
    border-bottom: 2px solid var(--mt-muted, #6c7266);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .15s ease;
}

.mt-isn-dossier__card[open] > .mt-isn-dossier__sum::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

@media (prefers-reduced-motion: reduce) {
    .mt-isn-dossier__sum::after { transition: none; }
}

.mt-isn-dossier__sum-nom {
    flex: 1 1 180px;
    min-width: 0;
    color: var(--mt-ink, #2b3128);
    font-size: var(--mt-fs-title, 18px);
    font-weight: 700;
    line-height: 1.3;
}

.mt-isn-dossier__sum-etat {
    flex: none;
    padding: 2px 10px;
    color: var(--mt-muted, #6c7266);
    font-size: var(--mt-fs-annex, 13.5px);
    font-weight: 700;
    background: var(--mt-surface-warm, #f4efe7);
    border-radius: var(--mt-radius-pill, 999px);
}

.mt-isn-dossier__sum-etat.is-ok { color: var(--mt-ok, #4c8a3f); background: var(--mt-ok-tint, #eef6ee); }
.mt-isn-dossier__sum-etat.is-ko { color: var(--mt-danger, #b8402d); background: var(--mt-danger-tint, #fdeeee); }

.mt-isn-dossier__card-body {
    padding: var(--mt-space-4, 16px);
    border-top: 1px solid var(--mt-line, #e5dfd4);
}

.mt-isn-dossier__card-hd {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--mt-space-3, 12px);
    margin-bottom: var(--mt-space-3, 12px);
}

.mt-isn-dossier__filiere { flex: 1 1 200px; min-width: 0; }
.mt-isn-dossier__culture { flex: 2 1 260px; min-width: 0; }
.mt-isn-dossier__unite { flex: 1 1 170px; min-width: 0; }

.mt-isn-dossier__card-hd select,
.mt-isn-dossier__culture input { width: 100%; }

.mt-isn-dossier__card-act {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mt-space-2, 8px) var(--mt-space-3, 12px);
    margin-bottom: var(--mt-space-4, 16px);
}

.mt-isn-dossier__cartouche {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--mt-muted, #6c7266);
    font-size: var(--mt-fs-annex, 13.5px);
}

.mt-isn-dossier__bio {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    color: var(--mt-ink, #2b3128);
    font-size: var(--mt-fs-body, 16px);
    font-weight: 700;
    white-space: nowrap;
}

.mt-isn-dossier__card-champs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--mt-space-3, 12px);
    margin-bottom: var(--mt-space-3, 12px);
}

.mt-isn-dossier__assurances {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mt-space-2, 8px) var(--mt-space-4, 16px);
    margin-bottom: var(--mt-space-3, 12px);
}

.mt-isn-dossier__assurances label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--mt-text, #3c4139);
    font-size: var(--mt-fs-annex, 13.5px);
}

/* Cinq colonnes fixes, comme `isn` : la série se relit d'un coup d'œil. */
.mt-isn-dossier__annees {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--mt-space-3, 12px) var(--mt-space-2, 8px);
    margin-bottom: var(--mt-space-3, 12px);
}

.mt-isn-dossier__num input[type="text"] { text-align: right; }

/* L'année en clair, son rang en second — comme dans `isn`. */
.mt-isn-dossier__rang {
    color: var(--mt-muted, #6c7266);
    font-size: var(--mt-fs-micro, 12px);
    font-weight: 400;
}

.mt-isn-dossier__card [data-mt-isnd-culture-estimate] {
    margin-top: var(--mt-space-3, 12px);
    padding-top: var(--mt-space-3, 12px);
    border-top: 1px solid var(--mt-line, #e5dfd4);
}

.mt-isn-dossier__card [data-mt-isnd-culture-estimate] p { margin: 0 0 var(--mt-space-1, 4px); max-width: 70ch; }

/* ----- Le verdict par culture (même code couleur que `isn`) --------------- */

.mt-isn-dossier__verdict {
    color: var(--mt-ink, #2b3128);
    font-size: var(--mt-fs-title, 18px);
    font-weight: 400;
}

.mt-isn-dossier__verdict strong { font-weight: 700; }

.mt-isn-dossier__verdict.is-ok strong { color: var(--mt-ok, #4c8a3f); }
.mt-isn-dossier__verdict.is-ko strong { color: var(--mt-danger, #b8402d); }
.mt-isn-dossier__verdict.is-neutre { color: var(--mt-muted, #6c7266); }

.mt-isn-dossier__qte,
.mt-isn-dossier__montant {
    color: var(--mt-ink, #2b3128);
    font-size: var(--mt-fs-body, 16px);
}

.mt-isn-dossier__montant b {
    color: var(--mt-brand, #1a8781);
    font-size: var(--mt-fs-title-lg, 22px);
}

/* ----- Étape 5 : le total -------------------------------------------------- */

.mt-isn-dossier__hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-3, 12px);
    margin: var(--mt-space-3, 12px) 0;
    padding: var(--mt-space-4, 16px);
    background: var(--mt-brand-tint, #e6f2f0);
    border-radius: var(--mt-radius, 10px);
}

.mt-isn-dossier__hero span {
    color: var(--mt-ink, #2b3128);
    font-size: var(--mt-fs-body, 16px);
    font-weight: 700;
    line-height: 1.3;
}

.mt-isn-dossier__hero small {
    display: block;
    color: var(--mt-muted, #6c7266);
    font-size: var(--mt-fs-annex, 13.5px);
    font-weight: 400;
}

.mt-isn-dossier__hero b {
    color: var(--mt-brand, #1a8781);
    font-size: var(--mt-fs-display, 28px);
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

/* ----- Le dépliant méthode (même chevron que `isn`) ------------------------ */

.mt-isn-dossier__method { margin-top: var(--mt-space-6, 32px); }

.mt-isn-dossier__method > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-3, 12px);
    list-style: none;
    color: var(--mt-brand-strong, #14655f);
    font-size: var(--mt-fs-title, 18px);
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.mt-isn-dossier__method > summary::-webkit-details-marker { display: none; }

.mt-isn-dossier__method > summary::after {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .15s ease;
}

.mt-isn-dossier__method[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

@media (prefers-reduced-motion: reduce) {
    .mt-isn-dossier__method > summary::after { transition: none; }
}

.mt-isn-dossier__method[open] > ul { margin-top: var(--mt-space-3, 12px); }
.mt-isn-dossier__method li { max-width: 70ch; }

/* ----- Mobile --------------------------------------------------------------*/

@media (max-width: 760px) {
    .mt-isn-dossier__annees { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
    .mt-isn-dossier__annees { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
