/* ============================================================
   Nemorias — Outil d'estimation (nouvelle interface, V2)
   Branchee sur les identifiants reels de estimate-ui/map/ign/engine.js.
   Tout est scope sous .est2 pour cohabiter avec app.css.
   ============================================================ */

.est2 {
    --font-display: "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
    --font-body: "Segoe UI", "Trebuchet MS", Verdana, Arial, sans-serif;

    --night: #0b1410;
    --panel: #15241c;
    --panel-soft: #1c2f25;
    --line: rgba(245, 239, 227, 0.18);

    --ink: #f5efe3;
    --ink-soft: #d4cdbd;
    --gold: #d9c48d;

    --paper: #f5efe3;
    --paper-edge: #d9cca9;
    --paper-rule: rgba(34, 51, 42, 0.28);
    --ink-paper: #22332a;
    --ink-paper-soft: #4c5a48;
    --green-deep: #2e5240;

    --error-dark: #f0b3a2;
    --error-paper: #9c2f1d;
    --ok: #9dc08b;
    --attention: #e0b56b;
    --focus-ring: #ffd98a;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(7, 12, 9, 0.88), rgba(7, 12, 9, 0.93)),
        url("../images/Forest-trees-sunshine-morning_3840x2160.jpg") center top / cover no-repeat fixed;
    background-color: var(--night);
    -webkit-font-smoothing: antialiased;
}

.est2 *,
.est2 *::before,
.est2 *::after { box-sizing: border-box; }

.est2 [hidden] { display: none !important; }

.est2 img,
.est2 svg { max-width: 100%; }

.est2 a { color: var(--gold); }

.est2 button,
.est2 input { font: inherit; }

.est2 button,
.est2 a,
.est2 summary { touch-action: manipulation; cursor: pointer; }

.est2 :focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ---------- Bandeau haut (wordmark + etapes) ---------- */

.est2-top { border-bottom: 1px solid var(--line); }

.est2-header {
    width: min(72rem, 100%);
    margin: 0 auto;
    padding: 1.1rem clamp(1rem, 4vw, 2rem) 0.4rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.est2-wordmark {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.55rem;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.est2-wordmark-sub {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 0.1rem;
}

.est2 .est2-retour {
    color: var(--ink-soft);
    text-decoration-color: rgba(212, 205, 189, 0.5);
    text-underline-offset: 3px;
    font-size: 1rem;
    padding: 0.35rem 0;
}

.est2 .est2-retour:hover { color: var(--ink); }

.est2-progress {
    width: min(72rem, 100%);
    margin: 0 auto;
}

.progress-steps {
    margin: 0;
    padding: 0.7rem clamp(1rem, 4vw, 2rem) 0.95rem;
    list-style: none;
    display: flex;
    gap: clamp(1rem, 4vw, 2.6rem);
    flex-wrap: wrap;
}

.progress-steps li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.98rem;
    color: rgba(245, 239, 227, 0.55);
    letter-spacing: 0.04em;
}

.progress-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1.5px solid rgba(245, 239, 227, 0.4);
    font-size: 0.9rem;
    font-weight: 700;
}

.progress-steps li.is-active {
    color: var(--ink);
    font-weight: 700;
}

.progress-steps li.is-active .progress-num {
    background: var(--gold);
    border-color: var(--gold);
    color: #23301f;
}

.progress-steps li.is-done { color: var(--gold); }

.progress-steps li.is-done .progress-num {
    border-color: var(--gold);
    color: var(--gold);
}

/* ---------- Structure des ecrans ---------- */

.est2-main {
    flex: 1;
    width: 100%;
    padding: clamp(1.6rem, 5vw, 3.2rem) clamp(1rem, 4vw, 2rem) clamp(2.5rem, 6vw, 4rem);
}

.screen { margin: 0 auto; }

.screen-narrow { width: min(46rem, 100%); }

.screen-wide { width: min(76rem, 100%); }

.screen-result { width: min(62rem, 100%); }

.screen-head { margin-bottom: clamp(1.6rem, 4vw, 2.4rem); }

.screen-head-center { text-align: center; }

.est2-eyebrow {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
}

.screen-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.screen-title:focus { outline: none; }

.screen-lead {
    margin: 0.9rem 0 0;
    max-width: 38rem;
    color: var(--ink-soft);
}

.screen-head-center .screen-lead { margin-inline: auto; }

.est2 .est2-back {
    display: inline-block;
    margin-bottom: 1.3rem;
    color: var(--ink-soft);
    font-size: 1rem;
    text-decoration-color: rgba(212, 205, 189, 0.5);
    text-underline-offset: 3px;
    padding: 0.3rem 0;
}

.est2 .est2-back:hover { color: var(--ink); }

