/* ========================================
   AISRENO — PAGE « CÓMO FUNCIONA » (CAE)
   Styles dédiés, chargés uniquement par financiacion-cae.html.
   Toutes les règles sont limitées à body.page-cae.
   ======================================== */

/* ---------- HERO ---------- */

/* Fond photo du hero : classe commune .hero-photo (hero-photo.css).
   Sur la photo : textes du hero un peu plus foncés (contraste AA), comme sur Requisitos */
body.page-cae .hero-photo .cae-hero-copy>.eyebrow {
    color: #14532d;
}

body.page-cae .hero-photo .lead,
body.page-cae .hero-photo .micro {
    color: #3f524b;
}

body.page-cae .cae-offer {
    padding: 0 0 34px;
    overflow: hidden;
    transform-style: preserve-3d;
    box-shadow:
        0 30px 60px -20px rgba(7, 60, 44, 0.22),
        0 10px 24px rgba(15, 41, 34, 0.06);
}

body.page-cae .cae-offer>.eyebrow,
body.page-cae .cae-offer>.price,
body.page-cae .cae-offer>h2,
body.page-cae .cae-offer>.ticks,
body.page-cae .cae-offer>p {
    margin-left: 40px;
    margin-right: 40px;
}

body.page-cae .cae-offer>.eyebrow {
    margin-top: 26px;
    margin-bottom: 0;
}

body.page-cae .cae-offer .price {
    font-size: 92px;
    margin: 4px 40px 6px;
}

body.page-cae .cae-offer .price span {
    font-size: 54px;
}

/* Maison en coupe : un léger effet de profondeur */
body.page-cae .cae-house {
    position: relative;
    padding: 26px 26px 10px;
    background: linear-gradient(180deg, #eef5ea 0%, #f8fbf6 100%);
    border-bottom: 1px solid var(--line);
    perspective: 900px;
}

body.page-cae .cae-house svg {
    display: block;
    width: 100%;
    height: auto;
    transform: rotateX(6deg) rotateY(-8deg);
    transform-origin: 50% 100%;
}

body.page-cae .cae-house-tag {
    position: absolute;
    left: 18px;
    top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e6d6ad;
    color: #6b5420;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(15, 41, 34, 0.08);
}

/* Pastille de légende : même couleur que la couche d'isolant */
body.page-cae .cae-house-tag::before {
    content: "";
    width: 12px;
    height: 8px;
    border-radius: 2px;
    background: #f0d79a;
    border: 1px solid #c9a75a;
}

/* ---------- NAVIGATION DE SECTION ---------- */

body.page-cae .section-nav .wrap {
    gap: 10px;
    padding-block: 14px;
}

body.page-cae .section-nav a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

body.page-cae .section-nav a:hover {
    border-color: #b9d3b5;
    background: #f3f7f2;
}

/* ---------- 01 : SCHÉMA CAE ---------- */

body.page-cae .cae-schema-box {
    margin-top: 64px;
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f7faf5 100%);
}

body.page-cae .cae-schema-title {
    font-size: 26px;
    margin-bottom: 34px;
}

body.page-cae .cae-schema-title .eyebrow {
    margin-bottom: 12px;
    letter-spacing: 1.9px;
}

