/* Vignettes enquêtes — bouton ouvrant la modale (reset UA sans casser thumb-border / thème) */
#portfolio_page .survey-open-modal.thumbnail-tile {
    width: 100%;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: start;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

#portfolio_page .thumbnail .survey-open-modal {
    display: block;
    width: 100%;
    text-align: start;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Vignettes enquêtes : icône formulaire au survol (à la place du ¶ des contenus) */
#portfolio_page .survey-open-modal .thumb::after {
    content: "";
    font-size: 0;
    background-color: var(--portfolios-text-main-color, var(--modules-white, #fff));
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 7h6M9 11h6M9 15h4'/%3E%3C/svg%3E");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: 2.35rem 2.35rem;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M9 7h6M9 11h6M9 15h4'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: 2.35rem 2.35rem;
}

/* Modale plein écran — fond et fermer partagés avec swipebox.css (#photo-viewer) */
#survey-response-modal .survey-modal__scroll {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

#survey-response-modal .survey-modal__content {
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
}

#survey-response-modal #survey-modal-form[hidden],
#survey-response-modal #survey-modal-form.survey-modal__panel--hidden {
    display: none !important;
}

#survey-response-modal #survey-modal-readonly[hidden],
#survey-response-modal #survey-modal-readonly.survey-modal__panel--hidden {
    display: none !important;
}

#survey-response-modal .survey-modal__legal[hidden],
#survey-response-modal .survey-modal__legal.survey-modal__panel--hidden {
    display: none !important;
}

#survey-response-modal .survey-modal__stage {
    align-items: stretch;
    text-align: left;
}

#survey-response-modal .survey-modal__title,
#survey-response-modal .survey-modal__title.title-align-left,
#survey-response-modal .survey-modal__title.title-align-center,
#survey-response-modal .survey-modal__title.title-align-right {
    margin: 0 0 1rem;
    font-size: var(--portfolios-heading-primary-size, 21px);
    line-height: var(--portfolios-heading-primary-line-height, calc(var(--portfolios-heading-primary-size, 21px) + 2px));
    font-weight: bold;
    color: var(--portfolios-heading-primary-color, inherit);
    text-align: left;
    align-self: stretch;
    width: 100%;
}

#portfolio_page #home-section-surveys .survey-open-modal .article-blog-infos,
#portfolio_page #home-section-surveys .survey-open-modal .article-blog-infos__title,
#portfolio_page #home-section-surveys .survey-open-modal .article-blog-infos__meta,
#portfolio_page #home-section-surveys .survey-open-modal .article-blog-infos__description {
    text-align: left;
}

#portfolio_page #home-section-surveys .survey-open-modal.thumbnail-tile,
#portfolio_page #home-section-surveys .thumbnail .survey-open-modal {
    align-items: flex-start;
}

#survey-response-modal .survey-modal__fields.content-article {
    text-align: left;
}

#survey-response-modal .survey-modal__fields.content-article :is(
    h2, h3, h4, h5, h6,
    p, p.description,
    .writer-editable,
    hr.writer-separator,
    a,
    .survey-modal__link,
    .survey-modal__choice-hint
) {
    text-align: left;
}

#survey-response-modal .survey-modal__fields.content-article .contact-form__field {
    align-items: flex-start;
    text-align: left;
}

#survey-response-modal .survey-modal__fields.content-article :is(
    p.writer-align-center,
    p.writer-align-right,
    p.writer-align-justify,
    .writer-editable.writer-align-center,
    .writer-editable.writer-align-right,
    .writer-editable.writer-align-justify
) {
    text-align: left;
}

#survey-response-modal .survey-modal__fields.content-article > :is(h2, h3, h4):first-child {
    margin-top: 0;
}

#survey-response-modal .survey-modal__message--error {
    color: var(--portfolios-color-error, #b00020);
}

#survey-response-modal .survey-modal__legal,
#survey-response-modal .survey-modal__legal p {
    font-size: var(--portfolios-font-size-base, 14px);
    line-height: var(--portfolios-text-line-height, calc(1em + 10px));
}

#survey-response-modal .survey-modal__submit-warning {
    margin: 0;
    font-size: var(--portfolios-font-size-base, 14px);
    line-height: var(--portfolios-text-line-height, calc(1em + 10px));
}

#survey-response-modal .survey-modal__identity-otp {
    margin-bottom: 1.5rem;
    padding: 0.75rem 0 0;
    border-top: 1px solid color-mix(in srgb, var(--portfolios-ui-border-strong-color, rgba(127, 127, 127, 0.35)) 35%, transparent);
}

#survey-response-modal .survey-modal__identity-otp-hint {
    margin: 0 0 0.75rem;
    font-size: calc(var(--portfolios-font-size-base) * 0.88);
    line-height: 1.4;
    color: color-mix(in srgb, var(--portfolios-text-main-color, inherit) 65%, transparent);
}