/* ---------- Ecran 1 : choix de la methode ---------- */

.method-question {
    margin: 0 0 1.1rem;
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
}

.method-cards {
    display: grid;
    gap: 1rem;
}

.est2 .method-card {
    display: flex;
    align-items: center;
    gap: clamp(0.9rem, 3vw, 1.6rem);
    padding: clamp(1.2rem, 3vw, 1.7rem) clamp(1.1rem, 3vw, 1.8rem);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.est2 .method-card:hover {
    border-color: var(--gold);
    background: var(--panel-soft);
    transform: translateY(-2px);
}

.method-icon {
    flex: 0 0 auto;
    width: 3.4rem;
    height: 3.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(217, 196, 141, 0.55);
    border-radius: 50%;
    padding: 0.65rem;
    color: var(--gold);
}

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

.method-title {
    display: block;
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.25;
    margin-bottom: 0.35rem;
}

.method-text {
    display: block;
    color: var(--ink-soft);
    margin-bottom: 0.45rem;
}

.method-hint {
    display: block;
    font-size: 0.95rem;
    color: var(--gold);
}

.method-arrow {
    flex: 0 0 auto;
    font-size: 1.6rem;
    color: var(--gold);
}

.reassurance {
    margin: 1.6rem 0 0;
    font-size: 1rem;
    color: var(--ink-soft);
    max-width: 36rem;
}

/* ---------- Champs et formulaires ---------- */

.field { position: relative; margin: 0; }

.field-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--ink);
}

.text-input {
    width: 100%;
    min-height: 3.5rem;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 11, 0.6);
    color: var(--ink);
}

.text-input::placeholder { color: rgba(245, 239, 227, 0.45); }

.text-input:focus-visible { outline-offset: 0; }

.input-court { max-width: 11rem; }

.field-help {
    margin: 0.4rem 0 0;
    font-size: 0.97rem;
    color: var(--ink-soft);
}

.field-error {
    margin: 0.45rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--error-dark);
}

.field-error::before { content: "\26A0\00A0"; }

.paper-card .field-label { color: var(--ink-paper); }

.paper-card .text-input {
    background: #fffdf7;
    border-color: #b8ab8b;
    color: var(--ink-paper);
}

.paper-card .text-input::placeholder { color: #8a8168; }

.paper-card .field-help { color: var(--ink-paper-soft); }

.paper-card .field-error { color: var(--error-paper); }

.field.is-invalid .text-input { border-color: var(--error-paper); border-width: 2px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

/* Liste de communes (remplie par estimate-ui / estimate-flow) */

.commune-box {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.field.commune-open { z-index: 50; }

.commune-liste {
    --item: 3.75rem;
    position: absolute;
    z-index: 60;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: #fffdf7;
    border: 1px solid #b8ab8b;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(4, 10, 8, 0.45);
    max-height: min(calc(5 * var(--item) + 0.6rem + 2px), 17.5rem);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

.commune-liste li,
.commune-liste button.estimate-commune-option {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    min-height: 3.1rem;
    padding: 0.45rem 0.9rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--ink-paper);
    font-size: 1.02rem;
    text-align: left;
    cursor: pointer;
}

.commune-liste li strong { font-size: 1.05rem; line-height: 1.25; }

.commune-liste .commune-cp {
    color: var(--ink-paper-soft);
    font-size: 0.95rem;
    line-height: 1.2;
}

.commune-liste li:hover,
.commune-liste li.is-active,
.commune-liste button.estimate-commune-option:hover,
.commune-liste button.estimate-commune-option:focus-visible {
    background: rgba(46, 82, 64, 0.16);
}

.commune-liste p {
    margin: 0;
    padding: 0.75rem 0.9rem;
    color: var(--ink-paper-soft);
}

/* ---------- Fiche papier ---------- */

.paper-card {
    background: var(--paper);
    color: var(--ink-paper);
    border: 1px solid var(--paper-edge);
    border-radius: 10px;
    box-shadow:
        0 24px 50px rgba(3, 8, 6, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    position: relative;
}

.paper-card::after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid var(--paper-rule);
    border-radius: 6px;
    pointer-events: none;
}

.paper-card > * { position: relative; z-index: 1; }

.paper-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--green-deep);
}

/* ---------- Ecran 2A : carte reelle ---------- */

.map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.34fr);
    gap: clamp(1.2rem, 3vw, 2rem);
    align-items: start;
}

.map-column { position: relative; }

.commune-field {
    position: relative;
    z-index: 2;
    max-width: 30rem;
    overflow: visible;
}

.map-consigne {
    margin: 1.1rem 0 0.8rem;
    font-weight: 700;
    color: var(--ink);
}