body.page-cae .cae-schema {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Ligne qui relie les étapes */
body.page-cae .cae-schema::before {
    content: "";
    position: absolute;
    left: 28px;
    right: calc((100% - 88px) / 5 - 28px);
    top: 27px;
    height: 2px;
    background: linear-gradient(90deg, #15803d, #c4a466);
    transform-origin: left center;
    border-radius: 2px;
}

body.page-cae .cae-schema li {
    position: relative;
}

body.page-cae .cae-node {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #15803d;
    color: #15803d;
    box-shadow: 0 0 0 6px #f7faf5;
}

body.page-cae .cae-node svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.page-cae .cae-schema-result .cae-node {
    background: #15803d;
    color: #ffffff;
    border-color: #15803d;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.02em;
    box-shadow: 0 0 0 6px #f7faf5, 0 0 0 8px #c4a466;
}

body.page-cae .cae-schema h4 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

body.page-cae .cae-schema p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

body.page-cae .cae-schema-result h4 {
    color: #15803d;
}

/* ---------- 02 : FRISE (section sombre) ---------- */

body.page-cae .cae-flow {
    position: relative;
}

body.page-cae .cae-flow li {
    position: relative;
    border-top: 0;
    padding-top: 0;
}

body.page-cae .cae-flow li>span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 22px;
    border-radius: 50%;
    border: 1px solid #ffffff40;
    background: #0a4a36;
    color: #e8d6a8;
    font-size: 13px;
}

/* Trait doré entre les pastilles (ordinateur) */
body.page-cae .cae-flow li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 22px;
    left: 60px;
    right: -30px;
    height: 1px;
    background: linear-gradient(90deg, #c4a466, #ffffff26);
}

/* ---------- 03 : CE QUI EST INCLUS ---------- */

body.page-cae .cae-included {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

body.page-cae .cae-included article {
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 41, 34, 0.05);
}

body.page-cae .cae-included article>span {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background: #ecf5e8;
    /* vert profond : contraste AA sur le fond vert clair */
    color: #166534;
}

body.page-cae .cae-included h3 {
    font-size: 19px;
}

/* ---------- ENCART DE RÉASSURANCE ---------- */

body.page-cae .cae-trust-section {
    padding-bottom: 0;
}

body.page-cae .cae-trust {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 56px;
    align-items: center;
    padding: 44px;
    border-radius: 22px;
    background: #ffffff;
    border: 1px solid var(--line);
    position: relative;
}

body.page-cae .cae-trust::before {
    content: "";
    position: absolute;
    right: 40px;
    top: 0;
    width: 44px;
    height: 5px;
    background: var(--gold);
}

body.page-cae .cae-trust h2 {
    font-size: 34px;
}

body.page-cae .cae-trust-intro p {
    color: var(--muted);
}

body.page-cae .cae-trust-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}

