/*
 * Isolation Divi : Customizer h1–h6{color}, html{font-size:calc()}.
 */
html {
    font-size: 16px !important;
}

body.afpia-ent-canvas {
    color: #10241A !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
}

body.afpia-ent-canvas h1,
body.afpia-ent-canvas h2,
body.afpia-ent-canvas h3,
body.afpia-ent-canvas h4,
body.afpia-ent-canvas h5,
body.afpia-ent-canvas h6 {
    color: inherit !important;
    font-weight: inherit !important;
}

body.afpia-ent-canvas a {
    color: inherit !important;
}

/* Couleurs utilitaires : battre Divi (a{color}, héritage text-cream sur les CTA). */
body.afpia-ent-canvas .text-ink {
    color: #10241A !important;
}

body.afpia-ent-canvas .text-lime {
    color: #B9E97D !important;
}

body.afpia-ent-canvas .text-cream {
    color: #F6F1E6 !important;
}

body.afpia-ent-canvas .bg-lime {
    background-color: #B9E97D !important;
}

body.afpia-ent-canvas .bg-ink {
    background-color: #10241A !important;
}

body.afpia-ent-canvas .bg-forest {
    background-color: #173226 !important;
}

body.afpia-ent-canvas .bg-cream {
    background-color: #F6F1E6 !important;
}

/* CTA : fond + texte explicites (Divi écrase sinon les classes Tailwind). */
body.afpia-ent-canvas a.bg-lime,
body.afpia-ent-canvas a.bg-lime.text-ink {
    background-color: #B9E97D !important;
    color: #10241A !important;
}

body.afpia-ent-canvas a.bg-lime.hover\:bg-ink:hover {
    background-color: #10241A !important;
    color: #B9E97D !important;
}

body.afpia-ent-canvas a.bg-lime.hover\:bg-cream:hover {
    background-color: #F6F1E6 !important;
    color: #10241A !important;
}

body.afpia-ent-canvas a.bg-ink,
body.afpia-ent-canvas a.bg-ink.text-lime,
body.afpia-ent-canvas a#mobile-cta {
    background-color: #10241A !important;
    color: #B9E97D !important;
}

body.afpia-ent-canvas a.bg-ink.hover\:bg-forest:hover {
    background-color: #173226 !important;
    color: #B9E97D !important;
}

