/* Outil « Frais d'achat d'un terrain au Maroc » (frais) — complète site.css sans le modifier. */
.fe-tool { max-width: 960px; min-width: 0; }
.fe-valid { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 1rem; font-size: .95rem; color: var(--muted); }
.fe-badge { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-ink); border: 1px solid currentColor; border-radius: 999px; padding: .15rem .6rem; }
.fe-outdated { margin: 0 0 1rem; font-weight: 600; }
.fe-form { gap: 1.4rem; grid-template-columns: minmax(0, 1fr); }
.fe-form > * { min-width: 0; max-width: 100%; }
.fe-intro { margin: 0; font-size: .95rem; }
.fe-fs { display: grid; gap: 1rem; min-width: 0; }
.fe-form > .fe-fs + .fe-fs { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.fe-form legend { font-size: 1.05rem; font-weight: 700; color: var(--text); padding: 0; }
.fe-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; align-items: start; }
.fe-field { display: grid; gap: .4rem; min-width: 0; }
.fe-field label { display: block; font-weight: 600; font-size: .92rem; }
.fe-field .hint { margin: 0; }
.fe-sub { display: grid; gap: 1rem; padding-inline-start: 1rem; border-inline-start: 2px solid var(--line); }
.fe-radios { display: grid; gap: .5rem; }
.fe-radios legend { font-weight: 600 !important; font-size: .92rem !important; margin-bottom: .4rem; }
.fe-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .5rem; }
.fe-opts .chk { display: flex; width: 100%; }
.fe-opts .chk, .fe-chk { max-width: 100%; min-width: 0; overflow-wrap: anywhere; border-radius: 14px; align-items: flex-start; }
.fe-opts .chk span, .fe-chk span { min-width: 0; flex: 1 1 auto; }
.fe-opts .chk input, .fe-chk input { flex: none; margin-top: .25rem; }
.fe-radios, .fe-opts { min-width: 0; max-width: 100%; }
.fe-opts .chk:has(input:checked) { border-color: var(--copper-ink); background: var(--paper); font-weight: 600; }
.fe-chk { justify-self: start; }
.fe-req { color: var(--copper-ink); }
.fe-err { margin: 0; color: #b3261e; font-size: .85rem; font-weight: 600; }
.fe-errsum { margin: 0; color: #b3261e; font-weight: 600; }
.fe-form [aria-invalid="true"] { border-color: #b3261e !important; border-width: 2px !important; }
.fe-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.fe-form .fe-actions .btn { justify-self: auto; }
.fe-clear, .fe-print { cursor: pointer; font: inherit; font-weight: 650; }
.fe-form .btn.ghost { color: var(--text); }
:root[data-theme="dark"] .fe-err, :root[data-theme="dark"] .fe-errsum { color: #ffb4ab; }
:root[data-theme="dark"] .fe-form [aria-invalid="true"] { border-color: #ffb4ab !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fe-err, :root:not([data-theme="light"]) .fe-errsum { color: #ffb4ab; }
  :root:not([data-theme="light"]) .fe-form [aria-invalid="true"] { border-color: #ffb4ab !important; }
}

/* Résultat : carte sombre, comme .lambert-tool .result */
.fe-out:empty { display: none; }
.fe-out { margin-top: 1.6rem; }
.fe-result { background: var(--ink); color: #eeecff; border: 1px solid var(--line-d); border-radius: 14px; padding: clamp(1.1rem, .8rem + 1.5vw, 1.8rem); display: grid; gap: 1rem; min-width: 0; }
.fe-result h2, .fe-result h3 { color: #fff; margin: 0; }
.fe-result h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem); }
.fe-result h3 { font-size: 1.15rem; }
.fe-result p { margin: 0; }
.fe-result a:not(.btn) { color: var(--copper-l); }
.fe-result .btn.ghost { color: #fff; }
.fe-meta { font-size: .9rem; color: rgba(236, 234, 255, .78); }
.fe-small { font-size: .88rem; color: rgba(236, 234, 255, .82); }
.fe-tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: .05rem .45rem; border-radius: 999px; border: 1px solid currentColor; opacity: .9; white-space: nowrap; }
.fe-tablewrap { overflow-x: auto; max-width: 100%; }
.fe-tablewrap:focus-visible { outline: 2px solid var(--copper-l); outline-offset: 2px; }
.fe-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fe-table th, .fe-table td { text-align: start; vertical-align: top; padding: .55rem .6rem; border-bottom: 1px solid var(--line-d); }
.fe-table thead th { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(236, 234, 255, .75); }
.fe-table tbody th { font-weight: 600; }
.fe-num { font-family: var(--mono); white-space: nowrap; text-align: end !important; }
.fe-src { font-size: .82rem; color: rgba(236, 234, 255, .8); }
.fe-miss th, .fe-miss td { color: #ffd8a8; }
.fe-table tfoot th, .fe-table tfoot td { border-bottom: 0; }
.fe-total th, .fe-total td { font-size: 1.08rem; font-weight: 700; color: #fff; border-top: 2px solid var(--copper-l); }
.fe-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fe-miss-note { color: #ffd8a8; font-weight: 600; }
.fe-warn { margin: 0; padding: .8rem 1rem; padding-inline-start: 2rem; border-radius: 10px; background: rgba(255, 255, 255, .06); border-inline-start: 3px solid var(--copper-l); display: grid; gap: .4rem; font-size: .92rem; }
.fe-seller-res { border-top: 1px solid var(--line-d); padding-top: 1rem; display: grid; gap: .8rem; }
.fe-kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .6rem 1.2rem; }
.fe-kv dt { font-size: .8rem; color: rgba(236, 234, 255, .75); }
.fe-kv dd { margin: 0; font-family: var(--mono); font-size: 1.05rem; overflow-wrap: anywhere; }
.fe-kv small { font-family: var(--sans); font-size: .75rem; opacity: .85; display: block; }
.fe-kv .fe-big dd { font-size: 1.35rem; color: #fff; }
.fe-help { border-top: 1px solid var(--line-d); padding-top: 1rem; display: grid; gap: .8rem; }
.fe-print-only { display: none; }

/* Tableau des taux (fond clair du site) */
.fe-rates { margin-top: 2.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 1rem clamp(1rem, .8rem + 1vw, 1.6rem); }
.fe-rates summary { cursor: pointer; list-style-position: outside; }
.fe-rates summary::marker { color: var(--copper-ink); }
.fe-h { display: inline; font-size: clamp(1.15rem, 1rem + .5vw, 1.45rem); margin: 0; }
.fe-h3 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
.fe-rates[open] summary { margin-bottom: 1rem; }
.fe-ratetable th, .fe-ratetable td { border-bottom-color: var(--line); }
.fe-ratetable thead th { color: var(--muted); }
.fe-ratetable td:nth-child(2) { white-space: normal; }
.fe-ratetable td:last-child { font-size: .85rem; color: var(--muted); }
.fe-tablewrap.fe-light:focus-visible, .fe-rates .fe-tablewrap:focus-visible { outline-color: var(--copper); }
.fe-sources { font-size: .9rem; }
.fe-sources li { overflow-wrap: anywhere; }

/* Petits écrans : lignes de tableau empilées */
@media (max-width: 700px) {
  .fe-table thead { display: none; }
  .fe-table tr { display: grid; grid-template-columns: 1fr; gap: .15rem; padding: .7rem 0; border-bottom: 1px solid var(--line-d); }
  .fe-ratetable tr { border-bottom-color: var(--line); }
  .fe-table th, .fe-table td { border: 0; padding: .1rem 0; }
  .fe-table td:empty { display: none; }
  .fe-table td[data-h]::before { content: attr(data-h); display: block; font: 600 .72rem var(--sans); letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
  .fe-num { text-align: start !important; white-space: normal; }
  .fe-sub { padding-inline-start: .7rem; }
}

@media (prefers-reduced-motion: reduce) { .fe-tool * { transition: none !important; animation: none !important; } }
.a11y-rm .fe-tool * { transition: none !important; animation: none !important; }

/* Impression : seulement le résultat */
@media print {
  body:has(.fe-tool) .top, body:has(.fe-tool) .foot, body:has(.fe-tool) .page-head, body:has(.fe-tool) .skip, body:has(.fe-tool) main > *:not(.fe-sec), body:has(.fe-tool) .a11y { display: none !important; }
  .fe-form, .fe-valid, .fe-outdated, .fe-rates, .fe-help .fe-actions { display: none !important; }
  .fe-sec { padding: 0 !important; }
  .fe-out { margin: 0; }
  .fe-print-only { display: block; font-weight: 700; }
  .fe-result { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  .fe-result h2, .fe-result h3, .fe-meta, .fe-small, .fe-src, .fe-kv dt, .fe-kv .fe-big dd, .fe-total th, .fe-total td, .fe-table thead th, .fe-miss th, .fe-miss td, .fe-miss-note { color: #000 !important; }
  .fe-table th, .fe-table td { border-color: #999 !important; }
  .fe-warn { background: #fff !important; border-color: #000; }
  .fe-tablewrap { overflow: visible; }
  .fe-result a { color: #000; }
}

/* Très petits écrans : le décalage de la flèche au survol (.btn:hover svg) ne doit pas créer de défilement horizontal */
.fe-tool .btn { max-width: 100%; white-space: normal; }
.fe-tool .btn svg { flex: none; }
@media (max-width: 480px) {
  .fe-tool .btn:hover svg { transform: none; }
  .fe-actions { flex-direction: column; align-items: stretch; }
  .fe-actions .btn { width: 100%; justify-content: center; text-align: center; }
}
/* Les boutons radio ne prennent pas le style des champs texte de .form */
.fe-form .fe-opts input[type=radio] { width: 16px; height: 16px; padding: 0; margin: .25rem 0 0; flex: none; accent-color: var(--green); }
