/*
 * SavDirect — feuille de style de la page vitrine.
 *
 * Les valeurs reprennent la charte déjà en place dans app-web (src/index.css)
 * et dans le panneau d'administration (backend/tailwind.config.js). Toute
 * modification de couleur doit rester alignée sur ces deux fichiers.
 */

:root {
    --sage-50: #f4f7f5;
    --sage-100: #e8f0ec;
    --sage-200: #d4e0d9;
    --sage-600: #3d6b5e;
    --sage-700: #2d5347;
    --sage-800: #1e3d32;
    --warm: #fafaf7;
    --navy: #1b2332;
    --navy-light: #5c6b63;
    --white: #ffffff;

    /* Teinte de marque et accent, relevés dans le logo lui-même (`assets/logo.jpg`) :
       le fond est en #1B4956, les bulles en #E4C95E. On retient #194956 pour le
       bandeau, la valeur canonique portée par l'en-tête de app-web (`bg-[#194956]`),
       l'écart de deux points étant invisible derrière le logo.
       L'accent suit en revanche l'or du logo, et non le #d8d759 de
       `app-web/src/index.css` — plus vert, il jurerait à côté de la marque.
       Le logo étant sur fond opaque, tout bandeau qui l'accueille prend cette teinte. */
    --teal: #194956;
    --teal-dark: #123742;
    --accent: #e4c95e;
    --accent-dark: #d0b44b;

    --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Une seule échelle de rythme vertical : les sections respirent pareil. */
    --gutter: 24px;
    --section: 96px;
    --max: 1120px;

    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--navy);
    background-color: var(--warm);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

img,
svg {
    max-width: 100%;
}

.wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Accessibilité : lien d'évitement, visible seulement au clavier. */
.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--sage-700);
    color: var(--white);
    padding: 12px 20px;
    border-radius: 0 0 8px 0;
    z-index: 100;
}

.skip:focus {
    left: 0;
}

:focus-visible {
    outline: 3px solid var(--sage-600);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Sur les bandeaux teal, le contour sage se perdrait dans le fond : la
   navigation au clavier doit rester visible partout. */
.site-header :focus-visible,
.hero :focus-visible,
.cta :focus-visible,
.site-footer :focus-visible {
    outline-color: var(--accent);
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--teal);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--teal-dark);
}

/* Sur un bandeau déjà en teal, un bouton teal disparaîtrait : c'est l'accent
   de la marque qui prend le relais, comme dans l'en-tête de l'application. */
.site-header .btn-primary,
.hero .btn-primary,
.cta .btn-primary {
    background-color: var(--accent);
    color: var(--teal);
}

.site-header .btn-primary:hover,
.hero .btn-primary:hover,
.cta .btn-primary:hover {
    background-color: var(--accent-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--sage-700);
    border: 1px solid var(--sage-200);
}

.btn-secondary:hover {
    border-color: var(--sage-600);
    background-color: var(--sage-50);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 15px;
}

/* ---------- En-tête ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--teal);
    border-bottom: 1px solid var(--teal-dark);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Dernier recours sous 360 px : logo et bouton réclament ~392 px une fois les
       liens masqués. Plutôt que de rogner le bouton, on laisse la ligne se replier. */
    flex-wrap: wrap;
    gap: 12px 16px;
    min-height: 72px;
    padding-block: 12px;
}

.site-header img {
    display: block;
    /* Le logo comporte sa propre marge interne : il lui faut plus de hauteur
       qu'une marque nominale détourée pour peser autant à l'oeil. */
    height: 54px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link {
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--sage-100);
    text-decoration: none;
    border-radius: 8px;
}

.header-link:hover {
    color: var(--accent);
    background-color: var(--teal-dark);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sage-100);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.lang-switch:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--white);
}

.lang-switch img {
    height: 13px;
    width: 18px;
    object-fit: cover;
    border-radius: 2px;
}

/* L'en-tête ne se replie pas : il se dégarnit. Mesuré, les quatre éléments
   réclament plus de 700 px — au-delà d'un certain point, seuls le logo et
   l'appel à l'action restent, et la navigation reste accessible par le
   pied de page. Un menu déroulant serait de trop pour une page unique. */
@media (max-width: 900px) {
    .hide-sm {
        display: none;
    }
}

@media (max-width: 620px) {
    .hide-md {
        display: none;
    }

    .site-header img {
        height: 34px;
    }
}

/* ---------- Hero ---------- */

/*
 * Le hero prolonge l'en-tête dans la teinte de la marque. `isolation` crée un
 * contexte d'empilement propre : le décor peut passer en z-index négatif sans
 * glisser sous le fond de la page.
 */
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding-block: clamp(72px, 12vw, 144px);
    background-color: var(--teal);
    color: var(--white);
    text-align: center;
}

