:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Style pour les sections de services - "Style Éclatant" */
.service-section {
    position: relative;
    top: auto;
    left: auto;
    width: 80%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap:nowrap; 
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(3px);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    gap: 5px; /* ou 5px, selon votre besoin */
    flex-shrink: 1; /* Permet aux éléments de rapetisser */
    margin: 1.2rem auto 0;
}

.service-card {
    background-color: #ffffff;
    border: 1px solid #007bff;
    border-radius: 15px;
    padding: 0 8px 14px;
    width: 30%; /* 25% de largeur */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex-shrink: 1; /* Permet aux éléments de rapetisser */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.service-card-reseau {
    background: linear-gradient(180deg, #ff4fa7 0%, #ff9fd0 100%);
    border-color: #ff4fa7;
}

.service-card-outils {
    background: linear-gradient(180deg, #0b2f6f 0%, #3f8fdf 100%);
    border-color: #1f5ea8;
}

.service-card-blog {
    background: linear-gradient(180deg, #2c3136 0%, #4a5057 45%, #d6d9df 100%);
    border-color: #4a5057;
}

.service-card-vie {
    background: linear-gradient(180deg, #009dff 0%, #8ae4ff 100%);
    border-color: #2aaee9;
}

.service-card-ressources {
    background: linear-gradient(180deg, #153b75 0%, #1f5ea8 100%);
    border-color: #1f5ea8;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.service-card h3 {
    font-size: 1.5em;
    margin: 2px 0 2px;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
    order: 1;
}

.service-card > p:not(.service-latest-line) {
    font-size: 1em;
    color: #34495e;
    margin: 0 0 2px;
    order: 2;
}

.service-media-preview {
    margin-top: 8px;
    padding: 2px;
    border: 1px solid #dbe8f5;
    border-radius: 10px;
    background: #f7fbff;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    min-height: 0;
    order: 4;
}

.service-media-preview img {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    object-position: top center;
    background: #ffffff;
    margin: 0;
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    border-radius: 8px;
    border: 1px solid #dbe8f5;
    display: none;
}

.service-media-preview span {
    order: -1;
    display: block;
    width: 100%;
    margin: 0;
    text-align: left;
    line-height: 1.2;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 600;
}

#reseauPreviewTitle {
    text-align: center;
}

#outilsPreviewTitle {
    text-align: center;
}

.service-latest-line {
    margin-top: 12px;
    margin-bottom: 0;
    font-size: 0.92rem;
    color: #2c3e50;
    font-weight: 700;
    font-style: normal;
    order: 4;
}

.service-card .icon {
    font-size: 48px;
    color: #007bff;
    margin: 6px auto 8px;
    transition: transform 0.3s ease;
    order: 3;
}

.service-card:hover .icon {
    transform: scale(1.2);
}

.service-card-vie {
    min-height: 240px;
}

.service-card-vie-main-link {
    order: 1;
    display: block;
    color: inherit;
    text-decoration: none;
}

.service-card.service-card-vie .service-card-vie-main-link,
.service-card.service-card-vie .service-card-vie-main-link:hover {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.service-card-vie-main-link p {
    font-size: 1em;
    color: #34495e;
    margin: 0 0 2px;
}

.service-card-ressources {
    min-height: 520px;
    padding: 0 6px 14px;
}

.service-card-ressources-main-link {
    order: 1;
    display: block;
    color: inherit;
    text-decoration: none;
}

.service-card.service-card-ressources .service-card-ressources-main-link,
.service-card.service-card-ressources .service-card-ressources-main-link:hover {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.service-card-ressources-main-link p {
    font-size: 1em;
    color: #34495e;
    margin: 0 0 2px;
}

.service-card-reseau h3,
.service-card-reseau > p:not(.service-latest-line),
.service-card-reseau .icon,
.service-card-reseau .service-latest-line {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(136, 24, 87, 0.35);
}

.service-card-outils h3,
.service-card-outils > p:not(.service-latest-line),
.service-card-outils .icon,
.service-card-outils .service-latest-line {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(8, 33, 82, 0.5);
}

.service-card-blog h3,
.service-card-blog > p:not(.service-latest-line),
.service-card-blog .icon,
.service-card-blog .service-latest-line {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(22, 26, 31, 0.55);
}

.service-card-vie h3,
.service-card-vie > p:not(.service-latest-line),
.service-card-vie .service-card-vie-main-link p,
.service-card-vie .icon,
.service-card-vie .service-latest-line {
    color: #0d3a78;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.35);
}

.service-card-ressources h3,
.service-card-ressources > p:not(.service-latest-line),
.service-card-ressources .service-card-ressources-main-link p,
.service-card-ressources .icon,
.service-card-ressources .service-latest-line {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(10, 27, 53, 0.45);
}

.resources-home-carousel {
    order: 4;
    margin-top: 8px;
    width: 100%;
    border: 1px solid #dbe8f5;
    border-radius: 10px;
    background: #f7fbff;
    padding: 8px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
}

.resources-home-window {
    overflow: hidden;
    width: 100%;
}

.resources-home-track {
    display: flex;
    gap: 10px;
    will-change: transform;
    transform: translateX(0);
}

.resource-home-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 calc((100% - (var(--resource-visible, 3) - 1) * 10px) / var(--resource-visible, 3));
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.service-card.service-card-ressources .resource-home-item,
.service-card.service-card-ressources .resource-home-item:hover {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.resource-home-item img {
    width: 100%;
    height: 376px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #dbe8f5;
    border-radius: 8px;
}

.resource-home-item img.is-loading,
.service-media-preview img.is-loading {
    background: linear-gradient(90deg, #e9f1fb 20%, #f7fbff 50%, #e9f1fb 80%);
    background-size: 200% 100%;
    animation: mediaLoadingShimmer 1.1s linear infinite;
    filter: saturate(0.65) contrast(0.9);
}

.resource-home-item span {
    display: block;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.2;
    color: #2c3e50;
    font-weight: 700;
}

.resource-home-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #b7d6f5;
    background: rgba(255, 255, 255, 0.95);
    color: #1f5ea8;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(31, 94, 168, 0.18);
}

.resource-home-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.resource-home-empty {
    margin: 0;
    text-align: center;
    color: #4b5d73;
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

@keyframes mediaLoadingShimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

.ime-profile-carousel {
    order: 4;
    width: 100%;
    margin-top: 6px;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ime-profile-window {
    flex: 1;
    overflow: hidden;
}

.ime-profile-track {
    display: flex;
    align-items: center;
    gap: 14px;
    width: max-content;
    transition: transform 0.25s ease;
}

.ime-profile-avatar {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: linear-gradient(135deg, #d7e9fb, #b8d8f7);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.25);
    text-decoration: none;
}

.ime-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 50%;
}

.ime-profile-avatar.is-empty {
    position: relative;
}

.ime-profile-avatar.is-empty::after {
    content: "";
    position: absolute;
    inset: 30px;
    border: 2px dashed rgba(31, 94, 168, 0.45);
    border-radius: 50%;
}

.ime-profile-avatar.has-initials::before {
    content: attr(data-initials);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f5ea8;
    font-weight: 700;
    font-size: 1.9rem;
    letter-spacing: 0.02em;
}

.ime-profile-avatar.has-initials::after {
    display: none;
}

.ime-carousel-arrow {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #b7d6f5;
    color: #1f5ea8;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 6px rgba(31, 94, 168, 0.18);
}

.ime-carousel-arrow.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.service-card a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

.service-card a:hover {
    text-decoration: underline;
}
/* Alignement de la navigation avec 3 éléments */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.8rem;
    border-radius: 50px;
    margin: 0 auto;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 1.2rem; /* Augmentation légère de la marge */
    padding: 0.5rem 1.2rem; /* Padding légèrement augmenté */
    border-radius: 25px;
    transition: var(--transition);
    font-weight: 600;
    flex: 1; /* Permet un étirement équitable */
    text-align: center; /* Centre le texte */
    min-width: 80px; /* Largeur minimale pour éviter le chevauchement */
}


/* Amélioration du centrage du texte dans la navigation */
nav a {
    color: white;
    text-decoration: none;
    margin: 0 1.2rem;
    padding: 0.6rem 1.4rem; /* Ajustement du padding pour mieux centrer */
    border-radius: 25px;
    transition: var(--transition);
    font-weight: 600;
    flex: 1;
    text-align: center;
    min-width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* Ajustement spécifique pour l'élément "Ressources" */
nav a[href="ressources.html"] {
    letter-spacing: 0.02em; /* Léger ajustement de l'espacement des lettres */
}
nav {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.8vw;
    border-radius: 50px;
    margin: 0 auto;
    max-width: 400px;
    backdrop-filter: blur(10px);
    width: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: #f9f9f1;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

/* Pour empêcher le header de se superposer */
header {
    position: relative;
    top: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
        width: 100%;
    max-width: 100%;
    height: 150px;
    background: transparent;
    border-bottom: none;
    z-index: 30;
    color: white;
    padding: 2vw;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.26) 0%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.14) 76%,
        rgba(255, 255, 255, 0.04) 100%
    );
    backdrop-filter: blur(14px) saturate(1.05);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0.96) 62%,
        rgba(0, 0, 0, 0.82) 72%,
        rgba(0, 0, 0, 0.62) 80%,
        rgba(0, 0, 0, 0.38) 87%,
        rgba(0, 0, 0, 0.18) 92%,
        rgba(0, 0, 0, 0.07) 95%,
        rgba(0, 0, 0, 0.02) 97%,
        rgba(0, 0, 0, 0) 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0.96) 62%,
        rgba(0, 0, 0, 0.82) 72%,
        rgba(0, 0, 0, 0.62) 80%,
        rgba(0, 0, 0, 0.38) 87%,
        rgba(0, 0, 0, 0.18) 92%,
        rgba(0, 0, 0, 0.07) 95%,
        rgba(0, 0, 0, 0.02) 97%,
        rgba(0, 0, 0, 0) 100%
    );
}

header > * {
    position: relative;
    z-index: 1;
}

.header-h1 h1 {
    color: #1f5ea8;
}

/* Header et connexion */
.header-top {
    display: flex;
    position: relative;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1vw;
        width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 3vw;
}



.login-btn {
    background: rgba(255, 255, 255, 0.3);
    color: #007bff;
    border: 2px solid white;
    padding: 0.42rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.82rem;
    min-width: 136px;
    margin-top: 1rem;
}

.login-btn:hover {
    background: white;
    color: var(--primary);
}
.logout-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid white;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-top: 1rem;
}

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

.profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.8rem;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    border: 2px solid white;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font: inherit;
    text-align: center;
    line-height: 1;
}

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

#connectedState {
    text-align: center;
}

#connectedState .logout-btn,
#connectedState .profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0.35rem 0;
}

