/* ===== Socle commun site Servitech =====

   Police « Titillium Web » servie en local depuis site/fonts/, sous licence SIL OFL dont le
   texte est déposé à côté des fichiers : aucun appel à un tiers.
   Trois graisses (400, 600, 700), sans italique : les seules employées par le site. */

@font-face {
    font-family: 'Titillium Web';
    src: url('../fonts/TitilliumWeb-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    /* le texte s'affiche tout de suite dans la police système, puis bascule */
    font-display: swap;
}

@font-face {
    font-family: 'Titillium Web';
    src: url('../fonts/TitilliumWeb-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Titillium Web';
    src: url('../fonts/TitilliumWeb-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


:root {
    --vert: #009c49;
    --vert-fonce: #006931;
    --vert-bordure: #007d3b;
    --noir: #000;
    --texte: #333333;
    --gris-clair: #f5f6f7;
    --gris-bord: #e2e2e2;
    --ombre-carte: 0 6px 24px rgba(0, 0, 0, 0.10);
    /* Largeur du conteneur, reprise du template d'origine. */
    --largeur: 1170px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Titillium Web', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--texte);
    font-size: 16px;
    line-height: 1.6;
    background: #fff;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.2;
    color: #222;
}

h1 { font-size: 2.6em; }
h2 { font-size: 2.1em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.25em; }

img {
    max-width: 100%;
}

a {
    color: var(--vert);
}

a:hover {
    color: var(--vert-fonce);
}

.adapt-content {
    margin: auto;
    max-width: var(--largeur);
    padding: 0 15px;
}

/* Sur petit écran, 15 px ne suffisent pas : le texte des pages intérieures venait coller aux
   bords. La gouttière s'élargit — un seul endroit, tout le site en profite. */
@media all and (max-width: 800px) {
    .adapt-content {
        padding: 0 24px;
    }
}

/* Bouton principal — vert du template, bordure plus foncée comme dans preset1.css */
.btn {
    display: inline-block;
    background-color: var(--vert);
    border: 1px solid var(--vert-bordure);
    color: #fff;
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--vert-fonce);
    border-color: #005025;
    color: #fff;
}

/* Variante claire : celle du bandeau d'accueil et du bandeau « Pour tout renseignement »,
   où le bouton se détache sur le vert ou sur le fond rayé. */
.btn-clair {
    background-color: #f2f2f2;
    border-color: #f2f2f2;
    color: #444;
}

.btn-clair:hover {
    background-color: var(--noir);
    border-color: var(--noir);
    color: #fff;
}

/* ===== Ornement sous les titres de section =====

   Losange centré encadré de deux traits, en trois couches de background sur un seul
   pseudo-élément : ni balisage supplémentaire, ni police d'icônes. La largeur totale de
   350 px laisse une trentaine de pixels libres au centre pour le losange. */
.titre-orne::after {
    content: "";
    display: block;
    width: 350px;
    max-width: 100%;
    height: 14px;
    margin: 20px auto 42px;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5z' fill='%23009c49'/%3E%3C/svg%3E"),
        linear-gradient(#d5d5d5, #d5d5d5),
        linear-gradient(#d5d5d5, #d5d5d5);
    background-size: 13px 13px, 160px 1px, 160px 1px;
    background-position: center, left center, right center;
    background-repeat: no-repeat;
}

/* ===== En-tête ===== */
.entete {
    position: relative;
    z-index: 20;
}

/* ----- Barre supérieure (coordonnées + accès extranet) ----- */
.topbar {
    background-color: var(--vert);
    color: #fff;
    font-size: 15px;
}

.topbar .adapt-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.topbar a {
    color: #fff;
    text-decoration: none;
}

.topbar a:hover {
    text-decoration: underline;
}

/* Pictogrammes blancs : la barre est verte, un picto vert y serait invisible. */
.topbar .ico {
    height: 15px;
    width: 15px;
    vertical-align: -2px;
    margin-right: 6px;
    fill: #fff;
}

.topbar .coord {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
}

/* ----- Barre de menu ----- */
header {
    background: #fff;
}

header .top-bar {
    display: flex;
    align-items: center;
    padding-top: 16px;
    padding-bottom: 16px;
}

/* Sticky : le menu réapparaît fixe en glissant du haut une fois défilé hors de vue */
header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    animation: slideInDown 0.7s both;
}

header.sticky .top-bar {
    padding-top: 9px;
    padding-bottom: 9px;
}

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    header.sticky {
        animation: none;
    }
}

#logo img {
    max-width: 250px;
    max-height: 55px;
    display: block;
    height: auto;
}

.top-menu {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 26px;
}

.top-menu a {
    text-decoration: none;
    color: #222;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.top-menu a:hover, .top-menu a.selected {
    color: var(--vert);
}

/* « Mon espace client » : seule entrée du menu qui quitte le site (elle mène à
   extranet.servitech.re). Elle est traitée en bouton pour la distinguer des rubriques,
   dans la barre de menu comme dans le menu mobile. */
.btn-extranet {
    background: var(--vert);
    border: 1px solid var(--vert-bordure);
    border-radius: 3px;
    padding: 8px 18px;
}

.top-menu .btn-extranet,
.top-menu .btn-extranet:hover,
#mobile-menu .btn-extranet,
#mobile-menu .btn-extranet:hover {
    color: #fff;
}

.btn-extranet:hover {
    background: var(--vert-fonce);
    border-color: #005025;
}

#mobile-menu .btn-extranet {
    margin: 22px 24px;
    padding: 12px 18px;
    text-align: center;
    border: 1px solid var(--vert-bordure);
}

