/* Parcours du formulaire de contact : voir contact-parcours.js. Les champs gardent le style de contact.css. */
.ctf *, .ctf *::before, .ctf *::after { box-sizing: border-box; }
.ctf-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.ctf-avatar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: linear-gradient(150deg, #6661fc, #9333ea); }
.ctf-title { margin: 0 !important; font-size: 17px !important; font-weight: 700; line-height: 1.3; color: #1e1b4b !important; text-align: left; }
.ctf-sub { margin: 2px 0 0 !important; font-size: 12.5px !important; line-height: 1.4; color: #6b7280 !important; text-align: left; }

.ctf-modes { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid rgba(99, 102, 252, .22); border-radius: 999px; background: rgba(255, 255, 255, .6); }
.ctf.is-enhanced .ctf-modes { display: grid; }
.ctf.is-enhanced .ctf-modes[hidden] { display: none; }
.ctf-mode { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; margin: 0; padding: 6px 10px; border: 0; border-radius: 999px; background: transparent; color: #4338ca; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; box-shadow: none; transition: background .18s ease, color .18s ease; }
.ctf-mode svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctf-mode:hover { background: rgba(102, 97, 252, .1); }
.ctf-mode.is-active { background: #6258cf; color: #fff; }

.ctf-step-title { margin: 0 0 14px !important; font-size: 15px !important; font-weight: 700; line-height: 1.35; color: #1e1b4b !important; text-align: left; }
.ctf-progress { display: none; margin: 0 0 12px !important; font-size: 11.5px !important; font-weight: 600; color: #6b7280 !important; text-align: left; }
.ctf.is-enhanced .ctf-progress { display: block; }
.ctf-optional { font-weight: 400; color: #6b7280; }

.ctf-chips { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.ctf-chips legend { display: block; margin: 0 0 8px; padding: 0; font-size: 12.5px; font-weight: 600; letter-spacing: .3px; color: #4338ca; }
.ctf-chips__list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.contact-form label.ctf-chip { position: relative; display: inline-flex; margin: 0; font-size: 13px; font-weight: 500; letter-spacing: 0; color: #312e81; cursor: pointer; }
.ctf-chip[hidden] { display: none !important; }
.ctf-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.ctf-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid rgba(99, 102, 252, .3); border-radius: 999px; background: rgba(255, 255, 255, .85); line-height: 1.25; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.ctf-chip:hover span { border-color: #6258cf; }
.ctf-chip input:checked + span { border-color: #6258cf; background: #6258cf; color: #fff; }
.ctf-chip input:focus-visible + span { outline: 3px solid #8175ef; outline-offset: 2px; }

.ctf-pair { display: flex; flex-wrap: wrap; gap: 0 16px; }
.ctf-pair > .form-row { flex: 1 1 200px; min-width: 0; }
.ctf.is-enhanced [data-ctf-step][hidden],
.ctf [data-ctf-block][hidden],
.ctf [data-ctf-context][hidden],
.ctf-back[hidden],
.ctf-hint[hidden],
.form-trust[hidden],
.form-trust li[hidden],
.ctf-error[hidden] { display: none !important; }

.contact-form .form-row input[aria-invalid="true"],
.contact-form .form-row textarea[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, .14); }
.ctf-error { margin: 0 !important; font-size: 13px !important; font-weight: 600; color: #b91c1c !important; text-align: center; }
.ctf-hint { margin: 0 !important; font-size: 12px !important; color: #6b7280 !important; text-align: center; }
.ctf-back { padding: 4px 8px; border: 0; background: none; color: #4338ca; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; box-shadow: none; }
.ctf-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.ctf .form-actions .qxCTlb { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

.ctf-done[hidden] { display: none; }
.ctf-done { padding: 22px 8px 14px; text-align: center; outline: none; }
.ctf-done__icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: #6258cf; color: #fff; }
.ctf-done__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ctf-done__title { margin: 0 0 6px !important; font-size: 20px !important; font-weight: 700; color: #1e1b4b !important; }
.ctf-done__text { margin: 0 auto !important; max-width: 44ch; font-size: 14px !important; line-height: 1.5; color: #4b5563 !important; }

/* Calendrier maison : bouton compact + pastilles des dates choisies */
.ctf-cal { position: relative; }
.ctf-cal button { font: inherit; }
.ctf-cal__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctf-cal__trigger { display: inline-flex; flex: none; align-items: center; gap: 9px; min-height: 46px; margin: 0; padding: 0 16px; border: 1px solid rgba(99, 102, 252, .34); border-radius: 12px; background: rgba(255, 255, 255, .9); color: #4338ca; font-size: 14px; font-weight: 600; box-shadow: none; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.ctf-cal__trigger svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctf-cal__trigger:hover,
.ctf-cal__trigger[aria-expanded="true"] { border-color: #6258cf; background: #f1eefe; }
.ctf-cal__trigger[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, .14); }
.contact-page ul.ctf-cal__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.contact-page ul.ctf-cal__chips[hidden] { display: none; }
.contact-page ul li.ctf-cal__chip { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; margin: 0; padding: 0 4px 0 12px; border-radius: 999px; background: #6258cf; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.ctf-cal__chip span { white-space: nowrap; }
.ctf-cal__chip button { display: grid; place-items: center; width: 28px; height: 28px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; box-shadow: none; cursor: pointer; }
.ctf-cal__chip button:hover { background: rgba(255, 255, 255, .22); }
.ctf-cal__chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.ctf-cal__panel { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 0 14px; width: 100%; max-width: 560px; padding: 12px; border: 1px solid rgba(98, 88, 207, .22); border-radius: 18px; background: #fff; box-shadow: 0 18px 44px -14px rgba(49, 39, 130, .42); color: #1e1b4b; }
.ctf-cal__panel[hidden] { display: none; }
.ctf-cal__kinds { grid-column: 1; grid-row: 1; align-self: start; display: grid; gap: 2px; padding: 3px; border-radius: 12px; background: #f1eefe; }
[data-cal-body] { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
.ctf-cal__kinds button { min-height: 38px; margin: 0; padding: 2px 4px; border: 0; border-radius: 9px; background: transparent; color: #4338ca; font-size: 12.5px; font-weight: 600; line-height: 1.15; box-shadow: none; cursor: pointer; transition: background .15s ease, color .15s ease; }
.ctf-cal__kinds button.is-active { background: #6258cf; color: #fff; }
.ctf-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.ctf-cal__nav,
.ctf-cal__title,
.ctf-cal__day,
.ctf-cal__month { margin: 0; padding: 0; border: 0; background: transparent; color: inherit; box-shadow: none; cursor: pointer; }
.ctf-cal__nav { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: #6258cf; }
.ctf-cal__nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctf-cal__nav:hover:not([disabled]),
.ctf-cal__title:hover,
.ctf-cal__month:hover:not([disabled]) { background: rgba(98, 88, 207, .12); }
.ctf-cal__nav[disabled] { opacity: .3; cursor: default; }
.ctf-cal__title { flex: 1; min-height: 36px; padding: 0 10px; border-radius: 999px; font-size: 14.5px; font-weight: 700; }
.ctf-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 1px; }
.ctf-cal__dow { padding: 2px 0 4px; color: #6b7280; font-size: 11px; font-weight: 600; text-align: center; }
.ctf-cal__day { display: grid; place-items: center; width: 100%; height: 34px; font-size: 13.5px; font-weight: 500; }
.ctf-cal__day span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; transition: background .15s ease, color .15s ease; }
.ctf-cal__day:hover:not([disabled]):not(.is-selected) span { background: rgba(98, 88, 207, .12); }
.ctf-cal__day[disabled] { color: #b6b2c8; cursor: default; }
.ctf-cal__day.is-today span { box-shadow: inset 0 0 0 1.5px #6258cf; color: #4338ca; font-weight: 700; }
.ctf-cal__day.is-selected span { background: #6258cf; box-shadow: none; color: #fff; font-weight: 700; }
.ctf-cal__day.is-preview span { background: rgba(98, 88, 207, .35); }
.ctf-cal__day.is-band { background: rgba(98, 88, 207, .14); }
.ctf-cal__day.is-start { background: linear-gradient(90deg, transparent 50%, rgba(98, 88, 207, .14) 50%); }
.ctf-cal__day.is-end { background: linear-gradient(90deg, rgba(98, 88, 207, .14) 50%, transparent 50%); }
.ctf-cal__months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ctf-cal__month { min-height: 44px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.ctf-cal__month[disabled] { color: #b6b2c8; cursor: default; }
.ctf-cal__month.is-today { box-shadow: inset 0 0 0 1.5px #6258cf; font-weight: 700; }
.ctf-cal__foot { grid-column: 1; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ctf-cal__foot[hidden] { display: none; }
.ctf-cal__summary {  margin: 0 !important; font-size: 12.5px !important; font-weight: 600; line-height: 1.35; color: #4b5563 !important; text-align: left; }
.ctf-cal__foot-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.ctf-cal__clear { margin: 0; padding: 6px 8px; border: 0; background: none; color: #4338ca; font-size: 12.5px; font-weight: 600; box-shadow: none; cursor: pointer; }
.ctf-cal__clear:hover { text-decoration: underline; text-underline-offset: 3px; }
.ctf-cal__ok { min-height: 36px; margin: 0; padding: 0 14px; border: 0; border-radius: 999px; background: #6258cf; color: #fff; font-size: 13px; font-weight: 600; box-shadow: none; cursor: pointer; transition: background .18s ease; }
.ctf-cal__ok:hover { background: #5145b6; }
.ctf-cal__trigger:focus-visible,
.ctf-cal__chip button:focus-visible,
.ctf-cal__kinds button:focus-visible,
.ctf-cal__clear:focus-visible,
.ctf-cal__ok:focus-visible,
.ctf-cal__nav:focus-visible,
.ctf-cal__title:focus-visible,
.ctf-cal__month:focus-visible { outline: 3px solid #8175ef; outline-offset: 2px; }
.ctf-cal__day:focus-visible { outline: none; }
.ctf-cal__day:focus-visible span { outline: 3px solid #8175ef; outline-offset: 1px; }
[data-theme="dark"] .ctf-cal__trigger { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .07); color: #e5d7ff; }
[data-theme="dark"] .ctf-cal__trigger:hover,
[data-theme="dark"] .ctf-cal__trigger[aria-expanded="true"] { border-color: #c8afff; background: rgba(255, 255, 255, .12); }
[data-theme="dark"] .contact-page ul li.ctf-cal__chip { background: #735dcf; }
[data-theme="dark"] .ctf-cal__panel { border-color: rgba(255, 255, 255, .16); background: #2b2238; color: #f1ecf8; }
[data-theme="dark"] .ctf-cal__kinds { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .ctf-cal__kinds button { color: #c8afff; }
[data-theme="dark"] .ctf-cal__kinds button.is-active { background: #735dcf; color: #fff; }
[data-theme="dark"] .ctf-cal__nav,
[data-theme="dark"] .ctf-cal__clear { color: #c8afff; }
[data-theme="dark"] .ctf-cal__dow { color: #bbb1c8; }
[data-theme="dark"] .ctf-cal__summary { color: #cfc6da !important; }
[data-theme="dark"] .ctf-cal__day[disabled],
[data-theme="dark"] .ctf-cal__month[disabled] { color: #6f6580; }
[data-theme="dark"] .ctf-cal__day.is-today span { box-shadow: inset 0 0 0 1.5px #c8afff; color: #e5d7ff; }
[data-theme="dark"] .ctf-cal__month.is-today { box-shadow: inset 0 0 0 1.5px #c8afff; color: #e5d7ff; }
[data-theme="dark"] .ctf-cal__day.is-selected span { background: #735dcf; box-shadow: none; color: #fff; }
[data-theme="dark"] .ctf-cal__day.is-band { background: rgba(200, 175, 255, .16); }
[data-theme="dark"] .ctf-cal__day.is-start { background: linear-gradient(90deg, transparent 50%, rgba(200, 175, 255, .16) 50%); }
[data-theme="dark"] .ctf-cal__day.is-end { background: linear-gradient(90deg, rgba(200, 175, 255, .16) 50%, transparent 50%); }
[data-theme="dark"] .ctf-cal__ok { background: #735dcf; }

[data-theme="dark"] .ctf-title,
[data-theme="dark"] .ctf-step-title,
[data-theme="dark"] .ctf-done__title { color: #f1ecf8 !important; }
[data-theme="dark"] .ctf-sub,
[data-theme="dark"] .ctf-progress,
[data-theme="dark"] .ctf-optional,
[data-theme="dark"] .ctf-hint,
[data-theme="dark"] .ctf-done__text { color: #bbb1c8 !important; }
[data-theme="dark"] .ctf-modes { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); }
[data-theme="dark"] .ctf-mode,
[data-theme="dark"] .ctf-back,
[data-theme="dark"] .ctf-chips legend { color: #c8afff; }
[data-theme="dark"] .ctf-mode.is-active { background: #735dcf; color: #fff; }
[data-theme="dark"] .contact-form label.ctf-chip { color: #ece2fa; }
[data-theme="dark"] .ctf-chip span { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); }
[data-theme="dark"] .ctf-chip input:checked + span { background: #735dcf; border-color: #735dcf; color: #fff; }
[data-theme="dark"] .ctf-error { color: #fca5a5 !important; }

@media (max-width: 640px) {
    /* Téléphone : le fond lilas du bloc devient le fond de toute la page, sans marges ni bordure autour. */
    html body { background: linear-gradient(160deg, #ede9fe 0%, #ddd6fe 60%, #e0d7ff 100%); }
    [data-theme="dark"] body { background: linear-gradient(160deg, #2d1f6e 0%, #3d2080 100%); }
    .contact-page,
    [data-theme="dark"] .contact-page { max-width: none; margin: 0; padding: 18px 16px; border: 0; border-radius: 0; background: none; box-shadow: none; }
    #back-to-top { margin: 8px auto 24px; }
    /* Sur téléphone le calendrier s'ouvre dans le formulaire, pour ne jamais sortir de l'écran. */
    .ctf-cal__panel { position: static; display: block; max-width: none; margin-top: 8px; }
    .ctf-cal__kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
    .ctf-cal__day { height: 38px; }
    .ctf-cal__foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid rgba(98, 88, 207, .16); }
    .ctf-cal__summary { flex: 1 1 130px; }
    .ctf-cal__trigger { min-height: 48px; }
    .ctf-mode { flex-direction: column; gap: 3px; min-height: 52px; padding: 6px 4px; font-size: 11.5px; border-radius: 16px; }
    .ctf-modes { border-radius: 20px; }
    .ctf-chip span { min-height: 44px; }
    .contact-form input, .contact-form textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .ctf-mode, .ctf-chip span, .ctf-cal__trigger, .ctf-cal__kinds button, .ctf-cal__day span, .ctf-cal__ok { transition: none; }
}