#connectedState .profile-btn,
#connectedState .messages-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    text-align: center !important;
    line-height: 1 !important;
}

#connectedState .messages-link {
    position: relative;
    gap: 0 !important;
}

#connectedState .messages-link .messages-label {
    display: block;
    width: 100%;
    text-align: center;
    line-height: 1;
}

#connectedState .messages-link .messages-badge {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

.install-app-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid white;
    padding: 0.5rem 1.4rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    margin: 0.8rem auto 0.4rem;
}

.install-app-btn:hover {
    background: white;
    color: var(--primary);
}

/* Conteneur d'image avec superposition */
.image-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.image-container > .hero-background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}


/* Conteneur pour les sections superposées - tout les cadres placés en haut de l'image */
.home-top-layout {
    position: relative;
    top: auto;
    left: auto;
    width: 80%;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
    z-index: 10;
    margin: 6rem auto 0;
}

.home-agenda {
    width: calc(50% - 10px);
    border-radius: 14px;
    padding: 14px;
    background-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(7px);
    border: 1px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
    color: #0d3a78;
    align-self: flex-start;
    margin-top: 0;
}

.home-agenda h3 {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.2;
}

.home-agenda-today {
    margin: 3px 0 6px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #1f5ea8;
}

.home-agenda-month-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
    margin: 2px 0 10px;
}

