/*
 * Mon espace social — feuille de style des pages Doeo (accueil, mentions légales).
 *
 * Source : charte « Mon espace social » (design system).
 * Les couleurs, polices, espacements et arrondis sont des variables définies dans
 * mes-tokens.css (à charger avant ce fichier) : pour modifier l'apparence, commencer par là.
 *
 * Sommaire
 *   1. Base
 *   2. Composants : bouton, badge, carte, champ
 *   3. Mise en page : en-tête, sections, bandeau sécurité, étapes, pied de page
 *   4. Page de contenu (mentions légales)
 */

/* ---------- 1. Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font: 400 16px/1.5 var(--font-text);
}

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

a {
    color: var(--blue);
    text-underline-offset: 3px;
}
a:hover {
    color: var(--blue-strong);
}

:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--ink);
}

p {
    margin: 0;
}

.mes-container {
    width: 100%;
    max-width: calc(var(--content-width) + 2 * var(--gutter));
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.mes-skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 10;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--blue);
    color: var(--on-blue);
    font-weight: 600;
}
.mes-skip-link:focus {
    top: var(--space-4);
    color: var(--on-blue);
}

/* ---------- 2. Composants ---------- */

/* Bouton : une seule action principale (--primary) par écran */
.mes-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    font: 600 16px/20px var(--font-text);
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.15s,
        border-color 0.15s;
}
.mes-btn--primary {
    background: var(--blue);
    color: var(--on-blue);
}
.mes-btn--primary:hover {
    background: var(--blue-strong);
    color: var(--on-blue);
}
.mes-btn--secondary {
    background: var(--surface-raised);
    color: var(--blue);
    border-color: var(--line-strong);
}
.mes-btn--secondary:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}
.mes-btn--small {
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    font-size: 15px;
}

/* Badge */
.mes-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font: 700 14px/18px var(--font-text);
}
.mes-badge--security {
    background: var(--sage-soft);
    color: var(--sage);
}
.mes-badge--info {
    background: var(--blue-soft);
    color: var(--blue);
}

/* Carte */
.mes-card {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-6);
}
.mes-card h3 {
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
}
.mes-card p {
    color: var(--ink-muted);
}

/* Champ de formulaire */
.mes-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.mes-field label {
    font: 600 15px/20px var(--font-text);
}
.mes-field .mes-hint {
    font-size: 14px;
    line-height: 20px;
    color: var(--ink-muted);
}
.mes-field input {
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--ink);
    font: 400 16px/24px var(--font-text);
}
.mes-field input:focus-visible {
    border-color: var(--blue);
}

/* ---------- 3. Mise en page ---------- */

/* En-tête */
.mes-header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--line);
}
.mes-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
    padding-block: var(--space-4);
}
.mes-logo img {
    height: 40px;
    width: auto;
}
/* Nom du service, à droite de l'en-tête (« Visio » + icône caméra) */
.mes-product {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--blue);
    font: 700 20px/28px var(--font-display);
}
.mes-product__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--blue-soft);
}

/* Section générique */
.mes-section {
    padding-block: var(--space-20);
}
.mes-section--tight {
    padding-top: 0;
}
.mes-section__title {
    font-size: 34px;
    line-height: 42px;
    font-weight: 800;
    letter-spacing: -0.015em;
    margin-bottom: var(--space-8);
}
.mes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
}
.mes-grid .mes-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Accroche (haut de la page d'accueil) */
.mes-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-12);
    padding-block: var(--space-16) var(--space-20);
}
.mes-hero__text {
    flex: 1 1 460px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
}
.mes-hero h1 {
    font-size: 52px;
    line-height: 60px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.mes-hero__intro {
    font-size: 19px;
    line-height: 30px;
    color: var(--ink-muted);
    max-width: 34em;
}
.mes-hero__visual {
    flex: 1 1 420px;
    min-width: 0;
}
/* Illustration d'un entretien en visio : custom/images/mes-video-call.svg */
.mes-hero__visual img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
}

.mes-muted {
    color: var(--ink-muted);
}

