/* =============================================================
   HSR IT Services — Feuille de style principale
   Palette : #FFFFFF, #EEF1F5, #4484CA (uniquement)
   Mobile-first · responsive · compatible navigateurs modernes
   ============================================================= */

:root {
    --white: #FFFFFF;
    --grey:  #EEF1F5;
    --blue:  #4484CA;
    --blue-dark: #356aa3;      /* nuance dérivée pour le survol des boutons */
    --ink:   #1c2733;          /* texte principal (bleu-gris très foncé) */
    --ink-soft: #4a5666;       /* texte secondaire */
    --border: #d9e0ea;
    --shadow: 0 6px 18px rgba(28, 39, 51, 0.08);
    --shadow-hover: 0 10px 26px rgba(68, 132, 202, 0.18);
    --radius: 10px;
    --header-h: 70px;
    --maxw: 1200px;
    --transition: 0.25s ease;
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;               /* garde-fou anti-débordement horizontal */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover, a:focus { color: var(--blue-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--blue);
    color: #fff;
    padding: 10px 16px;
    z-index: 2000;
}
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-block;
    padding: 13px 28px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    text-align: center;
    line-height: 1.2;
}
.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: var(--shadow);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--blue-dark);
    color: #fff;
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* =============================================================
   EN-TÊTE
   ============================================================= */
.site-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 44px; width: auto; }