.hero h1 {
    margin-bottom: 24px;
    font-size: clamp(2.25rem, 5.2vw, 3.5rem);
    color: var(--white);
}

.hero .eyebrow {
    color: var(--accent);
}

.hero .lede {
    font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
    color: var(--sage-100);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 40px;
}

.hero .note {
    margin-top: 24px;
    font-size: 15px;
    color: var(--sage-200);
}

/* Sur fond teal, le bouton secondaire passe au trait clair. */
.hero .btn-secondary {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.35);
}

.hero .btn-secondary:hover {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.08);
}

/* ----- Décor animé ----- */

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/*
 * Les halos sont des dégradés radiaux qui s'estompent d'eux-mêmes : pas de
 * `filter: blur()`, coûteux à recalculer à chaque image. Seuls `transform` et
 * `opacity` sont animés, ce que le navigateur confie à la carte graphique.
 */
.halo {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.halo-1 {
    width: 620px;
    height: 620px;
    top: -260px;
    left: -180px;
    background: radial-gradient(circle, rgba(228, 201, 94, 0.30), rgba(228, 201, 94, 0) 68%);
    animation: derive-1 24s ease-in-out infinite alternate;
}

.halo-2 {
    width: 760px;
    height: 760px;
    right: -260px;
    bottom: -360px;
    background: radial-gradient(circle, rgba(64, 140, 158, 0.55), rgba(64, 140, 158, 0) 68%);
    animation: derive-2 28s ease-in-out infinite alternate;
}

.halo-3 {
    width: 440px;
    height: 440px;
    top: 30%;
    left: 58%;
    background: radial-gradient(circle, rgba(228, 201, 94, 0.18), rgba(228, 201, 94, 0) 70%);
    animation: derive-3 32s ease-in-out infinite alternate;
}

@keyframes derive-1 {
    to {
        transform: translate(220px, 140px) scale(1.15);
    }
}

@keyframes derive-2 {
    to {
        transform: translate(-260px, -120px) scale(1.1);
    }
}

@keyframes derive-3 {
    to {
        transform: translate(-340px, 80px) scale(0.85);
    }
}

/* Bulles au trait doré, reprises du logo : très discrètes, elles montent et
   redescendent lentement, chacune à son rythme. */
.bulle {
    position: absolute;
    fill: none;
    stroke: var(--accent);
    stroke-width: 3.5;
    stroke-linejoin: round;
    opacity: 0.22;
    animation: flotte 12s ease-in-out infinite;
}

.bulle-1 {
    width: 92px;
    top: 16%;
    left: 7%;
}

.bulle-2 {
    width: 128px;
    right: 8%;
    bottom: 14%;
    animation-duration: 15s;
    animation-delay: -5s;
}

.bulle-3 {
    width: 60px;
    top: 22%;
    right: 18%;
    opacity: 0.14;
    animation-duration: 10s;
    animation-delay: -2s;
}

@keyframes flotte {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-22px) rotate(-4deg);
    }
}

/* Sous 900 px, les bulles chevaucheraient le titre : on ne garde que les halos. */
@media (max-width: 900px) {
    .bulle {
        display: none;
    }
}

/* ----- Entrée du contenu ----- */

.hero .wrap > * {
    animation: monte 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero .wrap > :nth-child(2) {
    animation-delay: 0.08s;
}

.hero .wrap > :nth-child(3) {
    animation-delay: 0.16s;
}

.hero .wrap > :nth-child(4) {
    animation-delay: 0.24s;
}

.hero .wrap > :nth-child(5) {
    animation-delay: 0.32s;
}

@keyframes monte {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

/* ---------- Sections ---------- */

.section {
    padding-block: var(--section);
}

.section-alt {
    background-color: var(--white);
    border-block: 1px solid var(--sage-200);
}

.section-head {
    margin-bottom: 56px;
}

.section-head.center {
    text-align: center;
}

.section-head h2 {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    margin-bottom: 16px;
}

.section-head p {
    color: var(--navy-light);
}

.eyebrow {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sage-600);
}

/* ---------- Texte et photo côte à côte ---------- */

/*
 * Chaque photo accompagne le texte qu'elle illustre : la cliente avec son
 * parcours, le commercial avec ce que l'entreprise pilote. Les côtés alternent
 * d'une section à l'autre pour rompre la verticalité d'une page très textuelle.
 *
 * Dans le DOM, le texte précède toujours l'image : les lecteurs d'écran
 * lisent le titre avant la description de la photo. L'ordre visuel est
 * réglé par `order`, jamais par le balisage.
 */
.split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
    margin-bottom: 64px;
}

.split .section-head {
    margin-bottom: 0;
}