/* Bandeau sécurité (fond sombre) */
.mes-security {
    background: var(--night);
    color: #ffffff;
}
.mes-security h2,
.mes-security h3 {
    color: #ffffff;
}
.mes-security__intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 760px;
    margin-bottom: var(--space-12);
}
.mes-security__intro .mes-section__title {
    margin-bottom: 0;
}
.mes-security__intro p {
    font-size: 18px;
    line-height: 28px;
    color: var(--night-text);
}
.mes-security .mes-grid > div {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-top: var(--space-4);
    border-top: 2px solid var(--night-line);
}
.mes-security h3 {
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
}
.mes-security p {
    color: var(--night-text);
}
.mes-security a {
    color: #ffffff;
    font-weight: 600;
}

/* Étapes numérotées */
.mes-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-8);
    counter-reset: step;
}
.mes-steps li {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    counter-increment: step;
}
.mes-steps li::before {
    content: counter(step);
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mes-steps h3 {
    font-size: 19px;
    line-height: 26px;
    font-weight: 700;
    margin-bottom: var(--space-1);
}
.mes-steps p {
    color: var(--ink-muted);
}

/* Encart d'aide */
.mes-callout {
    margin-top: var(--space-12);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.mes-callout p:first-child {
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    color: var(--ink);
}

/* Pied de page */
.mes-footer {
    background: var(--night-deep);
    color: var(--night-text);
}
.mes-footer__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
    padding-block: var(--space-8);
}
.mes-footer .mes-logo img {
    height: 36px;
}
.mes-footer nav {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
}
.mes-footer a {
    color: #ffffff;
    font-size: 15px;
}
.mes-footer a:hover {
    color: var(--night-text);
}

/* ---------- 4. Page de contenu (mentions légales) ---------- */
.mes-content {
    max-width: 760px;
    padding-block: var(--space-12) var(--space-20);
}
.mes-content h1 {
    font-size: 40px;
    line-height: 48px;
    font-weight: 800;
    letter-spacing: -0.015em;
    margin-bottom: var(--space-2);
}
.mes-content__updated {
    color: var(--ink-muted);
    margin-bottom: var(--space-8);
}
.mes-content h2 {
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    margin-top: var(--space-12);
    margin-bottom: var(--space-3);
    scroll-margin-top: var(--space-6);
}
.mes-content h3 {
    font-size: 19px;
    line-height: 26px;
    font-weight: 600;
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
}
.mes-content p,
.mes-content ul {
    margin-bottom: var(--space-3);
}
.mes-content ul {
    padding-left: var(--space-6);
}
.mes-content li + li {
    margin-top: var(--space-1);
}
.mes-content address {
    font-style: normal;
}
.mes-content nav ul {
    padding: var(--space-4) var(--space-6) var(--space-4) var(--space-8);
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

/* Texte lu par les lecteurs d'écran, invisible à l'écran (ex. « nouvel onglet ») */
.mes-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Informations à compléter avant mise en production : rechercher « À COMPLÉTER » */
.mes-todo {
    background: var(--coral-soft);
    color: var(--coral-ink);
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* ---------- Petits écrans ---------- */
@media (max-width: 640px) {
    .mes-hero {
        padding-block: var(--space-8) var(--space-12);
        gap: var(--space-8);
    }
    .mes-hero h1 {
        font-size: 36px;
        line-height: 44px;
    }
    .mes-hero__visual {
        display: none; /* illustration décorative : inutile sur petit écran */
    }
    .mes-section {
        padding-block: var(--space-12);
    }
    .mes-section__title {
        font-size: 28px;
        line-height: 36px;
    }
    /* Logo et « Visio » sur une seule ligne */
    .mes-header__bar {
        flex-wrap: nowrap;
        gap: var(--space-4);
    }
    .mes-logo img {
        height: 32px;
    }
    .mes-product {
        font-size: 18px;
    }
    .mes-product__icon {
        width: 32px;
        height: 32px;
    }
    .mes-content h1 {
        font-size: 32px;
        line-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