.home-agenda-month-btn {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #a9c9ef;
    background: rgba(255, 255, 255, 0.88);
    color: #1f5ea8;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.home-agenda-month-btn:hover {
    background: #1f5ea8;
    color: #ffffff;
    border-color: #1f5ea8;
}

.home-agenda-month {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0d3a78;
    text-align: center;
}

.home-agenda-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 5px;
}

.home-agenda-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0d3a78;
}

.home-agenda-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.agenda-day {
    min-height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0d3a78;
    border: 1px solid #8fd3ff;
    background: rgba(143, 211, 255, 0.16);
    text-decoration: none;
}

.agenda-day.is-empty {
    opacity: 0.24;
}

.agenda-day.has-event {
    background: #1f5ea8;
    border-color: #174a85;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(31, 94, 168, 0.42);
    cursor: pointer;
}

.agenda-day.has-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(31, 94, 168, 0.5);
}

.overlay-sections {
    position: static;
    width: calc(50% - 10px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 12px;
    padding: 0;
}

/* Style des sections superposées */
.overlay-card {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 12px 14px;
    width: 100%;
    max-width: none;
    min-height: 92px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.overlay-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background-color: rgba(255, 255, 255, 0.8);
}

.overlay-card h2 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.26rem;
}

.overlay-card p {
    font-size: 0.95rem;
    line-height: 1.35;
    color: #444;
}