.map-frame {
    position: relative;
    z-index: 1;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #2c3a26;
}

.estimate-map {
    display: block;
    width: 100%;
    height: clamp(24rem, 58vh, 34rem);
}

.estimate-map-toolbar {
    position: absolute;
    z-index: 900;
    top: 0.7rem;
    right: 0.7rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.estimate-layer-toggle {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--paper-edge);
    border-radius: 6px;
    background: rgba(245, 239, 227, 0.92);
    color: var(--ink-paper);
    font-size: 0.88rem;
    font-weight: 600;
}

.estimate-layer-toggle.is-active {
    background: var(--green-deep);
    border-color: var(--green-deep);
    color: var(--paper);
}

.map-hint {
    margin: 0.7rem 0 0;
    font-size: 1rem;
    color: var(--ink-soft);
}

/* Etiquette de parcelle posee sur la carte par estimate-map.js */

.estimate-parcel-label-wrap { background: transparent; border: none; }

.estimate-parcel-label {
    transform: translate(-50%, -50%);
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    background: rgba(245, 239, 227, 0.95);
    color: var(--ink-paper);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(4, 10, 8, 0.35);
}

.map-side { display: grid; gap: 1rem; }

.map-side-placeholder {
    border: 1px dashed var(--line);
    border-radius: 10px;
    padding: 1.3rem;
    color: var(--ink-soft);
    font-size: 1rem;
}

.parcel-mini { padding: 1.4rem 1.4rem 1.5rem; }

.parcel-mini-ref {
    margin: 0 0 0.7rem;
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.1;
}

.parcel-mini-facts {
    margin: 0 0 1.2rem;
    display: grid;
    gap: 0.5rem;
}

.parcel-mini-facts div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dotted var(--paper-rule);
    padding-bottom: 0.4rem;
}

.parcel-mini-facts dt { color: var(--ink-paper-soft); }

.parcel-mini-facts dd { margin: 0; font-weight: 700; }

.parcel-mini-warn {
    margin: 0.8rem 0 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--error-paper);
}

/* ---------- Ecran 2B : formulaire references ---------- */

.form-card {
    padding: clamp(1.4rem, 4vw, 2.2rem);
    display: grid;
    gap: 1.4rem;
}

.form-error-global {
    padding: 0.9rem 1.1rem;
    border: 2px solid var(--error-paper);
    border-radius: 7px;
    background: rgba(156, 47, 29, 0.08);
    color: var(--error-paper);
    font-weight: 600;
}

.form-error-global.is-info {
    border-color: rgba(46, 82, 64, 0.5);
    background: rgba(46, 82, 64, 0.08);
    color: var(--green-deep);
}

.aide-details {
    border: 1px solid var(--paper-rule);
    border-radius: 7px;
    background: rgba(46, 82, 64, 0.05);
}

.aide-details summary {
    padding: 0.9rem 1.1rem;
    font-weight: 700;
    color: var(--green-deep);
    list-style-position: inside;
}

.aide-details summary:hover { background: rgba(46, 82, 64, 0.08); }

.aide-details-corps {
    padding: 0.2rem 1.2rem 1.1rem;
    font-size: 1.02rem;
}

.est2 .aide-details-corps a { color: var(--green-deep); font-weight: 600; }

.aide-details-corps .field { margin-top: 0.6rem; }

.btn-form { justify-self: start; }

/* ---------- Ecran 3 : confirmation ---------- */

.estimate-error {
    margin: 0 0 1.2rem;
    padding: 0.9rem 1.1rem;
    border: 2px solid rgba(240, 179, 162, 0.7);
    border-radius: 7px;
    background: rgba(156, 47, 29, 0.22);
    color: var(--error-dark);
    font-weight: 600;
}

.estimate-error:empty { display: none; }

.fiche-parcelle { padding: clamp(1.4rem, 4vw, 2rem); }

.fiche-ref {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 5vw, 2.8rem);
    line-height: 1.05;
}

.fiche-facts {
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.fiche-facts div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dotted var(--paper-rule);
    padding-bottom: 0.45rem;
}

.fiche-facts dt { color: var(--ink-paper-soft); }

.fiche-facts dd { margin: 0; font-weight: 700; text-align: right; }

/* Localisation reprise dans l'annonce : rappel que ces informations restent
   privees (elles ne sont communiquees qu'aux acheteurs autorises). */
.fiche-note {
    margin: 1.1rem 0 0;
    padding-left: 0.85rem;
    border-left: 2px solid var(--green-deep);
    color: var(--ink-paper-soft);
    font-size: 0.92rem;
    line-height: 1.55;
}

.actions-column {
    margin-top: 1.6rem;
    display: grid;
    gap: 0.8rem;
    justify-items: stretch;
}