body.afpia-ent-canvas .font-display,
body.afpia-ent-canvas h1.display-title,
body.afpia-ent-canvas h2.display-title,
body.afpia-ent-canvas h3.display-title,
body.afpia-ent-canvas .display-title {
    font-weight: 900 !important;
}
/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
@font-face {
    font-family: "Aspekta";
    src: url("assets/fonts/Aspekta-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Aspekta";
    src: url("assets/fonts/Aspekta-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
@font-face {
    font-family: "Big Shoulders Display";
    src: url("assets/fonts/BigShouldersDisplay-Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: "Aspekta", system-ui, sans-serif;
    background: #F6F1E6;
    color: #10241A;
    overflow-x: clip;
    max-width: 100%;
}

::selection {
    background: #B9E97D;
    color: #10241A;
}

.font-display {
    font-family: "Big Shoulders Display", Impact, sans-serif;
    font-weight: 900;
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
h1.display-title,
h2.display-title,
h3.display-title,
.display-title {
    line-height: 1.2;
    letter-spacing: -0.005em;
    padding-top: 0.22em;
}

h2.display-title {
    line-height: 1.22;
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
h2.display-title.part-title {
    line-height: 1.08;
}

@media (min-width: 640px) {
    h2.display-title.part-title {
        line-height: 1.22;
    }
}

.hero-copy h1.display-title,
.hero-copy .display-title {
    line-height: 1.18;
    padding-top: 0.1em;
}

.mark {
    background: #B9E97D;
    color: #10241A;
    padding: 0 0.18em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.site-header {
    background: #F6F1E6;
}

.shell {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.box-panel {
    border-radius: 1.75rem;
    overflow: hidden;
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.box-panel--allow-sticky,
.box-panel--bleed {
    overflow: visible;
}

@media (min-width: 1024px) {
    .box-panel {
        border-radius: 2.4rem;
    }
}

section[id] {
    scroll-margin-top: 5.5rem;
}

body.admin-bar header.site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar header.site-header {
        top: 46px;
    }
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.hero-panel {
    display: flex;
    flex-direction: column;
}

.hero-media {
    position: relative;
}

.hero-media img {
    width: 100%;
    aspect-ratio: 2 / 1;
    max-height: min(34svh, 13rem);
    object-fit: cover;
    object-position: center 74%;
    display: block;
}

.hero-media::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 32%;
    z-index: 1;
    background: linear-gradient(180deg, #173226 0%, transparent 100%);
    pointer-events: none;
}

@media (min-width: 640px) and (max-width: 1023px) {
    .hero-media img {
        aspect-ratio: 16 / 9;
        max-height: min(38svh, 16.5rem);
        object-position: center 70%;
    }
}

@media (min-width: 1024px) {
    .hero-panel {
        display: grid;
        /*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
        grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
        min-height: min(34rem, calc(100svh - 7.5rem));
    }

    .hero-copy {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        order: -1;
    }

    .hero-media {
        order: 0;
        min-height: 100%;
    }

    .hero-media::before {
        inset: 0 auto 0 0;
        width: min(40%, 12rem);
        height: auto;
        background: linear-gradient(90deg, #173226 0%, rgba(23, 50, 38, 0) 100%);
    }

    .hero-media img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center 82%;
        border-radius: 0;
    }
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.hero-scroll-star {
    display: none;
}

@media (min-width: 1024px) {
    .hero-frame {
        isolation: isolate;
    }

    .hero-scroll-star {
        display: block;
        position: absolute;
        left: 45%;
        top: 100%;
        z-index: 30;
        width: clamp(170px, 15vw, 230px);
        pointer-events: none;
        transform: translate(-50%, -50%);
    }

    .hero-scroll-star img {
        display: block;
        width: 100%;
        height: auto;
        transform: rotate(var(--hero-star-rot, 0deg));
        will-change: transform;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-star img,
    .decor--star img {
        transform: none !important;
    }
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.js .reveal {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition:
        opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.js .reveal.is-inview {
    opacity: 1;
    transform: none;
    will-change: auto;
}

.card-media {
    overflow: hidden;
}

.card-media img {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-inview:hover .card-media img {
    transform: scale(1.04);
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.decor {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.decor img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.decor--wood {
    inset: -4% 0 auto auto;
    width: min(48%, 400px);
    aspect-ratio: 1;
    opacity: 0.28;
    mix-blend-mode: screen;
    animation: decor-drift 18s ease-in-out infinite alternate;
}

.decor--wood img {
    object-fit: cover;
    filter: brightness(1.15);
}

.decor--star {
    width: clamp(120px, 16vw, 200px);
    aspect-ratio: 1;
    opacity: 0.95;
    z-index: 6;
}

.decor--star img {
    transform: rotate(var(--decor-star-rot, 0deg));
    will-change: transform;
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.decor--star-br {
    right: 0;
    bottom: 0;
    translate: 48% 48%;
}

.decor--star-tr {
    top: 0;
    right: 0;
    translate: 48% -48%;
}

.decor--chair {
    width: min(42%, 320px);
    aspect-ratio: 1;
    opacity: 0.12;
    animation: decor-float 10s ease-in-out infinite alternate;
}

.decor--chair-br {
    right: 0;
    bottom: 0;
}

.decor--chair-bl {
    left: 0;
    bottom: -2%;
}

@keyframes decor-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes decor-float {
    from { transform: translate3d(0, 0, 0) rotate(-2deg); }
    to { transform: translate3d(0, -10px, 0) rotate(2deg); }
}

@keyframes decor-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-8px, 10px, 0) scale(1.04); }
}

.check {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 0.85rem;
    border-radius: 0.9rem;
    background: #fff;
    border: 1px solid rgba(16, 36, 26, 0.08);
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.check:hover {
    border-color: rgba(16, 36, 26, 0.22);
    background: #faf8f2;
}

.check:has(input:checked) {
    border-color: #10241A;
    background: #B9E97D;
}

.check input {
    margin-top: 0.2rem;
    accent-color: #10241A;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.field {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(16, 36, 26, 0.12);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    font: inherit;
    color: #10241A;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field:focus {
    border-color: #10241A;
    box-shadow: 0 0 0 3px #B9E97D;
}

.field::placeholder {
    color: rgba(16, 36, 26, 0.38);
}

.site-footer a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer a:hover {
    opacity: 0.75;
}

/*
 * AFPIA Entreprises — styles landing (plugin)
 * Version: 1.0.0
 */
.legal-content {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(16, 36, 26, 0.92);
}

.legal-content > * + * {
    margin-top: 1rem;
}

.legal-content h2 {
    font-family: "Big Shoulders Display", Impact, sans-serif;
    font-weight: 900;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    line-height: 1;
    text-transform: uppercase;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    color: #10241A;
}

.legal-content .legal-lead {
    margin-top: 0;
}

.legal-content ul {
    list-style: disc;
    padding-left: 1.25rem;
}

.legal-content ul ul {
    margin-top: 0.5rem;
    list-style: circle;
}

.legal-content a {
    color: #10241A;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-content a:hover {
    color: #173226;
}

.legal-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid rgba(16, 36, 26, 0.12);
    border-radius: 1rem;
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 520px;
}

.legal-content th,
.legal-content td {
    text-align: left;
    vertical-align: top;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(16, 36, 26, 0.1);
}

.legal-content thead th {
    background: #173226;
    color: #F6F1E6;
    font-weight: 700;
    border-bottom: none;
}

.legal-content tbody tr:last-child td {
    border-bottom: none;
}

.legal-content td p + p {
    margin-top: 0.65rem;
}

@media (max-width: 767px) {
    .decor--wood,
    .decor--chair {
        width: 55%;
        opacity: 0.1;
    }

    .decor--star {
        width: clamp(96px, 28vw, 140px);
        opacity: 0.95;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .reveal,
    .card-media img,
    .check {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .decor--wood,
    .decor--star,
    .decor--chair {
        animation: none !important;
    }
}