#survey-response-modal .contact-form .contact-form__field,
#survey-response-modal .survey-modal__fields .contact-form__field {
    margin-bottom: 1.5rem;
    gap: 0.55rem;
}

#survey-response-modal .contact-form__label {
    text-align: left;
    align-self: stretch;
    width: 100%;
}

#survey-response-modal .survey-modal__fields > :is(hr, h2, h3, h4, p.description) {
    margin-bottom: 1.25rem;
}

#survey-response-modal .contact-form__control[readonly] {
    cursor: default;
    opacity: 0.75;
}

#survey-response-modal .contact-form__field .survey-modal__link {
    display: inline-block;
    line-height: var(--portfolios-text-line-height, calc(1em + 10px));
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

#survey-response-modal .survey-modal__readonly-intro {
    margin: 0 0 1.5rem;
    font-weight: bold;
    font-size: var(--portfolios-heading-secondary-size, 14px);
    line-height: var(--portfolios-heading-secondary-line-height, calc(1em + 6px));
    color: var(--portfolios-heading-secondary-color, inherit);
    text-align: left;
}

#survey-response-modal .survey-modal__readonly-content {
    margin-top: 0.25rem;
}

#survey-response-modal .survey-modal__readonly-success {
    margin: 0 0 1rem;
    text-align: left;
}

#survey-response-modal .survey-modal__readonly-success:not([hidden]) {
    margin-top: 0.75rem;
}

#survey-response-modal .survey-modal__responses-date {
    margin: 0 0 1rem;
    font-size: calc(var(--portfolios-font-size-base) * 0.88);
    line-height: 1.4;
    text-align: left;
    color: color-mix(in srgb, var(--portfolios-text-main-color, inherit) 65%, transparent);
}

#survey-response-modal .survey-modal__responses-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 0;
    border-top: 1px solid color-mix(in srgb, var(--portfolios-ui-border-strong-color, rgba(127, 127, 127, 0.35)) 35%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--portfolios-ui-border-strong-color, rgba(127, 127, 127, 0.35)) 35%, transparent);
}

#survey-response-modal .survey-modal__responses-counter {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: calc(var(--portfolios-font-size-base) * 0.95);
    line-height: 1.4;
    font-weight: bold;
    text-align: center;
    color: var(--portfolios-heading-primary-color, inherit);
}

#survey-response-modal .survey-modal__responses-bar .pv-prev,
#survey-response-modal .survey-modal__responses-bar .pv-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: var(--portfolios-button-border-width, 0px) var(--portfolios-button-border-type, solid) var(--portfolios-button-border-color, transparent);
    border-radius: var(--portfolios-button-radius, var(--portfolios-border-radius-full));
    box-shadow: var(--portfolios-button-box-shadow, none);
    background-color: var(--portfolios-button-background-color, #222);
    background-image: var(--portfolios-button-gradient, none);
    cursor: pointer;
    color: var(--portfolios-button-text-color, #fff);
    box-sizing: border-box;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s, color 0.2s, filter 0.18s, transform 0.18s;
}

#survey-response-modal .survey-modal__responses-bar .pv-prev.pv-rotate-left svg {
    transform: rotate(-90deg);
}

#survey-response-modal .survey-modal__responses-bar .pv-next.pv-rotate-right svg {
    transform: rotate(90deg);
}

#survey-response-modal .survey-modal__responses-bar .pv-prev.disabled,
#survey-response-modal .survey-modal__responses-bar .pv-next.disabled,
#survey-response-modal .survey-modal__responses-bar .pv-prev:disabled,
#survey-response-modal .survey-modal__responses-bar .pv-next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

#survey-response-modal .survey-modal__summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#survey-response-modal .survey-modal__summary-block {
    padding: 1rem;
    border-style: solid;
    border-width: var(--contact-control-border-width, 2px);
    border-color: var(--contact-control-border-color, var(--portfolios-ui-border-strong-color, rgba(127, 127, 127, 0.35)));
    border-radius: var(--portfolios-thumbnail-radius, 0%);
    background-color: var(--form-bg, var(--portfolios-theme-bg-main));
}

#survey-response-modal .survey-modal__summary-title {
    margin: 0 0 0.75rem;
    font-size: calc(var(--portfolios-font-size-base) * 0.95);
    line-height: 1.35;
    font-weight: bold;
    text-align: left;
    color: var(--portfolios-heading-primary-color, inherit);
}

#survey-response-modal .survey-modal__summary-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

#survey-response-modal .survey-modal__summary-item {
    margin: 0;
    padding: 0 0 0.65rem;
    border-bottom: 1px solid color-mix(in srgb, var(--portfolios-ui-border-strong-color, rgba(127, 127, 127, 0.35)) 25%, transparent);
}