.mention-indicative {
    margin: 1.4rem auto 0;
    max-width: 34rem;
    text-align: center;
    font-size: 0.98rem;
    color: var(--ink-soft);
}

/* ---------- Boutons ---------- */

.est2 .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.6rem;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    border: 1.5px solid transparent;
    font-size: 1.12rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.est2 .btn-primary {
    background: var(--paper);
    color: #23301f;
}

.est2 .btn-primary:hover { background: #ffffff; }

.est2 .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.est2 .btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.est2 .btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.est2 .paper-card .btn-primary {
    background: var(--green-deep);
    color: var(--paper);
}

.est2 .paper-card .btn-primary:hover { background: #3a6650; }

.est2 button.btn { cursor: pointer; }

/* ---------- Ecran 4 : chargement (etats reels des sources) ---------- */

.loading-steps {
    margin: 0 auto;
    padding: 0;
    max-width: 33rem;
    list-style: none;
    display: grid;
    gap: 1.1rem;
}

.loading-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    color: rgba(245, 239, 227, 0.55);
    transition: color 300ms ease;
}

.loading-texte { display: block; }

.loading-texte strong {
    display: block;
    font-weight: 600;
}

.loading-texte em {
    display: none;
    font-style: normal;
    font-size: 0.95rem;
    color: var(--attention);
}

.loading-mark {
    flex: 0 0 auto;
    margin-top: 0.15rem;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 2px solid rgba(245, 239, 227, 0.35);
    position: relative;
    transition: border-color 300ms ease, background-color 300ms ease;
}

.loading-steps li.is-idle .loading-mark {
    border-color: var(--gold);
    animation: est2-pulser 1.1s ease-in-out infinite;
}

.loading-steps li.is-ok { color: var(--ink-soft); }

.loading-steps li.is-ok .loading-mark {
    border-color: var(--ok);
    background: rgba(157, 192, 139, 0.18);
}

.loading-steps li.is-ok .loading-mark::after {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 0.22rem;
    width: 0.5rem;
    height: 0.9rem;
    border-right: 2.5px solid var(--ok);
    border-bottom: 2.5px solid var(--ok);
    transform: rotate(40deg);
}

.loading-steps li.is-warn { color: var(--ink-soft); }

.loading-steps li.is-warn .loading-mark { border-color: var(--attention); }

.loading-steps li.is-warn .loading-mark::after {
    content: "!";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--attention);
    font-weight: 800;
}

.loading-steps li.is-warn .loading-texte em { display: block; }

@keyframes est2-pulser {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 196, 141, 0.5); }
    50% { box-shadow: 0 0 0 7px rgba(217, 196, 141, 0); }
}

/* ============================================================
   ECRAN 5 : RESULTAT (page claire editoriale)
   ============================================================ */

.est2.mode-resultat {
    background: #f3eee1;
    color: #22372b;
    --focus-ring: #7c6222;
}

.est2.mode-resultat .est2-top {
    border-bottom: none;
    background:
        linear-gradient(90deg, rgba(6, 11, 8, 0.78), rgba(6, 11, 8, 0.45)),
        url("../images/Forest-trees-sunshine-morning_3840x2160.jpg") center 40% / cover no-repeat;
    color: var(--ink);
    --focus-ring: #ffd98a;
}

.est2.mode-resultat .progress-steps { padding-bottom: 1.4rem; }

.est2.mode-resultat .progress-steps li + li::before {
    content: "";
    width: 1.9rem;
    border-top: 1px solid rgba(245, 239, 227, 0.45);
}

.est2.mode-resultat .est2-retour { color: var(--ink); }

.est2.mode-resultat .est2-retour::before { content: "\2190\00A0\00A0"; }

/* Sur le resultat, l'encadre d'avertissement porte seul la mention
   "indicative" (2026-10-04) : la ligne de pied de page ferait doublon. */
.est2.mode-resultat .est2-footer { display: none; }

/* -- Resultat principal -- */

.rf-head { margin-bottom: 0; }

.rf-title {
    color: #1e3428;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.rf-fourchette {
    margin: 0.7rem 0 0.9rem;
    font-family: var(--font-display);
    line-height: 1.05;
    color: #17301f;
}

