/* 3SAFE – Patch Accueil Pro 1.3.0 */

/* Le fichier fourni est circulaire et transparent. Ces règles empêchent tout
   rendu carré imposé par le thème, Elementor ou une ancienne miniature. */
.ts-home .ts-logo,
.ts-home .ts-about__mark img,
.ts-home img[data-ts-round-logo="true"] {
    aspect-ratio: 1 / 1 !important;
    border-radius: 999px !important;
    clip-path: circle(50% at 50% 50%) !important;
    background: transparent !important;
    object-fit: contain !important;
    object-position: center !important;
}

.ts-home .ts-credential[data-ts-document-wired="true"] {
    cursor: zoom-in;
}

.ts-home .ts-credential[data-ts-document-wired="true"]:focus-visible {
    outline: 3px solid var(--ts-accent, #2267a5);
    outline-offset: 3px;
}

/* Indicateurs qualité 2025 : quatre chiffres clés et treize barres exactes. */
.ts-home .ts-stat-grid[data-ts-quality-summary="true"] {
    align-items: stretch;
}

.ts-home .ts-patch-stat {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 166px;
    padding: 27px;
}

.ts-home .ts-patch-stat::before {
    position: absolute;
    z-index: -1;
    top: -44px;
    right: -44px;
    width: 132px;
    height: 132px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    content: "";
}

.ts-home .ts-patch-stat::after {
    position: absolute;
    z-index: -1;
    right: 20px;
    bottom: 18px;
    width: 38px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #69b5f2, #8be0b8);
    content: "";
    opacity: 0.86;
}

.ts-home .ts-patch-stat strong {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ts-home .ts-patch-stat--satisfaction strong {
    font-size: clamp(1.85rem, 3.25vw, 2.8rem);
}

.ts-home .ts-quality-details[data-ts-quality-patched="true"] {
    overflow: hidden;
}

.ts-home .ts-quality-details[data-ts-quality-patched="true"] > summary {
    padding-top: 18px;
    padding-bottom: 18px;
}

.ts-home .ts-patch-quality-summary-copy {
    display: flex;
    min-width: 0;
    gap: 4px;
    flex: 1 1 auto;
    flex-direction: column;
}

.ts-home .ts-patch-quality-summary-copy strong {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.3;
}

.ts-home .ts-patch-quality-summary-copy small {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.4;
}

.ts-home .ts-patch-quality-context {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 3px 20px 18px;
    color: rgba(255, 255, 255, 0.72);
}

.ts-home .ts-patch-quality-context > span {
    display: inline-flex;
    min-height: 28px;
    flex: 0 0 auto;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.69rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.ts-home .ts-patch-quality-context p {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: right;
}

.ts-home .ts-quality-bars[data-ts-quality-bars] {
    gap: 20px 30px;
    padding-top: 2px;
}

.ts-home .ts-patch-quality-bar > div {
    align-items: flex-end;
    margin-bottom: 8px;
}

.ts-home .ts-patch-quality-bar > div > span {
    display: flex;
    min-width: 0;
    gap: 3px;
    flex-direction: column;
    line-height: 1.35;
}

.ts-home .ts-patch-quality-bar > div > span small {
    color: rgba(255, 255, 255, 0.47);
    font-size: 0.59rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.ts-home .ts-patch-quality-bar > div > strong {
    flex: 0 0 auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ts-home .ts-patch-quality-bar .ts-quality-bar__track {
    height: 8px;
}

.ts-home .ts-patch-quality-bar .ts-quality-bar__track i {
    box-shadow: 0 0 16px rgba(105, 181, 242, 0.22);
}

.ts-home .ts-patch-quality-bar--company {
    grid-column: 1 / -1;
    padding: 18px 18px 16px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
}

.ts-home .ts-patch-quality-bar--company .ts-quality-bar__track i {
    background: linear-gradient(90deg, #69b5f2, #e6819f);
}

.ts-home .ts-quality-details[data-ts-quality-patched="true"] .ts-quality-footnote {
    padding-top: 2px;
    line-height: 1.55;
}

html.ts-patch-modal-open,
body.ts-patch-modal-open {
    overflow: hidden !important;
}

.ts-patch-dialog,
.ts-patch-dialog *,
.ts-patch-dialog *::before,
.ts-patch-dialog *::after {
    box-sizing: border-box;
}

.ts-patch-dialog {
    width: min(760px, calc(100vw - 32px));
    max-width: none;
    max-height: min(94vh, 980px);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 24px;
    color: #152235;
    background: transparent;
    box-shadow: 0 36px 110px rgba(3, 12, 27, 0.48);
}

.ts-patch-dialog--document {
    width: min(1180px, calc(100vw - 32px));
    max-height: 94vh;
}

.ts-patch-dialog::backdrop {
    background: rgba(2, 10, 24, 0.79);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ts-patch-dialog.is-fallback-open {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    width: 100vw;
    height: 100vh;
    max-height: none;
    place-items: center;
    padding: 16px;
    border-radius: 0;
    background: rgba(2, 10, 24, 0.79);
}

.ts-patch-dialog__panel {
    display: flex;
    width: 100%;
    max-height: min(94vh, 980px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: #fff;
}

.ts-patch-dialog__header {
    position: relative;
    display: flex;
    min-height: 108px;
    flex: 0 0 auto;
    gap: 28px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 70px 22px 30px;
    color: #fff;
    background:
        radial-gradient(circle at 80% -20%, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(135deg, #0b1f3a 0%, #173f68 62%, #8c1d40 150%);
}

.ts-patch-dialog__kicker {
    display: block;
    margin-bottom: 6px;
    color: #a9d2f4;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ts-patch-dialog__header h2 {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    font-weight: 850;
    letter-spacing: -0.025em;
    line-height: 1.16;
}

.ts-patch-dialog__header p {
    max-width: 760px;
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.88rem;
    line-height: 1.45;
}

.ts-patch-dialog__close {
    position: absolute;
    top: 18px;
    right: 20px;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: none;
    font: 300 2rem/1 Arial, sans-serif;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.ts-patch-dialog__close:hover,
.ts-patch-dialog__close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(4deg);
    outline: none;
}

.ts-patch-dialog__content {
    overflow: auto;
    padding: 26px 30px 30px;
    overscroll-behavior: contain;
}

.ts-patch-dialog__intro {
    margin: 0 0 22px;
    color: #5e6d80;
    font-size: 0.96rem;
    line-height: 1.65;
}

.ts-patch-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ts-patch-form-grid label,
.ts-patch-consent {
    display: flex;
    gap: 7px;
    flex-direction: column;
    margin: 0;
    color: #213248;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.35;
}

.ts-patch-form-grid label > span em,
.ts-patch-consent em {
    color: #8c1d40;
    font-style: normal;
}

.ts-patch-form-grid__full {
    grid-column: 1 / -1;
}

.ts-patch-form-grid input,
.ts-patch-form-grid select,
.ts-patch-form-grid textarea {
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #cfd8e3;
    border-radius: 11px;
    color: #17263a;
    background: #fff;
    box-shadow: 0 1px 2px rgba(4, 16, 31, 0.03) inset;
    font: 500 0.92rem/1.45 inherit;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ts-patch-form-grid textarea {
    min-height: 126px;
    resize: vertical;
}

.ts-patch-form-grid input:focus,
.ts-patch-form-grid select:focus,
.ts-patch-form-grid textarea:focus {
    border-color: #2267a5;
    box-shadow: 0 0 0 3px rgba(34, 103, 165, 0.13);
}

.ts-patch-consent {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    margin-top: 18px;
    color: #56667a;
    font-weight: 600;
}

.ts-patch-consent input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: #2267a5;
}

.ts-patch-form-footer {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
}

.ts-patch-contact-fallback {
    display: flex;
    gap: 4px;
    flex-direction: column;
    color: #68778a;
    font-size: 0.78rem;
    line-height: 1.4;
}

.ts-patch-contact-fallback a {
    color: #2267a5;
    font-weight: 750;
    text-decoration: none;
}

.ts-patch-submit,
.ts-patch-open-document {
    display: inline-flex;
    min-height: 46px;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    color: #fff !important;
    background: #8c1d40;
    box-shadow: 0 9px 22px rgba(140, 29, 64, 0.2);
    font: 800 0.85rem/1.25 inherit;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.ts-patch-submit:hover,
.ts-patch-submit:focus-visible,
.ts-patch-open-document:hover,
.ts-patch-open-document:focus-visible {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(140, 29, 64, 0.27);
    outline: none;
}

.ts-patch-submit:disabled {
    opacity: 0.64;
    cursor: wait;
    transform: none;
}

.ts-patch-form-status {
    min-height: 22px;
    margin-top: 14px;
    padding: 0;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
}

.ts-patch-form-status.is-working,
.ts-patch-form-status.is-success,
.ts-patch-form-status.is-error {
    padding: 10px 12px;
}

.ts-patch-form-status.is-working {
    color: #244a70;
    background: #eaf3fb;
}

.ts-patch-form-status.is-success {
    color: #17633b;
    background: #e9f7ef;
}

.ts-patch-form-status.is-error {
    color: #8b2037;
    background: #fbecef;
}

.ts-patch-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.ts-patch-document-viewer {
    display: grid;
    min-height: min(68vh, 760px);
    flex: 1 1 auto;
    place-items: center;
    overflow: auto;
    padding: 22px;
    background:
        linear-gradient(45deg, #eef2f6 25%, transparent 25%) 0 0 / 22px 22px,
        linear-gradient(45deg, transparent 75%, #eef2f6 75%) 0 0 / 22px 22px,
        linear-gradient(45deg, transparent 75%, #eef2f6 75%) 11px -11px / 22px 22px,
        linear-gradient(45deg, #eef2f6 25%, #f6f8fa 25%) 11px 11px / 22px 22px;
    overscroll-behavior: contain;
}

.ts-patch-document-viewer img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(68vh, 920px);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(6, 20, 39, 0.2);
    object-fit: contain;
}

.ts-patch-document-viewer iframe {
    display: block;
    width: 100%;
    height: min(70vh, 820px);
    min-height: 560px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(6, 20, 39, 0.16);
}

.ts-patch-viewer-error {
    max-width: 520px;
    padding: 22px;
    border: 1px solid #d7dfe8;
    border-radius: 14px;
    color: #5b6878;
    background: #fff;
    text-align: center;
}

.ts-patch-dialog__footer {
    display: flex;
    min-height: 72px;
    flex: 0 0 auto;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 24px;
    border-top: 1px solid #e2e8ef;
    color: #68778a;
    background: #fff;
    font-size: 0.78rem;
}



/* Petite flèche fixe permettant de revenir en haut de la page. */
.ts-patch-back-to-top {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 99980;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(145deg, #173f68, #0b1f3a);
    box-shadow: 0 12px 30px rgba(5, 20, 39, 0.26);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.92);
    pointer-events: none;
    cursor: pointer;
    transition:
        opacity 180ms ease,
        visibility 180ms ease,
        transform 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

.ts-patch-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ts-patch-back-to-top svg {
    display: block;
    width: 20px;
    height: 20px;
}

.ts-patch-back-to-top:hover,
.ts-patch-back-to-top:focus-visible {
    color: #fff;
    background: linear-gradient(145deg, #a32a52, #8c1d40);
    box-shadow: 0 15px 34px rgba(58, 15, 35, 0.31);
    transform: translateY(-2px) scale(1.02);
    outline: none;
}

.ts-patch-back-to-top:focus-visible {
    box-shadow:
        0 0 0 4px rgba(105, 181, 242, 0.28),
        0 15px 34px rgba(58, 15, 35, 0.31);
}

html.ts-patch-modal-open .ts-patch-back-to-top,
body.ts-patch-modal-open .ts-patch-back-to-top {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


@media (max-width: 720px) {
    .ts-patch-back-to-top {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 40px;
        height: 40px;
    }

    .ts-patch-back-to-top.has-mobile-cta {
        bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px));
    }

    .ts-home .ts-patch-quality-context {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .ts-home .ts-patch-quality-context p {
        text-align: left;
    }

    .ts-home .ts-patch-stat {
        min-height: 148px;
    }

    .ts-patch-dialog,
    .ts-patch-dialog--document {
        width: calc(100vw - 18px);
        max-height: 97vh;
        border-radius: 18px;
    }

    .ts-patch-dialog__panel {
        max-height: 97vh;
        border-radius: 18px;
    }

    .ts-patch-dialog__header {
        min-height: 94px;
        padding: 20px 58px 18px 20px;
    }

    .ts-patch-dialog__close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
    }

    .ts-patch-dialog__content {
        padding: 20px;
    }

    .ts-patch-form-grid {
        grid-template-columns: 1fr;
    }

    .ts-patch-form-grid__full {
        grid-column: auto;
    }

    .ts-patch-form-footer,
    .ts-patch-dialog__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .ts-patch-submit,
    .ts-patch-open-document {
        width: 100%;
    }

    .ts-patch-dialog__footer {
        padding: 14px;
        text-align: center;
    }

    .ts-patch-document-viewer {
        min-height: 64vh;
        padding: 10px;
    }

    .ts-patch-document-viewer iframe {
        height: 66vh;
        min-height: 460px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ts-patch-back-to-top,
    .ts-patch-dialog *,
    .ts-patch-dialog *::before,
    .ts-patch-dialog *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


@media print {
    .ts-patch-back-to-top {
        display: none !important;
    }
}