#mobile-menu .btn-extranet::before {
    content: none;
}

/* menu mobile */
.ico-menu {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--vert);
    cursor: pointer;
    padding: 0 5px;
}

/* Panneau glissant depuis la droite. */
#mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    width: min(320px, 85vw);
    display: flex;
    flex-direction: column;
    background: #3c3c3c;
    overflow-y: auto;
    padding-top: 70px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s;
}

#mobile-menu.visible {
    transform: none;
    visibility: visible;
}

#voile-menu {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

#voile-menu.visible {
    opacity: 1;
    visibility: visible;
}

#mobile-menu a {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 15px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Chevron « › » en CSS, comme les puces du pied de page : aucune police d'icônes. */
#mobile-menu a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 14px;
    vertical-align: 2px;
    border-top: 2px solid var(--vert);
    border-right: 2px solid var(--vert);
    transform: rotate(45deg);
}

#mobile-menu a:hover, #mobile-menu a.selected {
    color: var(--vert);
}

.fermer-menu {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 34px;
    height: 34px;
    padding: 0;
    line-height: 1;
    font-size: 26px;
    color: #fff;
    background: var(--vert);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.fermer-menu:hover {
    background: var(--vert-fonce);
}

@media (prefers-reduced-motion: reduce) {
    #mobile-menu, #voile-menu {
        transition: none;
    }
}

/* ===== Bouton « retour en haut » (injecté par scriptMenu.js) ===== */
.haut {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 900;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--vert);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.haut.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.haut:hover {
    background: var(--vert-fonce);
}

.haut svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* ===== Formulaires (accueil et page contact) =====
   Mêmes champs et mêmes règles de part et d'autre ; seule la mise en page diffère, la
   colonne de l'accueil étant deux fois moins large. */
.formulaire input,
.formulaire textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--texte);
}

.formulaire textarea {
    resize: vertical;
    min-height: 114px;
    max-height: 240px;
}

.formulaire input:focus,
.formulaire textarea:focus {
    outline: 2px solid var(--vert);
    border-color: var(--vert);
}

.formulaire label {
    display: block;
    font-weight: 600;
    margin-bottom: 18px;
}

.formulaire label input,
.formulaire label textarea {
    margin-top: 6px;
    font-weight: 400;
}

/* champ honeypot anti-spam : caché aux humains, jamais rempli par eux */
.formulaire .website {
    position: absolute;
    left: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

.formulaire .retour {
    margin: 14px 0 0;
    font-weight: 600;
    min-height: 1.6em;
}

.formulaire .retour.ok {
    color: var(--vert-fonce);
}

.formulaire .retour.ko {
    color: #c00;
}

/* ===== Pied de page ===== */
footer {
    background-color: var(--noir);
    color: #fff;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding-top: 50px;
    padding-bottom: 45px;
}

.footer-part {
    flex: 1;
    min-width: 170px;
}

.footer-part .titre {
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 18px;
    color: #fff;
}

.footer-part ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-part li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-part a {
    display: block;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    line-height: 1.9;
    padding: 3px 0;
}

/* Puce dessinée en CSS : le site ne charge aucune police d'icônes. */
.footer-part.partenaires a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 12px;
    vertical-align: 2px;
    border-top: 2px solid var(--vert);
    border-right: 2px solid var(--vert);
    transform: rotate(45deg);
}

.footer-part a:hover {
    color: var(--vert);
    text-decoration: none;
}

.footer-part.groupe {
    text-align: center;
    font-size: 15px;
    color: #fff;
}

.footer-part.groupe img {
    height: 49px;
    width: auto;
    margin-bottom: 15px;
    background-color: #fff;
    padding: 6px 12px;
    border-radius: 3px;
}

.copyright {
    background: #111;
    font-size: 15px;
    padding: 16px 0;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.copyright a {
    color: #fff;
}

.copyright a:hover {
    color: var(--vert);
}

/* ===== Responsive ===== */

/* L'en-tête bascule en mode mobile à 950 px : en dessous, les six entrées du menu
   (« Mon espace client » comprise) ne tiennent plus sur une ligne à côté du logo. */
@media all and (max-width: 950px) {
    .topbar {
        display: none;
    }

    .top-menu {
        display: none;
    }

    /* burger à gauche, logo centré */
    .ico-menu {
        display: block;
        order: -1;
    }

    #logo {
        margin: 0 auto;
        min-width: 0;
    }

    #logo img {
        max-width: min(220px, calc(100vw - 120px));
    }

    header .top-bar::after {
        content: "";
        width: 36px;
    }
}

@media all and (max-width: 800px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.7em; }

    .footer {
        gap: 20px;
    }

    /* Les trois colonnes « Sites partenaires » ne sont qu'une seule liste découpée en trois.
       Sur petit écran, les répartir en deux colonnes laissait la troisième décalée toute
       seule : elles se réunissent donc en **une liste continue**, au même rythme que la
       colonne « Liens ». Les titres des deux suites disparaissent (ils sont vides) et leur
       marge négative annule le `gap` du pied de page, pour que les filets s'enchaînent sans
       trou. */
    .footer-part {
        flex: 1 1 100%;
    }

    .footer-part.partenaires.suite {
        margin-top: -20px;
    }

    .footer-part.partenaires.suite .titre {
        display: none;
    }
}