.rf-montant {
    font-size: clamp(2.6rem, 8vw, 4.8rem);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.rf-et {
    display: inline-block;
    margin: 0 clamp(0.6rem, 2.5vw, 1.6rem);
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: #5a6b57;
}

.rf-parcelle {
    margin: 0;
    color: #4c5a48;
    font-size: 1.08rem;
}

.rf-parcelle strong { color: #22372b; }

/* -- Avertissement -- */

.rf-avert {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    max-width: 56rem;
    margin: clamp(1.7rem, 4vw, 2.4rem) auto 0;
    padding: 1.05rem 1.3rem;
    background: #faf3dd;
    border: 1px solid #d8b56a;
    border-radius: 8px;
}

.rf-avert-icone {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #dfaf3f;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    font-weight: 800;
}

.rf-avert p {
    margin: 0;
    font-size: 1.04rem;
    color: #3c4a39;
    line-height: 1.55;
}

.rf-avert strong {
    display: block;
    color: #22372b;
    font-size: 1.09rem;
}

/* Avertissements dynamiques du moteur (#result-warning) */

.rf-warning {
    max-width: 56rem;
    margin: 0.9rem auto 0;
    padding: 0.8rem 1rem;
    border-left: 3px solid #c9a24b;
    background: #f3ead1;
    color: #4c5a48;
    font-size: 0.99rem;
    border-radius: 0 6px 6px 0;
    text-align: left;
}

.rf-warning:empty { display: none; }

.rf-warning.is-strong {
    border-left-color: #b4552f;
    background: #f6e4d6;
    color: #7c3a1d;
    font-weight: 600;
}

/* -- Quatre informations principales -- */

.rf-facts {
    margin: clamp(2.1rem, 5vw, 3rem) 0 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.rf-fact { padding: 0.3rem clamp(0.9rem, 2.5vw, 1.6rem); }

.rf-fact + .rf-fact { border-left: 1px solid rgba(34, 55, 43, 0.18); }

.rf-fact-icone {
    display: inline-flex;
    width: 3.3rem;
    height: 3.3rem;
    margin-bottom: 0.55rem;
    color: #5b4f33;
}

.rf-fact-icone svg { width: 100%; height: 100%; }

.rf-facts dt {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #33463a;
    margin-bottom: 0.4rem;
}

.rf-facts dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.6vw, 1.6rem);
    line-height: 1.2;
    color: #1e3428;
}

.rf-facts .rf-fact-note {
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: #5a6b57;
    margin-top: 0.3rem;
    line-height: 1.5;
}

/* -- Deux colonnes -- */

.rf-colonnes {
    margin-top: clamp(2.1rem, 5vw, 3rem);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 1.5rem;
    align-items: stretch;
}

.rf-panneau {
    border: 1px solid rgba(34, 55, 43, 0.16);
    border-radius: 8px;
    background: #f8f4e9;
    padding: clamp(1.3rem, 3vw, 1.8rem);
}

.rf-panneau-titre {
    position: relative;
    margin: 0 0 1.3rem;
    padding-bottom: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #22372b;
}

.rf-panneau-titre::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.6rem;
    border-top: 2px solid #c9a24b;
}

.rf-panneau:last-child .rf-panneau-titre { text-align: center; }

.rf-panneau:last-child .rf-panneau-titre::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Resume des donnees utilisees (li generes par estimate-ui.js : is-ok / is-warn) */