#survey-response-modal .survey-modal__summary-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

#survey-response-modal .survey-modal__summary-item dt {
    margin: 0 0 0.2rem;
    font-weight: bold;
    font-size: calc(var(--portfolios-font-size-base) * 0.88);
    line-height: 1.35;
    text-align: left;
    color: color-mix(in srgb, var(--portfolios-text-main-color, inherit) 72%, transparent);
}

#survey-response-modal .survey-modal__summary-item dd {
    margin: 0;
    line-height: 1.45;
    text-align: left;
    overflow-wrap: break-word;
    word-break: break-word;
}

#survey-response-modal .survey-modal__readonly-actions {
    margin-top: 1.25rem;
}

/* Choix simples / multiples — cartes cliquables alignées sur contact-form */
:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-grid,
:is(#portfolio_page, #survey-response-modal) .content-article .survey-modal__choice-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    grid-auto-rows: 1fr;
    gap: 0.5rem;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-grid > li,
:is(#portfolio_page, #survey-response-modal) .content-article .survey-modal__choice-grid > li {
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: 0;
    margin-bottom: 0;
    line-height: inherit;
    display: flex;
    height: 100%;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-grid > li::marker {
    content: none;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: var(--contact-control-padding-y, 0.75rem) var(--contact-control-padding-x, 0.75rem);
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: center;
    background-color: var(--form-bg, var(--portfolios-theme-bg-main));
    border-style: solid;
    border-width: var(--contact-control-border-width, 2px);
    border-color: var(--contact-control-border-color, var(--portfolios-ui-border-strong-color, rgba(127, 127, 127, 0.35)));
    border-radius: var(--portfolios-thumbnail-radius, 0%);
    box-shadow: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card:hover {
    border-color: var(--portfolios-heading-primary-color, var(--contact-control-border-color));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--portfolios-heading-primary-color, var(--contact-control-border-color)) 18%, transparent);
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card--selected {
    border-color: var(--portfolios-heading-primary-color, var(--contact-control-border-color));
    background: color-mix(in srgb, var(--portfolios-heading-primary-color, #6d42c3) 8%, var(--form-bg, var(--portfolios-theme-bg-main)));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--portfolios-heading-primary-color, #6d42c3) 22%, transparent);
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
    white-space: nowrap;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    box-sizing: border-box;
    border: 2px solid color-mix(in srgb, currentColor 42%, transparent);
    background: color-mix(in srgb, var(--form-bg, var(--portfolios-theme-bg-main)) 35%, transparent);
    opacity: 0.55;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card--radio::before {
    border-radius: 50%;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card--checkbox::before {
    border-radius: calc(var(--portfolios-border-radius-s, 4px) * 0.5);
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-card--selected::before {
    opacity: 1;
    border-color: var(--portfolios-heading-primary-color, #6d42c3);
    background: var(--portfolios-heading-primary-color, #6d42c3);
    box-shadow: inset 0 0 0 2px var(--form-bg, #fff);
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-text {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

:is(#portfolio_page, #survey-response-modal) .contact-form__field--choice-invalid .survey-modal__choice-card,
:is(#portfolio_page, #survey-response-modal) .contact-form__field:has(.survey-modal__choice-group[data-required="true"]:not(:has(:checked))) .survey-modal__choice-card {
    border-color: var(--form-error) !important;
    box-shadow: none !important;
}

:is(#portfolio_page, #survey-response-modal) .contact-form__field--valid:has(.survey-modal__choice-grid) .survey-modal__choice-card--selected {
    border-color: var(--portfolios-heading-primary-color, var(--contact-control-border-color)) !important;
}

:is(#portfolio_page, #survey-response-modal) .contact-form__field:has(.survey-modal__choice-grid) {
    align-items: stretch;
}

:is(#portfolio_page, #survey-response-modal) .contact-form__field:has(.survey-modal__choice-grid) .survey-modal__choice-grid {
    width: 100%;
}

:is(#portfolio_page, #survey-response-modal) .survey-modal__choice-hint {
    margin: 0;
    font-size: calc(var(--portfolios-font-size-base) * 0.88);
    line-height: 1.4;
    text-align: left;
    color: color-mix(in srgb, var(--portfolios-text-main-color, inherit) 65%, transparent);
}

#survey-response-modal .contact-form__actions {
    align-items: flex-start;
}

#survey-response-modal #survey-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

@media screen and (max-width: 650px) {
    #survey-response-modal .contact-form__row.grid-two {
        grid-template-columns: 1fr;
    }

    :is(#portfolio_page, #survey-response-modal) .survey-modal__choice-grid,
    :is(#portfolio_page, #survey-response-modal) .content-article .survey-modal__choice-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    }
}
