/* ==========================================================================
   Groupe Urbania v2 : peau des formulaires de /js/t-forms.js (style Monographie).
   Ne change ni les cles, ni les listes, ni le balisage genere : seulement l'apparence.
   A charger apres /css/u.css. Remplace /css/t-forms.css sur les pages u-*.
   Section type : <section class="u-formsec" id="visite"> <div class="u-formsec__in">
     <div class="u-formsec__head">...</div> <div data-t-form="maison"></div> </div></section>
   ========================================================================== */

/* Section d'accueil d'un formulaire */
.u-formsec, .t-formsec { padding: var(--sec) var(--m); background: var(--papier-2); border-top: 1px solid var(--encre); scroll-margin-top: var(--hd); }
.u-formsec__in, .t-formsec__in { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: var(--s6); align-items: start; }
.u-formsec__head, .t-formsec__head { grid-column: 1 / 5; position: sticky; top: calc(var(--hd) + 32px); }
.u-formsec__head .u-h2 { margin: 12px 0 18px; }
.u-formsec__head p, .t-formsec__head p { color: var(--gris); max-width: 40ch; }
.u-formsec__head p + p { margin-top: 12px; }
.u-formsec__head a, .t-formsec__head a { color: var(--encre); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--filet); display: inline-block; padding: 10px 0; margin: -10px 0; }
.u-formsec [data-t-form], .t-formsec [data-t-form] { grid-column: 6 / 13; }
@media (max-width: 1023px) {
  .u-formsec__head, .t-formsec__head { grid-column: 1 / -1; position: static; }
  .u-formsec [data-t-form], .t-formsec [data-t-form] { grid-column: 1 / -1; }
}

/* Utilitaires utilises par le balisage genere */
.t-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.t-label { font-size: var(--t-label); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }

/* Formulaire */
.t-form { position: relative; }
.t-form__title { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 3.6vw, 52px); line-height: 1; letter-spacing: -.02em; margin: 0 56px 12px 0; }
.t-form__intro { color: var(--gris); margin-bottom: 16px; max-width: 52ch; }
.t-form__lead { font-size: 14px; color: var(--gris); border-left: 2px solid var(--signal); padding: 2px 0 2px 14px; margin-bottom: 18px; }
.t-form__lead a { text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 12px 0; margin: -12px 0; }
.t-form__proof { font-size: 13px; color: var(--gris); border-top: 1px solid var(--filet); border-bottom: 1px solid var(--filet); padding: 10px 0; margin-bottom: 18px; }
.t-form__proof p + p { margin-top: 2px; }
.t-form__note { font-size: 13px; color: var(--gris); margin-bottom: 18px; }
.t-form__note span, .t-req { color: var(--signal); }
.t-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.t-field { display: flex; flex-direction: column; min-width: 0; }
.t-field--full { grid-column: 1 / -1; }
.t-form__group { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--filet); color: var(--gris); }
.t-field > label, .t-radios legend, .t-file__legend { font-size: var(--t-label); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; padding: 0; color: var(--encre); }

/* Champs : filet inferieur, fond clair; le cadre se dessine au focus */
.t-in {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--encre);
  background: #fff; border: 1px solid #8E8B84; border-radius: 0; transition: border-color var(--d-2), box-shadow var(--d-2);
}
.t-in::placeholder { color: #6F6A63; }
.t-in:hover { border-color: var(--encre); }
.t-in:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 1px var(--encre); }
.t-in:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.t-in[type="date"]:focus { outline: 2px solid var(--signal); outline-offset: 3px; }
textarea.t-in { min-height: 132px; resize: vertical; line-height: 1.5; }
select.t-in {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--encre) 50%), linear-gradient(135deg, var(--encre) 50%, transparent 50%);
  background-position: calc(100% - 20px) 23px, calc(100% - 15px) 23px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.t-in[aria-invalid="true"] { border-color: var(--erreur, #B3261E); box-shadow: inset 3px 0 0 var(--erreur, #B3261E); }
.t-hint { font-size: 13px; color: var(--gris); margin-top: 6px; }
.t-err { font-size: 13px; color: var(--erreur, #B3261E); margin-top: 6px; font-weight: 500; }
.t-err:empty { display: none; }

/* Cases et boutons radio */
.t-check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px 14px; align-items: start; margin-top: 22px; }
.t-check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--encre); cursor: pointer; }
.t-check label { font-size: 15px; line-height: 1.5; text-transform: none; letter-spacing: 0; font-weight: 400; }
.t-check label a { text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 10px 0; margin: -10px 0; }
.t-check .t-err { grid-column: 2; }
.t-check--field { margin-top: 0; }
.t-radios { border: 0; padding: 0; margin: 0; min-width: 0; }
.t-radio { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; min-height: 48px; padding: 12px 14px; border: 1px solid #8E8B84; background: #fff; margin-top: -1px; cursor: pointer; font-size: 15px; line-height: 1.45; transition: background-color var(--d-2); }
.t-field .t-radio, .t-check--field label { font-size: 15px; font-weight: 400; letter-spacing: normal; text-transform: none; margin-bottom: 0; }
.t-radio input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--encre); }
.t-radio:hover { background: var(--papier); }
.t-radio:has(input:checked) { border-color: var(--encre); position: relative; box-shadow: inset 3px 0 0 var(--encre); }
.t-radio:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }

/* Section facultative */
.t-more { border-top: 1px solid var(--filet); border-bottom: 1px solid var(--filet); }
.t-more > summary { cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between; font-size: var(--t-label); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; list-style: none; }
.t-more > summary::-webkit-details-marker { display: none; }
.t-more > summary::after { content: "+"; font-size: 24px; font-weight: 300; letter-spacing: 0; transition: transform var(--d-2) var(--ease-out); }
.t-more[open] > summary::after { transform: rotate(45deg); }
.t-more > .t-form__grid { padding: 8px 0 24px; }

/* Fichiers */
.t-file__drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 104px; border: 1px dashed #8E8B84; background: #fff; cursor: pointer; font-size: 15px; font-weight: 500; text-align: center; padding: 12px; transition: border-color var(--d-2), background-color var(--d-2); }
.t-file__drop:hover { border-color: var(--encre); background: var(--papier); }
.t-field .t-file__drop { text-transform: none; letter-spacing: 0; margin-bottom: 0; }
.t-file__drop small { color: var(--gris); font-size: 13px; font-weight: 400; }
.t-file input:focus-visible + .t-file__drop { outline: 2px solid var(--signal); outline-offset: 2px; }
.t-file__list { list-style: none; }
.t-file__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--filet); font-size: 14px; overflow-wrap: anywhere; }
.t-file__rm { min-height: 44px; padding: 0 14px; background: none; border: 1px solid var(--encre); font: inherit; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; color: var(--encre); }
.t-file__rm:hover { background: var(--encre); color: var(--papier); }

/* Piege a robots */
.t-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Boutons generes (.t-btn) au style .u-btn--p */
.t-btn {
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 0 28px; border: 1px solid var(--encre); background: var(--encre); color: var(--papier); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.t-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fleuve); transform: scaleX(0); transform-origin: right; transition: transform var(--d-3) var(--ease); }
.t-btn:hover::before { transform: scaleX(1); transform-origin: left; }
.t-btn--ghost { background: transparent; color: var(--encre); }
.t-btn--ghost::before { background: var(--encre); }
.t-btn--ghost:hover { color: var(--papier); }
.t-form__submit { margin-top: 28px; min-width: 260px; }
.t-form__submit[disabled] { opacity: .6; cursor: progress; }
.t-form__submit[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; margin-left: 4px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: u-spin .8s linear infinite; }
@keyframes u-spin { to { transform: rotate(360deg); } }

/* Resume des erreurs et confirmation */
.t-form__summary { border: 0; border-top: 2px solid var(--signal); background: rgba(46,74,92, .06); padding: 16px 18px; margin-bottom: 22px; }
.t-form__summary:focus { outline: 2px solid var(--signal); outline-offset: 2px; }
.t-form__summary p { font-weight: 500; }
.t-form__summary ul { list-style: disc; padding-left: 20px; margin-top: 6px; }
.t-form__summary a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 6px 0; }
.t-form__done { margin-top: 24px; border-top: 1px solid var(--encre); padding: 28px 0 0; }
.t-form__done:focus { outline: none; }
.t-form__done h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.02; letter-spacing: -.02em; margin-bottom: 12px; }
.t-form__done p + p { margin-top: 8px; }
.t-form__done strong { font-weight: 500; }
.t-form__done a { text-decoration: underline; text-underline-offset: 3px; display: inline-block; padding: 10px 0; }

/* Panneau sur place (dialog) */
.t-dialog {
  width: min(780px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; margin: auto;
  border: 0; border-radius: 0; background: var(--papier-2); color: var(--encre); box-shadow: var(--ombre-2);
}
.t-dialog[open] { animation: u-dlg var(--d-3) var(--ease-out); }
@keyframes u-dlg { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.t-dialog::backdrop { background: rgba(20, 33, 42, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.t-dialog__in { position: relative; padding: clamp(24px, 4vw, 48px); border-top: 3px solid var(--encre); }
.t-dialog__close { position: absolute; right: 10px; top: 10px; width: 48px; height: 48px; background: none; border: 0; cursor: pointer; color: var(--encre); border-radius: 50%; transition: background-color var(--d-2); }
.t-dialog__close:hover { background: var(--pierre); }
.t-dialog__close span::before, .t-dialog__close span::after { content: ""; position: absolute; left: 14px; right: 14px; top: 23px; height: 1.5px; background: currentColor; }
.t-dialog__close span::before { transform: rotate(45deg); }
.t-dialog__close span::after { transform: rotate(-45deg); }
body.menu-open { overflow: hidden; }
body.menu-open .u-bar { transform: translateY(calc(110% + var(--badge))); }

@media (max-width: 600px) {
  .t-form__grid { grid-template-columns: 1fr; }
  .t-form__submit { width: 100%; min-width: 0; }
  .t-dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .t-dialog[open] { animation: none; } .t-form__submit[aria-busy="true"]::after { animation: none; } }