/* Section de services */
.services {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin: 3rem auto;
    padding: 0 2rem;
    max-width: 1200px;
}


.service-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 2.2rem;
    padding: 1.2rem;
    text-align: center;
}

.service-content {
    padding: 1.5rem;
}

.service-content h3 {
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.home-footer {
    position: relative;
    z-index: 40;
    margin-top: 0;
    padding: 0.7rem 1rem;
    text-align: center;
    color: #ffffff;
    background: linear-gradient(135deg, #1f5ea8, #2f7ed1);
    border-top: none;
}

.home-footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}


/* Modal de connexion */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--accent);
}

/* Formulaire */
#loginForm input {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

#loginForm button {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Sections verrouillées */
.locked-section {
    opacity: 0.6;
    position: relative;
}

.locked-section::after {
    content: "🔒";
    margin-left: 5px;
}

/* Quand connecté */
.connected .locked-section {
    opacity: 1;
}

.connected .locked-section::after {
    content: "✓";
    color: var(--secondary);
}

.welcome-msg {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.welcome-msg button {
    background: transparent;
    color: white;
    border: 1px solid white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    margin-left: 1rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.welcome-msg button:hover {
    background: white;
    color: var(--primary);
}

/* Adaptation mobile */

@media (min-width: 769px) {
    .service-section {
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        gap: 10px;
    }

    .service-section .service-card {
        margin: 0;
        width: calc(50% - 5px);
        max-width: calc(50% - 5px);
    }

    .service-section .service-card-vie {
        order: -2;
        width: 100%;
        max-width: 100%;
        min-height: 170px;
        padding: 2px 10px 10px;
    }

    .service-section .service-card-blog {
        order: -1;
        width: 100%;
        max-width: 100%;
        min-height: 120px;
        padding: 2px 10px 10px;
    }

    .service-section .service-card-blog .icon {
        display: none;
    }

    .service-section .service-card-blog h3 {
        margin: 2px 0 2px;
    }

    .service-section .service-card-blog .service-latest-line {
        margin-top: 2px;
        text-align: center;
    }

    .service-section .service-card-ressources {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    header {
        padding-left: 1.2vw;
        padding-right: 1.2vw;
    }

    .home-top-layout {
        position: static;
        width: auto;
        left: auto;
        top: auto;
        display: block;
        margin: 0.9rem auto 0;
    }

    .home-agenda {
        display: none;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .image-container > .hero-background {
        content: url("images/Fond page d'acceuil - 2.png");
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center top;
    }

        .welcome-msg {
        font-size: 0.8rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .welcome-msg button {
        margin-left: 0;
    }
    
    .header-top {
        flex-direction: column;
        gap: 0.55rem;
          max-width: 100%;
          font-size: 3vw;
        transform: translateX(-6px);
    }

    #loginPrompt h2 {
        font-size: 1.35rem;
        line-height: 1.15;
        margin: 0;
    }

    #loginPrompt p {
        font-size: 0.9rem;
        margin: 0;
    }

    .login-btn {
        font-size: 0.86rem;
        padding: 0.46rem 1.1rem;
        min-width: 140px;
    }

    #connectedState .logout-btn,
    #connectedState .profile-btn,
    #connectedState .messages-link {
        display: block;
        margin: 0.24rem auto 0;
        width: 170px;
        padding: 0.06rem 1.2rem;
        min-height: 24px;
        font-size: 0.78rem;
        line-height: 1;
        background: #ffffff;
        color: var(--primary);
        box-sizing: border-box;
    }

    #connectedState {
        transform: translateX(24px);
    }

    #connectedState > p {
        text-align: left;
        padding-left: 4px;
    }

    #connectedState .profile-btn,
    #connectedState .messages-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 20px;
        padding: 0.01rem 1rem;
        font-size: 0.7rem;
        text-align: center;
        line-height: 1 !important;
    }

    #connectedState .messages-link {
        position: relative;
        gap: 0 !important;
    }

    #connectedState .messages-link .messages-label {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        width: 100%;
        text-align: center;
        line-height: 1;
    }

    #connectedState .messages-link .messages-badge {
        position: absolute;
        right: 0.35rem;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }
    .header-h1 {
        flex-direction: column;
            display: flex;
        align-items: center;
          max-width: 100%;
          gap: 0.35rem;
        transform: translateX(6px);
    }

    .header-h1 a {
    display: flex;

          max-width: 100%;
    }
    .header-h1 h1 {
        font-size: 1.5rem;
        margin: 0;
    }
    .header-h1 p {
        font-size: 0.95rem;
        margin: 0;
    }

    .header-h1 nav {
        width: 80%;
        max-width: 300px;
        padding: 0.3rem;
        order: 2;
    }

    .header-h1 nav a {
        margin: 0 0.2rem;
        padding: 0.26rem 0.62rem;
        min-width: 0;
        font-size: 0.8rem;
        line-height: 1;
    }

    .header-h1 > .a11y-toggle-btn {
        width: 80%;
        max-width: 300px;
        order: 3;
    }

    #resetPasswordAdminBtn {
        width: 80%;
        max-width: 300px;
        margin: 0.12rem auto 0;
        padding: 0.22rem 0.8rem;
        min-height: 30px;
        border-radius: 25px;
        border: 2px solid #ffffff;
        background: rgba(255, 255, 255, 0.86);
        color: var(--primary);
        font-size: 0.8rem;
        font-weight: 700;
        line-height: 1;
        text-align: center;
        text-decoration: none;
        order: 4;
        box-sizing: border-box;
    }

    #resetPasswordAdminBtn:hover {
        background: #ffffff;
    }
    .overlay-sections {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 0;
    }

    .overlay-card {
        width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        height: 6.9vh;
        min-height: 48px;
        padding: 4px 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
    }
    .service-section {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        padding: 0;
        margin-top: 14px;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        border-radius: 0;
    }

    .service-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 6px 12px;
    }

    .service-card.service-card-ressources {
        min-height: 0;
        height: auto;
        padding-bottom: 8px;
    }

    .service-section .service-card-vie {
        order: -2;
    }

    .service-section .service-card-blog {
        order: -1;
    }

    .ime-profile-avatar {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }

    .ime-profile-avatar.is-empty::after {
        inset: 24px;
    }

    .service-media-preview {
        width: 100%;
        padding: 2px;
        gap: 6px;
        align-items: stretch;
        min-height: 0;
    }

    .service-media-preview img {
        width: 100%;
        max-width: 100%;
    }

    .resource-home-item img {
        height: 240px;
    }
    .overlay-card h2 {
        margin: 0 0 3px;
        font-size: 1rem;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .overlay-card p {
        margin: 0;
        font-size: 0.72rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}
@media (max-width: 600px) {
    .home-top-layout {
        margin: 0.75rem auto 0;
    }

   .header-top {
        flex-direction: column;
        gap: 1rem;
          max-width: 100%;
          font-size: 3vw
    }

    #loginPrompt h2 {
        font-size: 1.3rem;
        line-height: 1.15;
    }

    #loginPrompt p {
        font-size: 0.88rem;
    }
           .header-h1 {
        flex-direction: column;
            display: flex;
    gap: 10px; /* Réduit l’espace entre les éléments */
    margin: 0;
    padding: 0;
        
          max-width: 100%;
          gap: 0.25rem;
    }
    .header-h1 a {
    display: flex;
    margin: 0;
    padding: 0;
          max-width: 100%;
    }
    .header-h1 h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    .header-h1 p {
        font-size: 0.9rem;
        margin: 0;
    }
    .login-btn {
        font-size: 0.84rem;
        padding: 0.44rem 1.05rem;
        min-width: 132px;
    }

    .overlay-sections {
        top: auto;
        width: 100%;
    }

    .overlay-card {
        width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        height: 6.9vh;
        min-height: 48px;
    }

    .resource-home-item img {
        height: 210px;
    }
}
@media (max-width: 480px) {
    .home-top-layout {
        margin: 0.65rem auto 0;
    }

    nav a {
        margin: 0 0.5rem;
        padding: 0.26rem 0.64rem;
        font-size: 0.8rem;
        width: auto;
        flex-shrink: 1; /* Permet aux éléments de rapetisser */
    }
    .overlay-sections {
        top: auto;
        width: 100%;
    }

    .overlay-card {
        width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        height: 6.9vh;
        min-height: 48px;
        padding: 8px 10px;
    }
       .header-top {
        flex-direction: column;
        gap: 1rem;
          max-width: 100%;
          font-size: 3vw
    }

    #loginPrompt h2 {
        font-size: 1.2rem;
        line-height: 1.15;
    }

    #loginPrompt p {
        font-size: 0.84rem;
    }
    .overlay-card h2 {
        font-size: 0.95rem;
    }
    
    .overlay-card p {
        font-size: 0.68rem;
    }
}