.primary-nav ul {
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-link {
    display: block;
    padding: 10px 16px;
    color: var(--ink);
    font-weight: 600;
    border-radius: 6px;
    position: relative;
    transition: color var(--transition), background var(--transition);
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 16px; right: 16px; bottom: 6px;
    height: 2px;
    background: var(--blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.nav-link:hover, .nav-link:focus { color: var(--blue); }
.nav-link:hover::after, .nav-link:focus::after { transform: scaleX(1); }
.nav-link.active { color: var(--blue); }
.nav-link.active::after { transform: scaleX(1); }

/* Bouton hamburger (masqué au-dessus de la tablette) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--ink);
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================================
   SECTIONS GÉNÉRIQUES
   ============================================================= */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-title { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.section-lead { color: var(--ink-soft); font-size: 1.05rem; margin: 0; }
.empty-note { text-align: center; color: var(--ink-soft); }

/* Fonds alternés selon le cahier des charges */
.section-hero     { background: var(--grey); }
.section-services { background: var(--white); }
.section-products { background: var(--grey); }
.section-about    { background: var(--white); }
.section-contact  { background: var(--white); }

/* ---------- Accueil ---------- */
.section-hero { padding: 90px 0; }
.hero-inner { text-align: center; max-width: 820px; margin: 0 auto; }
.hero-title {
    font-size: clamp(2rem, 7vw, 3.4rem);
    letter-spacing: 1px;
    color: var(--ink);
}
.hero-subtitle {
    font-size: clamp(1.05rem, 3vw, 1.5rem);
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 1em;
}
.hero-intro {
    font-size: 1.08rem;
    color: var(--ink-soft);
    max-width: 680px;
    margin: 0 auto 2em;
}

/* =============================================================
   CARROUSELS EN BOUCLE INFINIE (marquee)
   ============================================================= */
.marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    padding: 12px 0;
}
.marquee-track {
    display: flex;
    width: max-content;
    gap: 22px;
    padding: 8px 11px;
    animation: marquee-scroll 40s linear infinite;
    will-change: transform;
}
.marquee-reverse .marquee-track { animation-direction: reverse; }
.marquee-sm .marquee-track { animation-duration: 32s; }

/* Pause au survol / au focus clavier */
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }   /* la piste est dupliquée : -50% = boucle continue */
}

/* Respect de la préférence "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; }
    .marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }
}

/* ---------- Cartes ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-title { font-size: 1.15rem; margin-bottom: .5rem; }
.card-text { color: var(--ink-soft); font-size: .96rem; margin: 0; }

.service-card {
    flex: 0 0 auto;
    width: 320px;
    max-width: 80vw;
    padding: 26px 24px;
    border-top: 4px solid var(--blue);
}
.product-card {
    flex: 0 0 auto;
    width: 280px;
    max-width: 78vw;
    padding: 16px;
    text-align: center;
}
.product-media {
    background: var(--grey);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-card .card-title { font-size: 1.02rem; margin: 0; }

/* ---------- À propos : logos & certifications ---------- */
.about-row { margin-bottom: 30px; }
.about-row:last-child { margin-bottom: 0; }
.about-row-title {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 16px;
    color: var(--ink);
}
.logo-card {
    flex: 0 0 auto;
    width: 190px;
    height: 120px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
}
.logo-card img { max-height: 52px; width: auto; object-fit: contain; }
.logo-caption { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }

.cert-card {
    flex: 0 0 auto;
    width: 300px;
    background: var(--grey);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cert-check {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
}
.cert-name { font-weight: 600; font-size: .95rem; color: var(--ink); }

/* =============================================================
   CONTACT
   ============================================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
}
.contact-details li { margin-bottom: 16px; color: var(--ink-soft); }
.contact-details strong { color: var(--ink); }

.contact-form {
    background: var(--grey);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}
.form-row { margin-bottom: 16px; }
.form-row label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 6px;
    color: var(--ink);
}
.req { color: var(--blue); }
.form-row input,
.form-row textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    color: var(--ink);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(68, 132, 202, 0.18);
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form-row input.invalid,
.form-row textarea.invalid { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
.field-error { color: #c0392b; font-size: .82rem; margin-top: 4px; display: block; }

/* Honeypot : hors écran, non focusable visuellement */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}
.form-submit { width: 100%; margin-top: 6px; }
.form-feedback {
    margin: 14px 0 0;
    padding: 0;
    font-weight: 600;
    text-align: center;
    min-height: 1.2em;
}
.form-feedback.success { color: #1e7a46; }
.form-feedback.error   { color: #c0392b; }

/* =============================================================
   PIED DE PAGE
   ============================================================= */
.site-footer { background: var(--white); border-top: 1px solid var(--border); }
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 36px 20px;
}
.footer-logo { height: 42px; width: auto; margin-bottom: 8px; }
.footer-tagline { color: var(--ink-soft); font-size: .9rem; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a { color: var(--ink); font-weight: 600; }
.footer-nav a:hover, .footer-nav a:focus { color: var(--blue); }
.footer-legal { display: flex; gap: 10px; align-items: center; font-size: .9rem; color: var(--ink-soft); }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom p { text-align: center; color: var(--ink-soft); font-size: .88rem; padding: 16px 0; margin: 0; }

/* =============================================================
   POINTS DE RUPTURE
   ============================================================= */

/* Tablette & inférieur : navigation hamburger */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        position: fixed;
        top: var(--header-h);
        right: 0;
        width: min(280px, 82vw);
        height: calc(100vh - var(--header-h));
        background: var(--white);
        border-left: 1px solid var(--border);
        box-shadow: -8px 0 24px rgba(28,39,51,.10);
        transform: translateX(100%);
        transition: transform var(--transition);
        overflow-y: auto;
        padding: 16px;
    }
    .primary-nav.open { transform: translateX(0); }
    .primary-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
    .nav-link { padding: 14px 16px; border-radius: 8px; }
    .nav-link::after { display: none; }
    .nav-link:hover, .nav-link.active { background: var(--grey); }
}

/* Desktop : contact sur deux colonnes */
@media (min-width: 768px) {
    .contact-grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
    .section { padding: 84px 0; }
}

@media (min-width: 1024px) {
    .contact-grid { gap: 56px; }
}

/* Très petits écrans */
@media (max-width: 400px) {
    .container { padding: 0 16px; }
    .service-card { width: 260px; }
    .product-card { width: 230px; }
    .cert-card { width: 250px; }
    .btn { padding: 12px 22px; }
}
