/* Formulaires publics du lot D : demande, demande rapide d'une fiche, vendre / louer, contact, droits, confirmations.
   Servie depuis le site (CSP style-src 'self'). Charte : bleu nuit #0b1c2d, fond #f4f6f8, cartes blanches ; titres en
   Playfair Display, texte en Montserrat, boutons en Open Sans Condensed majuscules. Les variables du lot G (--brand,
   --font-title, --font-body, --font-label) sont reprises si elles existent, sinon les valeurs par défaut s'appliquent.
   Contrastes vérifiés (WCAG AA) : texte secondaire #4a5562 (7,6:1 sur blanc), erreur #a8231b (7,2:1),
   bouton WhatsApp #0a6b5f (6,4:1 avec le texte blanc). */

.lf-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 104px; /* bas : le bouton WhatsApp flottant ne masque jamais le bouton d'envoi */
  color: var(--text, #1b2733);
  font-family: var(--font-body, "Montserrat", "Segoe UI", Arial, sans-serif);
  line-height: 1.5;
}
.lf-page--narrow { max-width: 720px; }
.lf-page [hidden], .lf-quick [hidden] { display: none !important; }

/* En-tête de page */
.lf-head { max-width: 760px; margin: 0 0 24px; }
.lf-kicker {
  margin: 0 0 8px;
  font-family: var(--font-label, "Open Sans Condensed", "Arial Narrow", Arial, sans-serif);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand, #0b1c2d);
}
.lf-head h1,
.lf-done h1 {
  margin: 0 0 12px;
  font-family: var(--font-title, "Playfair Display", Georgia, serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: var(--brand, #0b1c2d);
}
.lf-lead { margin: 0; font-size: 1.05rem; }
.lf-lead p { margin: 0; }
/* Page « vendre » : texte éditorial du lot F sous le formulaire (styles .c-prose de content.css) */
.lf-detail { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line, #d9dee3); }
.lf-intro { margin: 0 0 16px; }

/* Mise en page : formulaire + colonne de réassurance */
.lf-layout { display: grid; gap: 24px; }
.lf-main { min-width: 0; }
@media (min-width: 900px) {
  .lf-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .lf-aside { position: sticky; top: 96px; }
}

.lf-card,
.lf-aside,
.lf-quick,
.lf-done,
.lf-listing {
  background: #fff;
  border: 1px solid var(--line, #dde3e9);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(11, 28, 45, .06);
}
.lf-card { padding: 20px; }
@media (min-width: 600px) { .lf-card { padding: 28px; } }

/* Champs */
.lf-field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.lf-label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-weight: 600;
  font-size: .95rem;
  color: var(--brand, #0b1c2d);
}
.lf-sublabel { display: block; margin: 0 0 4px; font-size: .85rem; }
.lf-opt, .lf-req { font-weight: 400; font-size: .85rem; color: #4a5562; }
.lf-req { font-weight: 600; }
.lf-hint { margin: 6px 0 0; font-size: .85rem; color: #4a5562; }
.lf-error { margin: 6px 0 0; font-weight: 600; font-size: .9rem; color: #a8231b; }

.lf-page input[type="text"], .lf-page input[type="tel"], .lf-page input[type="email"], .lf-page input[type="date"],
.lf-page input[type="file"], .lf-page select, .lf-page textarea,
.lf-quick input[type="text"], .lf-quick input[type="tel"], .lf-quick input[type="email"], .lf-quick select, .lf-quick textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #7d8a97;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 16px; /* 16 px : pas de zoom automatique sur iPhone */
}
.lf-page input[type="file"] { padding: 10px; }
.lf-page textarea, .lf-quick textarea { min-height: 110px; resize: vertical; }
.lf-page :focus-visible, .lf-quick :focus-visible { outline: 3px solid var(--brand, #0b1c2d); outline-offset: 2px; }
/* Seul le champ en faute (aria-invalid) passe en rouge, jamais son voisin (l'indicatif du pays) ; spécificité 0,2,1
   déclarée après la règle de base : elle l'emporte sur « .lf-page input[type="tel"] ». */
.lf-page input[aria-invalid="true"], .lf-page select[aria-invalid="true"], .lf-page textarea[aria-invalid="true"],
.lf-quick input[aria-invalid="true"], .lf-quick select[aria-invalid="true"], .lf-quick textarea[aria-invalid="true"] {
  border-color: #a8231b;
  border-width: 2px;
}

.lf-row { display: grid; gap: 0 16px; }
@media (min-width: 600px) {
  .lf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lf-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lf-row--3 > .lf-field { display: flex; flex-direction: column; justify-content: flex-end; } /* champs alignés */
}
.lf-phone__grid { display: grid; gap: 8px; }
@media (min-width: 480px) { .lf-phone__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.lf-budget { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lf-budget > div:last-child { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .lf-budget { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px; }
  .lf-budget > div:last-child { grid-column: auto; }
}
.lf-inline { display: flex; gap: 8px; }
.lf-page .lf-inline select { flex: 0 0 96px; width: 96px; }

/* Cases et boutons radio : grandes zones cliquables (44 px au moins) */
.lf-choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lf-choice {
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c3ccd5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  line-height: 1.35;
}
.lf-choice input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand, #0b1c2d); }
.lf-choice:has(input:checked) { border-color: var(--brand, #0b1c2d); background: #eef2f6; }
.lf-consents { margin: 8px 0 20px; }
.lf-choice.lf-consent { padding: 6px 0; border: 0; background: transparent; font-size: .9rem; }

.lf-details { margin: 0 0 18px; border: 1px solid var(--line, #dde3e9); border-radius: 10px; background: #f8fafb; }
.lf-details > summary { padding: 14px 16px; font-weight: 600; color: var(--brand, #0b1c2d); cursor: pointer; }
.lf-details__body { padding: 4px 16px; }

/* Boutons (charte : plein bleu nuit, contour 2 px, libellés condensés en majuscules) */
.lf-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 2px solid var(--brand, #0b1c2d);
  border-radius: 4px;
  font-family: var(--font-label, "Open Sans Condensed", "Arial Narrow", Arial, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: .05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.lf-btn--primary { background: var(--brand, #0b1c2d); color: #fff; }
.lf-btn--primary:hover { background: #1d3349; border-color: #1d3349; }
.lf-btn--outline { background: transparent; color: var(--brand, #0b1c2d); }
.lf-btn--outline:hover { background: var(--brand, #0b1c2d); color: #fff; }
.lf-btn--wa { background: #0a6b5f; border-color: #0a6b5f; color: #fff; }
.lf-btn--wa:hover { background: #08584e; border-color: #08584e; }
.lf-btn--block { display: flex; width: 100%; }
.lf-btn[disabled] { opacity: .75; cursor: progress; }
.lf-icon { flex: 0 0 auto; fill: currentColor; }

.lf-note { margin: 10px 0 0; font-size: .85rem; color: #4a5562; }
.lf-page a:not(.lf-btn), .lf-quick a:not(.lf-btn) { color: var(--brand, #0b1c2d); text-decoration: underline; text-underline-offset: 2px; }

/* Messages */
.lf-alert { margin: 0 0 16px; padding: 14px 16px; border: 1px solid; border-radius: 10px; text-align: left; }
.lf-alert--error { background: #fdecea; border-color: #a8231b; color: #5f1410; }
.lf-alert--warn { background: #fff4e5; border-color: #9a5600; color: #4d2c00; }
.lf-alert__title { margin: 0 0 4px; font-weight: 700; }
.lf-alert ul { margin: 4px 0 0; padding-left: 20px; }
.lf-alert p { margin: 4px 0 0; }

/* Accessibilité : champ piège et libellés réservés aux lecteurs d'écran */
.lf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lf-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bien demandé */
.lf-listing { display: flex; gap: 14px; align-items: center; margin: 0 0 16px; padding: 12px; }
.lf-listing__img { flex: 0 0 auto; width: 120px; height: 90px; border-radius: 8px; object-fit: cover; }
.lf-listing__body { min-width: 0; }
.lf-listing__ref {
  margin: 0;
  font-family: var(--font-label, "Open Sans Condensed", "Arial Narrow", Arial, sans-serif);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #4a5562;
}
.lf-listing__title { margin: 2px 0; font-weight: 600; }
.lf-listing__price { margin: 0; font-weight: 700; }
.lf-listing__closed { margin: 4px 0 0; font-size: .9rem; color: #7a4100; }

/* Colonne de réassurance */
.lf-aside { padding: 20px; }
.lf-aside__title, .lf-quick__title {
  margin: 0 0 12px;
  font-family: var(--font-title, "Playfair Display", Georgia, serif);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--brand, #0b1c2d);
}
.lf-steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: lf-step; }
.lf-steps li { position: relative; padding: 0 0 12px 40px; counter-increment: lf-step; }
.lf-steps li::before {
  content: counter(lf-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand, #0b1c2d);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}
.lf-aside__direct { padding-top: 16px; border-top: 1px solid var(--line, #dde3e9); }
.lf-aside__lead { margin: 0 0 10px; font-weight: 600; }
.lf-coords { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 16px 0 0; }
.lf-coords dt { font-weight: 600; }
.lf-coords dd { margin: 0; overflow-wrap: anywhere; }

/* Confirmation */
.lf-done { padding: 32px 20px; text-align: center; }
.lf-done__icon { fill: none; stroke: #0a6b5f; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lf-done__label { margin: 12px 0 0; }
.lf-ref {
  margin: 4px 0 16px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: .04em;
  color: var(--brand, #0b1c2d);
}
.lf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
@media (max-width: 480px) { .lf-actions .lf-btn { width: 100%; } }

/* Demande rapide (fiche d'un bien) */
.lf-quick { padding: 20px; color: var(--text, #1b2733); font-family: var(--font-body, "Montserrat", "Segoe UI", Arial, sans-serif); line-height: 1.5; }
.lf-quick__lead { margin: 0 0 16px; }
.lf-quick__or { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: .9rem; color: #4a5562; }
.lf-quick__or::before, .lf-quick__or::after { content: ""; flex: 1; border-top: 1px solid var(--line, #dde3e9); }
/* La demande rapide vit souvent dans une colonne étroite : sa mise en page suit la largeur de son conteneur */
.lf-quick { container-type: inline-size; }
.lf-quick .lf-phone__grid, .lf-quick .lf-choices { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 520px) {
  .lf-quick .lf-phone__grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .lf-quick .lf-choices { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
.lf-quick .lf-consent { margin: 0 0 12px; }