/* ===== Ajustement Header Accueil (PC) ===== */
.home-nav-block {
    display: none;
}

.home-logo-pc {
    display: none;
}

@media (min-width: 769px) {
    .login-btn {
        height: 34px;
        min-height: 34px;
        padding: 0 1.2rem;
        line-height: 1.1;
    }

    header {
        display: grid;
        grid-template-columns: minmax(320px, 420px) 1fr minmax(200px, 320px);
        align-items: start;
        column-gap: 1.6rem;
        height: auto;
        min-height: 220px;
        padding: 1.2rem 2rem 0.7rem;
    }

    .header-top {
        grid-column: 1;
        width: 100%;
        max-width: 420px;
        margin-bottom: 0;
        align-self: start;
    }

    .login-prompt {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    #connectedState {
        text-align: left;
        width: 100%;
    }

    #connectedState > p {
        display: block;
        margin: 0 0 0.22rem;
        white-space: nowrap;
    }

    #connectedState .connected-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
        align-items: stretch;
    }

    #connectedState .connected-actions .logout-btn,
    #connectedState .connected-actions .profile-btn,
    #connectedState .connected-actions .messages-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0;
        width: 100%;
        white-space: nowrap;
        text-align: center;
        height: 34px;
        min-height: 34px;
        padding: 0 0.5rem;
        font-size: 0.8rem;
        line-height: 1 !important;
    }

    #connectedState .connected-actions .messages-link {
        position: relative;
        padding: 0 0.5rem;
        gap: 0 !important;
    }

    #connectedState #resetPasswordAdminBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 34px;
        min-height: 34px;
        padding: 0 0.5rem;
        margin-top: 0.35rem;
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .home-nav-block {
        display: block;
        margin-top: 0.85rem;
    }

    .home-nav-block nav {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0.58rem 0.6rem;
    }

    .home-nav-block nav a {
        margin: 0 0.25rem;
        height: 34px;
        min-height: 34px;
        padding: 0 0.75rem;
        min-width: 0;
        font-size: 0.92rem;
        line-height: 1.1;
    }

    .header-h1 {
        grid-column: 2;
        align-self: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.22rem;
        text-align: center;
    }

    .header-h1 h1 {
        margin: 0;
        font-size: clamp(2.8rem, 6vw, 4.8rem);
        line-height: 1;
        color: #1f5ea8;
        text-shadow: 0 3px 10px rgba(31, 94, 168, 0.28);
    }

    .header-h1 > nav {
        display: none;
    }

    .home-logo-pc {
        display: block;
        grid-column: 3;
        align-self: center;
        justify-self: end;
        width: 400px;
        max-width: none;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 4px 12px rgba(21, 59, 117, 0.2));
    }

    .home-top-layout {
        margin: 4.8rem auto 0;
    }

    .service-section {
        margin: 0.8rem auto 0;
    }
}