.rf-savoir {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.rf-savoir li {
    position: relative;
    padding-left: 2rem;
    font-size: 1.02rem;
    color: #3c4a39;
    line-height: 1.55;
}

.rf-savoir li::before {
    position: absolute;
    left: 0.2rem;
    top: 0;
    font-weight: 800;
}

.rf-savoir li strong {
    display: block;
    color: #22372b;
    font-size: 1.02rem;
}

.rf-savoir li span {
    display: block;
    margin-top: 0.08rem;
    color: #5a6b57;
    font-size: 0.95rem;
    line-height: 1.45;
}

.rf-savoir li.is-ok::before { content: "\2713"; color: #2e5240; }

.rf-savoir li.is-warn::before { content: "\2192"; color: #a06a1c; }

.rf-ordre {
    margin: 1.3rem 0 0;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    background: #f3ead1;
    border: 1px solid rgba(200, 162, 75, 0.45);
    border-radius: 6px;
    font-size: 0.99rem;
    color: #4c5a48;
    line-height: 1.55;
}

.rf-ordre-i {
    flex: 0 0 auto;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 1.5px solid #7c6222;
    color: #7c6222;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.95rem;
}

.rf-ordre strong { color: #22372b; }

/* Liste d'actions "Et apres ?" */

.rf-actions {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rf-actions li + li { border-top: 1px solid rgba(34, 55, 43, 0.14); }

.est2 .rf-actions a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 0.25rem;
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 150ms ease;
}

.est2 .rf-actions a:hover { background: rgba(46, 82, 64, 0.07); }

.rf-action-icone {
    flex: 0 0 auto;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 50%;
    background: #efe7d2;
    color: #2e5240;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rf-action-icone svg { width: 1.3rem; height: 1.3rem; }

.rf-action-texte {
    flex: 1;
    display: grid;
    gap: 0.1rem;
}

.rf-action-texte strong {
    color: #22372b;
    font-size: 1.04rem;
}

.rf-action-texte span {
    color: #5a6b57;
    font-size: 0.95rem;
    line-height: 1.45;
}

.rf-chevron {
    flex: 0 0 auto;
    color: #7c6222;
    font-size: 1.7rem;
    line-height: 1;
}

/* -- Bandeau de mise en vente -- */

.rf-cta {
    margin-top: clamp(1.8rem, 4vw, 2.4rem);
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 1.8rem);
    padding: clamp(1.2rem, 3vw, 1.6rem) clamp(1.2rem, 3.5vw, 2rem);
    background: #24402f;
    border-radius: 8px;
    color: var(--ink);
}

.rf-cta-icone {
    flex: 0 0 auto;
    width: 3.7rem;
    height: 3.7rem;
    border-radius: 50%;
    border: 1.5px solid rgba(217, 196, 141, 0.8);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
}

.rf-cta-icone svg { width: 100%; height: 100%; }

.rf-cta-texte { flex: 1; min-width: 14rem; }

.rf-cta-titre {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.65rem);
    color: #f5efe3;
}

.rf-cta-sous {
    margin: 0.25rem 0 0;
    color: rgba(245, 239, 227, 0.82);
    font-size: 1rem;
}

.est2 .rf-cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3.4rem;
    padding: 0.85rem 1.6rem;
    background: #ddb14e;
    color: #22301a;
    border-radius: 7px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    transition: background-color 160ms ease;
}

.est2 .rf-cta-btn:hover { background: #e7bd5e; }

/* -- Aide -- */

.rf-aide {
    margin-top: clamp(2.2rem, 5vw, 3rem);
    text-align: center;
}

.rf-aide-titre {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    color: #22372b;
}

.rf-aide-titre::after {
    content: "";
    display: block;
    width: 2.2rem;
    margin: 0.65rem auto 0;
    border-top: 1px solid #c9a24b;
}

.rf-aide-sous {
    margin: 0.75rem 0 0;
    color: #5a6b57;
    font-size: 1.02rem;
}

.est2 .rf-aide-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
    min-height: 3.1rem;
    padding: 0.7rem 1.6rem;
    border: 1.5px solid #2e5240;
    border-radius: 7px;
    background: #fbf8ef;
    color: #22372b;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.rf-aide-btn svg { width: 1.15rem; height: 1.15rem; }

.est2 .rf-aide-btn:hover {
    background: #2e5240;
    color: #f5efe3;
}

/* -- Accordeons techniques -- */

.details-techniques {
    margin-top: clamp(2.2rem, 5vw, 2.8rem);
    display: grid;
    gap: 0.7rem;
}

.details-techniques details {
    background: #f8f4e9;
    border: 1px solid rgba(34, 55, 43, 0.16);
    border-radius: 8px;
}

.details-techniques summary {
    padding: 0.9rem 1.1rem;
    font-weight: 700;
    color: #2e5240;
    list-style-position: inside;
}

.details-techniques summary:hover { background: rgba(46, 82, 64, 0.07); }

.details-techniques .aide-details-corps { color: #3c4a39; }

.details-techniques .aide-details-corps li { margin-bottom: 0.35rem; }

/* ---------- Pied de page ---------- */

.est2-footer { border-top: 1px solid var(--line); }

.est2-footer p {
    width: min(72rem, 100%);
    margin: 0 auto;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    font-size: 0.95rem;
    color: var(--ink-soft);
}

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
    .map-layout { grid-template-columns: 1fr; }

    .map-side { max-width: 30rem; }
}

@media (max-width: 960px) {
    .rf-colonnes { grid-template-columns: 1fr; }

    .rf-cta { flex-wrap: wrap; }

    .est2 .rf-cta-btn { flex: 1 1 100%; }
}

@media (max-width: 900px) {
    .rf-facts {
        grid-template-columns: repeat(2, 1fr);
        row-gap: clamp(1.6rem, 4vw, 2.1rem);
    }

    .rf-facts .rf-fact { border-left: none; }

    .rf-facts .rf-fact:nth-child(2n) { border-left: 1px solid rgba(34, 55, 43, 0.18); }

    .rf-fact:nth-child(n+3) {
        border-top: 1px solid rgba(34, 55, 43, 0.18);
        padding-top: 1.6rem;
    }
}

@media (max-width: 640px) {
    .est2 { font-size: 1.0625rem; }

    .est2.mode-resultat .progress-steps li + li::before { display: none; }

    .progress-steps { gap: 0.9rem; }

    .progress-steps li { font-size: 0.9rem; }

    .field-row { grid-template-columns: 1fr; }

    .input-court { max-width: 100%; }

    .est2 .method-card { align-items: flex-start; }

    .method-icon { width: 2.9rem; height: 2.9rem; padding: 0.55rem; }

    .method-arrow { display: none; }

    .estimate-map { height: clamp(20rem, 55vh, 26rem); }

    .estimate-map-toolbar { right: 0.5rem; }

    .est2 .btn { width: 100%; }

    .btn-form { justify-self: stretch; }

    .rf-facts { grid-template-columns: 1fr; gap: 1.5rem; }

    .rf-facts .rf-fact + .rf-fact {
        border-left: none;
        border-top: 1px solid rgba(34, 55, 43, 0.18);
        padding-top: 1.5rem;
    }

    .rf-avert { align-items: flex-start; }

    .rf-cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .rf-cta-icone { margin: 0 auto; }

    .rf-cta-texte { min-width: 0; }

    .rf-montant { font-size: clamp(2.1rem, 10vw, 2.8rem); }
}

/* ============================================================
   LOT DE PARCELLES (B-M1, recette du 2026-10-04)
   Une estimation porte sur 1 a 10 parcelles : liste du lot (carte,
   saisie, confirmation), progression reelle, detail du resultat.
   ============================================================ */

.lot-panel {
    padding: 1.3rem 1.3rem 1.4rem;
    display: grid;
    gap: 0.75rem;
}

.lot-panel .paper-eyebrow { margin: 0; }

.lot-panel-saisie { margin-top: 1.4rem; }

.lot-compte {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.2;
}

.lot-liste {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lot-liste:empty { display: none; }

.lot-ligne {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "ref surface retirer"
        "lieu lieu retirer"
        "occupee occupee occupee";
    column-gap: 0.8rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px dotted var(--paper-rule);
}

.lot-ligne:first-child { border-top: 1px dotted var(--paper-rule); }

.lot-ref {
    grid-area: ref;
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.15;
}

.lot-lieu {
    grid-area: lieu;
    font-size: 0.92rem;
    color: var(--ink-paper-soft);
}

.lot-surface {
    grid-area: surface;
    font-weight: 700;
    white-space: nowrap;
}

.est2 .lot-retirer {
    grid-area: retirer;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--paper-edge);
    border-radius: 6px;
    background: transparent;
    color: var(--error-paper);
    font-size: 0.9rem;
    font-weight: 600;
}

.est2 .lot-retirer:hover { background: rgba(156, 47, 29, 0.08); }

.lot-occupee {
    grid-area: occupee;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--error-paper);
}

.lot-message {
    margin: 0;
    font-size: 0.95rem;
    color: var(--green-deep);
}

.lot-message:empty { display: none; }

.lot-message.is-error {
    color: var(--error-paper);
    font-weight: 700;
}

.lot-aide {
    margin: 0;
    color: var(--ink-paper-soft);
    font-size: 0.95rem;
}

.est2 .lot-continuer { width: 100%; }

/* Confirmation : meme liste, sans bouton de retrait. */
.lot-liste-fiche { margin-bottom: 0.4rem; }

.lot-liste-fiche .lot-ligne {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "ref surface"
        "lieu lieu"
        "occupee occupee";
}

/* ---------- Progression : une ligne par parcelle reelle ---------- */

.lot-progression {
    max-width: 33rem;
    margin: 0 auto 2rem;
    display: grid;
    gap: 0.9rem;
}

.lot-progression-ligne {
    margin: 0;
    min-height: 1.5em;
    font-weight: 700;
    text-align: center;
    color: var(--ink);
}

.lot-barre {
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(245, 239, 227, 0.14);
    overflow: hidden;
}

.lot-barre-remplie {
    display: block;
    width: 0;
    height: 100%;
    background: var(--gold);
    transition: width 400ms ease;
}

.lot-suivi {
    margin: 0.3rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.lot-suivi li {
    display: grid;
    grid-template-columns: auto 4.2rem minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    color: rgba(245, 239, 227, 0.6);
}

.lot-suivi strong {
    font-family: var(--font-display);
    font-size: 1.12rem;
    color: var(--ink);
}

.lot-suivi-etat { font-size: 0.94rem; }

.lot-suivi-marque {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgba(245, 239, 227, 0.35);
    position: relative;
}

.lot-suivi li.is-running .lot-suivi-marque {
    border-color: var(--gold);
    animation: est2-pulser 1.1s ease-in-out infinite;
}

.lot-suivi li.is-ok .lot-suivi-marque {
    border-color: var(--ok);
    background: rgba(157, 192, 139, 0.18);
}

.lot-suivi li.is-ok .lot-suivi-marque::after {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0.1rem;
    width: 0.32rem;
    height: 0.6rem;
    border-right: 2px solid var(--ok);
    border-bottom: 2px solid var(--ok);
    transform: rotate(40deg);
}

.lot-suivi li.is-ok .lot-suivi-etat { color: var(--ok); }

.lot-suivi li.is-fail .lot-suivi-marque { border-color: var(--error-dark); }

.lot-suivi li.is-fail .lot-suivi-marque::after {
    content: "\00D7";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--error-dark);
    font-weight: 800;
    line-height: 1;
}

.lot-suivi li.is-fail .lot-suivi-etat { color: var(--error-dark); }

/* ---------- Resultat : detail parcelle par parcelle ---------- */

.rf-detail {
    max-width: 56rem;
    margin: clamp(2.1rem, 5vw, 3rem) auto 0;
}

.rf-detail-table {
    width: 100%;
    border-collapse: collapse;
    color: #22372b;
    font-size: 1rem;
}

.rf-detail-table th,
.rf-detail-table td {
    padding: 0.75rem 0.6rem;
    text-align: right;
    vertical-align: top;
    border-bottom: 1px solid rgba(34, 55, 43, 0.14);
}

.rf-detail-table thead th {
    padding-top: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5a6b57;
    border-bottom: 2px solid rgba(34, 55, 43, 0.28);
}

.rf-detail-table th:first-child,
.rf-detail-table td:nth-child(3),
.rf-detail-table td:nth-child(6) { text-align: left; }

.rf-detail-table tbody th { font-weight: 400; }

.rf-detail-table tbody th strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1.2;
}

.rf-detail-lieu {
    display: block;
    font-size: 0.88rem;
    color: #5a6b57;
}

.rf-detail-table tbody td { white-space: nowrap; }

.rf-detail-table tfoot th,
.rf-detail-table tfoot td {
    font-weight: 700;
    border-top: 2px solid rgba(34, 55, 43, 0.28);
    border-bottom: none;
}

/* ---------- Resultat : lot incomplet (aucun total) ---------- */

.rf-incomplet {
    max-width: 46rem;
    margin: 0 auto;
}

.rf-echecs {
    margin: 1.8rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1rem;
}

.rf-echecs li {
    display: grid;
    gap: 0.45rem;
    padding: 1.1rem 1.25rem;
    background: #f6e4d6;
    border-left: 4px solid #b4552f;
    border-radius: 0 8px 8px 0;
    color: #5a2c18;
}

.rf-echecs strong {
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: #22372b;
}

.rf-echec-raison { font-size: 1.04rem; }

.rf-echec-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.est2 .rf-echecs .btn {
    min-height: 2.9rem;
    padding: 0.55rem 1.15rem;
    font-size: 1rem;
}

.est2 .rf-echecs .btn-primary {
    background: #2e5240;
    color: #f5efe3;
}

.est2 .rf-echecs .btn-primary:hover { background: #3a6650; }

.est2 .rf-echecs .btn-ghost {
    color: #22372b;
    border-color: rgba(34, 55, 43, 0.35);
}

.rf-incomplet-calculees {
    margin: 1.3rem 0 0;
    color: #4c5a48;
    text-align: center;
}

.rf-incomplet .estimate-error {
    margin-top: 1.2rem;
    background: #f6e4d6;
    color: #9c2f1d;
    border-color: #d79a7f;
}

@media (max-width: 760px) {
    /* Tableau du detail empile : une fiche par parcelle, libelles repris. */
    .rf-detail-table thead { display: none; }

    .rf-detail-table,
    .rf-detail-table tbody,
    .rf-detail-table tfoot,
    .rf-detail-table tr,
    .rf-detail-table th,
    .rf-detail-table td { display: block; }

    .rf-detail-table tr {
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(34, 55, 43, 0.2);
    }

    .rf-detail-table th,
    .rf-detail-table td {
        padding: 0.2rem 0;
        border: none;
        text-align: left;
    }

    .rf-detail-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        white-space: normal;
    }

    .rf-detail-table td::before {
        content: attr(data-label);
        color: #5a6b57;
        font-weight: 400;
    }

    .rf-detail-table td:empty { display: none; }

    .rf-detail-table tfoot tr { border-bottom: none; }

    .rf-detail-table tfoot th,
    .rf-detail-table tfoot td { border-top: none; }

    .rf-detail-table tfoot th { padding-top: 0.4rem; }
}

@media (max-width: 640px) {
    .est2 .rf-echecs .btn { width: 100%; }
}

/* ---------- Mouvement reduit ---------- */

@media (prefers-reduced-motion: reduce) {
    .est2 *,
    .est2 *::before,
    .est2 *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