/* Empilé, la photo passe en tête dans les deux sections : l'œil la retrouve
   toujours au même endroit en défilant. */
.split-media {
    order: -1;
    margin: 0;
}

.split-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 16px;
    background-color: var(--sage-100);
}

@media (min-width: 860px) {
    .split {
        grid-template-columns: 1fr 1fr;
        gap: 64px;
    }

    .split-media {
        order: 0;
    }

    .split--media-left .split-media {
        order: -1;
    }
}

/* ---------- Étapes ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px;
    /* La numérotation est rendue par ::before ; les puces natives feraient doublon.
       L'élément reste un <ol> pour que l'ordre des étapes ait du sens sans CSS. */
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step;
}

.step {
    counter-increment: step;
}

.step::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    margin-bottom: 18px;
    font-family: var(--serif);
    font-size: 2rem;
    color: var(--sage-600);
}

.step h3 {
    font-size: 1.375rem;
    margin-bottom: 10px;
}

.step p {
    color: var(--navy-light);
    font-size: 16px;
    text-align: justify;
}

/* ---------- Cartes ---------- */

/* Deux colonnes plutôt qu'un remplissage automatique : à quatre cartes, `auto-fit`
   en produit trois puis une orpheline, et des colonnes plus larges donnent une
   longueur de ligne plus confortable sur ces textes. */
.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 720px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

.card {
    padding: 32px;
    background-color: var(--warm);
    border: 1px solid var(--sage-200);
    border-radius: 14px;
}

.section-alt .card {
    background-color: var(--sage-50);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card p {
    color: var(--navy-light);
    font-size: 16px;
    text-align: justify;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    border-radius: 11px;
    background-color: var(--sage-100);
    color: var(--sage-700);
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

/* ---------- Liste d'objections ---------- */

.checks {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checks li {
    position: relative;
    padding-left: 44px;
    color: var(--navy-light);
}

/* La coche est décorative : dessinée en CSS, elle n'encombre pas le balisage
   et reste invisible des lecteurs d'écran, qui n'y gagneraient rien. */
.checks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--sage-100);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D5347' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-repeat: no-repeat;
    background-position: center;
}

.checks strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--navy);
}

@media (min-width: 860px) {
    .checks {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px 48px;
    }
}

/* ---------- Appel à l'action final ---------- */

/* Le bloc de clôture est plus sombre que le pied de page, qui doit rester dans
   la teinte exacte du logo. Sans cet écart, les deux bandeaux se confondraient
   en un seul pavé sombre et la page paraîtrait s'arrêter avant sa fin. */
.cta {
    padding-block: var(--section);
    background-color: var(--teal-dark);
    color: var(--sage-50);
    text-align: center;
}

.cta h2 {
    font-size: clamp(1.875rem, 4.5vw, 3rem);
    margin-bottom: 20px;
    color: var(--white);
}

.cta p {
    color: var(--sage-200);
}

.cta .btn-primary {
    margin-top: 40px;
}

.cta-alt {
    margin-top: 24px;
    font-size: 15px;
    color: var(--sage-200);
}

.cta-alt a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Le surtitre est en sage-600 sur les sections claires ; il serait illisible
   sur le fond sombre de l'appel à l'action. */
.cta .eyebrow {
    color: var(--accent);
}

/* ---------- Pied de page ---------- */

/* Le pied de page accueille lui aussi le logo : même teinte, sans quoi le fond
   opaque de l'image découperait un rectangle sombre sur le beige. */
.site-footer {
    background-color:#fff;
    color: var(--sage-100);
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.site-footer img {
    display: block;
    height: 42px;
    width: auto;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
}

.footer-nav a {
    font-size: 15px;
    color: var(--sage-100);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-legal {
    padding-top: 28px;
    border-top: 1px solid var(--teal-dark);
    font-size: 14px;
    color: var(--sage-200);
    text-align: center;
}

/* ---------- Petits écrans ---------- */

@media (max-width: 560px) {
    :root {
        --section: 72px;
    }

    body {
        font-size: 16px;
    }

    .header-link {
        padding: 10px 10px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .card {
        padding: 26px;
    }
}

@media (max-width: 400px) {
    :root {
        --gutter: 18px;
    }

    .site-header .wrap {
        justify-content: center;
    }
}

/* Respecte le réglage système : pas d'animation pour qui n'en veut pas. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        /* Sans cette ligne, une animation infinie ramenée à 0,01 ms tournerait
           des milliers de fois par seconde : un clignotement, pire que le
           mouvement qu'on voulait épargner. */
        animation-iteration-count: 1 !important;
    }

    /* Le décor du hero reste en place, immobile ; le texte apparaît d'emblée. */
    .halo,
    .bulle,
    .hero .wrap > * {
        animation: none !important;
    }
}