body.page-cae .cae-trust-list li {
    position: relative;
    padding: 16px 18px 16px 52px;
    border-radius: 12px;
    background: #f3f7f2;
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

body.page-cae .cae-trust-list li strong {
    color: var(--ink);
}

body.page-cae .cae-trust-list li::before {
    content: "✓";
    position: absolute;
    left: 16px;
    top: 15px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #15803d;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

body.page-cae .cae-trust-list .cae-trust-limit {
    background: #fbf6ea;
}

body.page-cae .cae-trust-list .cae-trust-limit::before {
    content: "i";
    background: #a8842f;
    font-style: italic;
}

/* ---------- PHOTOS ---------- */

body.page-cae .photo-card {
    box-shadow: 0 10px 30px rgba(15, 41, 34, 0.05);
}

/* ---------- FAQ ---------- */

body.page-cae .cae-faq-help {
    font-size: 15px;
}

body.page-cae .cae-faq-help a {
    color: var(--green);
    font-weight: 700;
    white-space: nowrap;
}

body.page-cae .cae-questions {
    display: grid;
    gap: 12px;
}

body.page-cae .cae-questions details,
body.page-cae .cae-questions details:first-child {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    padding: 0 22px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.page-cae .cae-questions details[open] {
    border-color: #b9d3b5;
    box-shadow: 0 10px 30px rgba(15, 41, 34, 0.06);
}

body.page-cae .cae-questions summary {
    padding: 19px 0;
}

body.page-cae .cae-questions summary::after {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ecf5e8;
    font-size: 20px;
}

body.page-cae .cae-questions .answer {
    padding-bottom: 8px;
}

/* ---------- CLÔTURE ---------- */

body.page-cae .cae-closing {
    background:
        radial-gradient(ellipse at 100% 0%, #d7e8cc, transparent 55%),
        #e9f0e2;
}

/* Sur-titre en vert profond : contraste AA sur le fond de clôture */
body.page-cae .cae-closing .eyebrow {
    color: #166534;
}

/* ========================================
   ANIMATIONS (une seule fois, jamais en boucle)
   Uniquement transform / opacity.
   L'inclinaison au survol ([data-tilt]) est dans effets-3d.css.
   ======================================== */

@media (prefers-reduced-motion: no-preference) {

    /* 1. Hero : la maison se pose en profondeur, l'isolant se met en place */
    body.page-cae .cae-house svg {
        animation: caeHouseIn 0.9s cubic-bezier(.2, .7, .2, 1) both;
    }

    body.page-cae .cae-wool {
        animation: caeWoolIn 0.8s 0.55s cubic-bezier(.2, .7, .2, 1) both;
    }

    body.page-cae .cae-heat {
        animation: caeFadeIn 0.6s 1.2s ease both;
    }

    body.page-cae .cae-house-tag {
        animation: caeTagIn 0.6s 1.3s ease both;
    }

    /* 2. Apparition douce au défilement (seulement si JS actif) */
    .cae-js body.page-cae .reveal {
        opacity: 0;
        transform: translateY(26px);
        transition:
            opacity 0.7s ease,
            transform 0.7s cubic-bezier(.2, .7, .2, 1);
        transition-delay: calc(var(--i, 0) * 90ms);
    }

    .cae-js body.page-cae .reveal.is-visible {
        opacity: 1;
        transform: none;
    }

    /* 3. Schéma CAE : la ligne se trace, puis les étapes s'allument */
    .cae-js body.page-cae .cae-schema::before {
        transform: scaleX(0);
        transition: transform 1.4s cubic-bezier(.4, 0, .2, 1);
    }

    .cae-js body.page-cae .cae-schema li {
        opacity: 0;
        transform: translateY(14px);
        transition:
            opacity 0.5s ease,
            transform 0.5s ease;
        transition-delay: calc(var(--i) * 260ms + 150ms);
    }

    .cae-js body.page-cae .cae-schema.is-visible::before {
        transform: scaleX(1);
    }

    .cae-js body.page-cae .cae-schema.is-visible li {
        opacity: 1;
        transform: none;
    }
}

@keyframes caeHouseIn {
    from {
        opacity: 0;
        transform: rotateX(22deg) rotateY(-20deg) translateY(18px);
    }

    to {
        opacity: 1;
        transform: rotateX(6deg) rotateY(-8deg);
    }
}

@keyframes caeWoolIn {
    from {
        opacity: 0;
        transform: translateY(-26px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes caeFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes caeTagIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1000px) {
    body.page-cae .cae-schema {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 34px;
    }

    body.page-cae .cae-schema::before {
        display: none;
    }

    body.page-cae .cae-trust {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 760px) {
    body.page-cae .cae-offer>.eyebrow,
    body.page-cae .cae-offer>.price,
    body.page-cae .cae-offer>h2,
    body.page-cae .cae-offer>.ticks,
    body.page-cae .cae-offer>p {
        margin-left: 24px;
        margin-right: 24px;
    }

    body.page-cae .cae-offer .price {
        font-size: 76px;
    }

    body.page-cae .cae-offer .price span {
        font-size: 46px;
    }

    body.page-cae .cae-house {
        padding: 18px 16px 6px;
    }

    body.page-cae .section-nav .wrap {
        gap: 8px;
    }

    body.page-cae .section-nav a {
        padding: 7px 12px;
    }

    /* Schéma vertical sur mobile */
    body.page-cae .cae-schema-box {
        margin-top: 44px;
        padding: 26px 20px;
    }

    body.page-cae .cae-schema-title {
        font-size: 22px;
        margin-bottom: 26px;
    }

    body.page-cae .cae-schema {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body.page-cae .cae-schema li {
        display: grid;
        grid-template-columns: 48px 1fr;
        column-gap: 16px;
        padding-bottom: 22px;
    }

    body.page-cae .cae-schema li:last-child {
        padding-bottom: 0;
    }

    body.page-cae .cae-schema li>* {
        grid-column: 2;
    }

    body.page-cae .cae-schema li>.cae-node {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 48px;
        height: 48px;
        margin: 0;
    }

    body.page-cae .cae-schema-result .cae-node {
        font-size: 13px;
    }

    /* Trait vertical entre les pastilles */
    body.page-cae .cae-schema li:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 23px;
        top: 52px;
        bottom: 2px;
        width: 2px;
        background: linear-gradient(180deg, #15803d, #c4a466);
        opacity: 0.5;
    }

    body.page-cae .cae-schema h4 {
        margin-top: 2px;
    }

    body.page-cae .cae-flow li:not(:last-child)::after {
        display: none;
    }

    body.page-cae .cae-flow li>span {
        margin-bottom: 14px;
    }

    body.page-cae .cae-included {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body.page-cae .cae-included article {
        padding: 22px;
    }

    body.page-cae .cae-trust {
        padding: 28px 20px;
    }

    body.page-cae .cae-trust h2 {
        font-size: 28px;
    }

    body.page-cae .cae-trust-list li {
        font-size: 14px;
        padding: 14px 14px 14px 48px;
    }

    body.page-cae .cae-trust-list li::before {
        left: 13px;
        top: 14px;
    }

    body.page-cae .cae-questions details,
    body.page-cae .cae-questions details:first-child {
        padding: 0 16px;
    }
}
