/* ===== SELF-HOSTED FONTS ===== */

/* Abril Fatface */
@font-face {
    font-family: 'Abril Fatface';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/abril-fatface-latin.woff2') format('woff2');
}

/* Open Sans 400 */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../assets/fonts/opensans-400-latin.woff2') format('woff2');
}

/* Open Sans 600 */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../assets/fonts/opensans-600-latin.woff2') format('woff2');
}

/* Open Sans 700 */
@font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../assets/fonts/opensans-700-latin.woff2') format('woff2');
}

/* ===== DESIGN TOKENS (CSS Custom Properties) ===== */
:root {
    /* Typography */
    --font-display: 'Abril Fatface', serif;
    --font-ui: 'Open Sans', sans-serif;

    /* Backgrounds */
    --bg-body: #f6eedc;
    --bg-card: white;
    --bg-header: white;
    --bg-footer: white;
    --bg-card-alt: #f6eedc;
    --bg-input: #fafafa;

    /* Text */
    --text-primary: #222222;
    --text-secondary: #666666;
    --text-muted: #999999;

    /* Accent (unchanged in dark mode) */
    --accent: #DD9933;
    --accent-text: #DD9933;
    --accent-dark: #c4872d;
    --accent-gradient: linear-gradient(135deg, #DD9933 0%, #c4872d 100%);

    /* Borders & Dividers */
    --border-color: #e8e8e8;

    /* Shadows */
    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 20px 50px rgba(221, 153, 51, 0.15);
    --shadow-header: 0 2px 20px rgba(0, 0, 0, 0.06);
    --shadow-header-scroll: 0 4px 30px rgba(0, 0, 0, 0.1);

    /* Skeleton */
    --skeleton-bg: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    --skeleton-header-bg: rgba(255, 255, 255, 0.95);
}

html.dark-mode {
    --bg-body: #1a1a2e;
    --bg-card: #16213e;
    --bg-header: #16213e;
    --bg-footer: #16213e;
    --bg-card-alt: #0f3460;
    --bg-input: #1a1a2e;

    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;

    --accent-text: #DD9933;

    --border-color: #2a2a4a;

    --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 20px 50px rgba(221, 153, 51, 0.15);
    --shadow-header: 0 2px 20px rgba(0, 0, 0, 0.3);
    --shadow-header-scroll: 0 4px 30px rgba(0, 0, 0, 0.4);

    --skeleton-bg: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    --skeleton-header-bg: rgba(26, 26, 46, 0.95);
}

/* ===== GLOBAL RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: clip;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Skip navigation link (visually hidden until focused) */
.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    padding: 12px 20px;
    background: #DD9933;
    color: white;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    z-index: 10001;
    transition: top 0.15s ease;
}
.skip-link:focus {
    top: 0;
}

/* Consistent visible focus style for keyboard navigation */
:where(a, button, input, textarea, select, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 3px solid #DD9933;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(221, 153, 51, 0.15);
}

img {
    max-width: 100%;
    height: auto;
}

main {
    padding-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ===== HIGHLIGHT ===== */
.highlight {
    color: var(--accent-text);
}

/* ===== SHARED BUTTON ===== */
.btn-cta {
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #DD9933 0%, #c4872d 100%);
    color: white !important;
    box-shadow: 0 4px 20px rgba(221, 153, 51, 0.35);
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(221, 153, 51, 0.45);
    color: white !important;
}

.btn-cta svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}


/* ===== SCROLL REVEAL ANIMATIONS ===== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===== BACK TO TOP BUTTON ===== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #DD9933 0%, #c4872d 100%);
    box-shadow: 0 4px 20px rgba(221, 153, 51, 0.35);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(221, 153, 51, 0.5);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: white;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }
}



/* ===== SKELETON LOADING ===== */

@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton-line {
    background: var(--skeleton-bg);
    background-size: 400px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* Prevent CLS from dynamic header/footer loading */
#header-placeholder {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    height: 80px;
}

.skeleton-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: var(--skeleton-header-bg);
    backdrop-filter: blur(10px);
}

.skeleton-logo {
    width: 100px;
    height: 36px;
}

.skeleton-nav {
    display: flex;
    gap: 20px;
}

.skeleton-link {
    width: 70px;
    height: 16px;
}

.skeleton-footer {
    padding: 40px 20px;
    text-align: center;
}

.skeleton-footer-logo {
    width: 120px;
    height: 40px;
    margin: 0 auto 16px;
}

.skeleton-footer-line {
    height: 14px;
    margin: 0 auto;
}

.skeleton-footer-line-1 {
    width: 200px;
    margin-bottom: 10px;
}

.skeleton-footer-line-2 {
    width: 160px;
}

/* Fallback/UI utility classes to avoid JS-injected inline styles (CSP) */
.honeypot-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
}

.include-fallback {
    font-size: 14px;
}

.include-fallback-header {
    padding: 14px 18px;
    background: #f6eedc;
    border-bottom: 1px solid #e8dcc8;
    text-align: center;
    color: #2d2d2d;
}

.include-fallback-link {
    color: #DD9933;
    text-decoration: underline;
}

.include-fallback-footer {
    padding: 20px 16px;
    text-align: center;
    color: #666;
}

/* ==================== HEADER ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999 !important;
    background: var(--bg-header);
    box-shadow: var(--shadow-header);
    transition: all 0.3s ease;
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(90deg, #DD9933, #c4872d, #DD9933) 1;
}

.header.scrolled {
    box-shadow: var(--shadow-header-scroll);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    transition: height 0.3s ease, padding 0.3s ease;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.header-logo img {
    height: 60px;
    width: auto;
    transition: height 0.3s ease;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link,
.nav-link:visited,
.nav-link:link {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    padding: 12px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #DD9933;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-text) !important;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Bouton Contact */
.nav-btn {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: white !important;
    text-decoration: none !important;
    padding: 12px 28px;
    background: linear-gradient(135deg, #DD9933 0%, #c4872d 100%);
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(221, 153, 51, 0.3);
    margin-left: 15px;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221, 153, 51, 0.4);
    color: white !important;
}

/* Menu burger mobile */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    background: transparent;
    border: none;
}

/* Overlay is now a native button */
.nav-overlay {
    border: none;
    padding: 0;
}

.burger-line {
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
    background: #DD9933;
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
    background: #DD9933;
}

/* ==================== RESPONSIVE ==================== */

/* Desktop large (1100px - 1400px) */
@media (max-width: 1200px) {
    .header-container {
        padding: 0 30px;
    }

    .nav-link {
        padding: 10px 16px;
        font-size: 15px;
    }

    .nav-btn {
        padding: 10px 22px;
        font-size: 15px;
        margin-left: 10px;
    }
}

/* Tablette (601px - 1000px) - Menu burger */
@media (min-width: 601px) and (max-width: 1000px) {
    .burger-menu {
        display: flex;
        padding: 8px;
    }

    .burger-line {
        width: 24px;
        height: 2.5px;
    }

    .header-container {
        padding: 0 20px;
        height: 65px;
    }

    .header-logo img {
        height: 48px;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 60%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-header);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 22px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 35px 20px;
    }

    .header-nav.active {
        right: 0;
    }

    .nav-link {
        font-size: 17px;
        padding: 10px 22px;
        width: 90%;
        text-align: center;
    }

    .nav-link::after {
        bottom: 7px;
        left: 22px;
        right: 22px;
    }

    .nav-btn {
        margin-left: 0;
        margin-top: 12px;
        font-size: 15px;
        padding: 11px 28px;
        width: auto;
    }

    /* Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 999;
        backdrop-filter: blur(2px);
        animation: fadeIn 0.25s ease;
    }

    .nav-overlay.active {
        display: block;
    }
}

/* Tablette (601px - 768px) - Menu burger */
@media (min-width: 601px) and (max-width: 768px) {
    .burger-menu {
        display: flex;
        padding: 8px;
    }

    .burger-line {
        width: 24px;
        height: 2.5px;
    }

    .header-container {
        padding: 0 20px;
        height: 60px;
    }

    .header-logo img {
        height: 42px;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 65%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-header);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 30px 20px;
    }

    .header-nav.active {
        right: 0;
    }

    .nav-link {
        font-size: 17px;
        padding: 10px 20px;
        width: 90%;
        text-align: center;
    }

    .nav-link::after {
        bottom: 7px;
        left: 20px;
        right: 20px;
    }

    .nav-btn {
        margin-left: 0;
        margin-top: 12px;
        font-size: 15px;
        padding: 11px 28px;
        width: auto;
    }

    /* Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 999;
        backdrop-filter: blur(2px);
        animation: fadeIn 0.25s ease;
    }

    .nav-overlay.active {
        display: block;
    }
}

/* Mobile (max 600px) */
@media (max-width: 600px) {
    .burger-menu {
        display: flex;
        padding: 6px;
        gap: 5px;
    }

    .header-container {
        padding: 0 12px;
        height: 55px;
    }

    .header-logo img {
        height: 38px;
    }

    .burger-line {
        width: 22px;
        height: 2px;
    }

    .burger-menu.active .burger-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .burger-menu.active .burger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 260px;
        height: 100vh;
        background: var(--bg-header);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 18px;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 25px 15px;
    }

    .header-nav.active {
        right: 0;
    }

    .nav-link {
        font-size: 15px;
        padding: 9px 18px;
        width: 90%;
        text-align: center;
    }

    .nav-link::after {
        bottom: 5px;
        left: 18px;
        right: 18px;
    }

    .nav-btn {
        margin-left: 0;
        margin-top: 8px;
        font-size: 14px;
        padding: 10px 24px;
        width: auto;
    }

    /* Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
        animation: fadeIn 0.25s ease;
    }

    .nav-overlay.active {
        display: block;
    }
}

/* Très petit mobile (max 400px) */
@media (max-width: 400px) {
    .header-container {
        padding: 0 10px;
        height: 52px;
    }

    .header-logo img {
        height: 35px;
    }

    .burger-menu {
        padding: 5px;
    }

    .burger-line {
        width: 20px;
        height: 2px;
    }

    .header-nav {
        width: 80%;
        max-width: 240px;
        gap: 16px;
        padding: 20px 12px;
    }

    .nav-link {
        font-size: 14px;
        padding: 8px 15px;
    }

    .nav-btn {
        font-size: 13px;
        padding: 9px 20px;
    }
}

/* Animation pour l'overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==================== BOUTON DARK MODE ==================== */
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card-alt);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 10px;
    position: relative;
    z-index: 1002;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: #DD9933;
    background: #DD9933;
    transform: scale(1.1);
}

.theme-toggle:hover svg {
    fill: white;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
    display: none;
}

html.dark-mode .theme-toggle .moon-icon {
    display: none;
}

html.dark-mode .theme-toggle .sun-icon {
    display: block;
}

html.dark-mode .theme-toggle {
    background: #0f3460;
    border-color: #DD9933;
}

html.dark-mode .theme-toggle svg {
    fill: #DD9933;
}

html.dark-mode .theme-toggle:hover {
    background: #DD9933;
}

html.dark-mode .theme-toggle:hover svg {
    fill: white;
}

/* Responsive toggle */
@media (max-width: 1000px) {
    .theme-toggle {
        width: 38px;
        height: 38px;
        margin-left: 0;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 600px) {
    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-footer);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.04);
    border-top: 4px solid transparent;
    border-image: linear-gradient(90deg, #DD9933, #c4872d, #DD9933) 1;
    width: 100%;
    position: relative;
}

/* Partie principale */
.footer-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 40px 40px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 60px;
    align-items: start;
}

/* Colonne gauche - Réseaux */
.footer-social {
    justify-self: start;
}

.footer-title {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.footer-title .highlight {
    color: var(--accent-text);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-card-alt);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.social-icon.linkedin:hover {
    background: #0A66C2;
}

.social-icon.github:hover {
    background: #24292e;
}

.social-icon.email:hover {
    background: linear-gradient(135deg, #DD9933 0%, #c4872d 100%);
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

.social-icon:hover svg {
    fill: white;
}

/* Colonne centre - Logo */
.footer-brand {
    text-align: center;
    justify-self: center;
}

.footer-logo {
    width: 100px;
    height: auto;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: scale(1.05);
}

.footer-copyright {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-copyright strong {
    color: var(--text-primary);
}

/* Colonne droite - Liens légaux */
.footer-legal {
    justify-self: end;
    text-align: right;
}

.legal-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

button.legal-link {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.legal-link,
.legal-link:visited,
.legal-link:link {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.legal-link:hover {
    color: #DD9933 !important;
}

.legal-link svg {
    width: 16px;
    height: 16px;
    fill: #DD9933;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

.legal-link:hover svg {
    opacity: 1;
    transform: translateX(0);
}

/* Barre du bas */
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 20px 40px;
    text-align: center;
}

.footer-bottom-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-bottom-text a {
    color: #DD9933;
    text-decoration: none;
}

.footer-bottom-text a:hover {
    text-decoration: underline;
}

/* ==================== RESPONSIVE ==================== */

/* Desktop large (1000px - 1200px) */
@media (max-width: 1200px) {
    .footer-main {
        padding: 55px 35px 35px;
        gap: 50px;
    }

    .footer-title {
        font-size: 17px;
    }

    .legal-link {
        font-size: 14px;
    }
}

/* Tablette large (769px - 1000px) */
@media (min-width: 769px) and (max-width: 1000px) {
    .footer-main {
        padding: 50px 30px 30px;
        gap: 40px;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social,
    .footer-brand,
    .footer-legal {
        justify-self: center;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .legal-links {
        align-items: center;
    }

    .legal-link {
        justify-content: center;
    }

    .footer-bottom {
        padding: 18px 30px;
    }
}

/* Tablette (601px - 768px) */
@media (min-width: 601px) and (max-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 35px;
        text-align: center;
        padding: 45px 25px 28px;
    }

    .footer-social,
    .footer-brand,
    .footer-legal {
        justify-self: center;
        text-align: center;
    }

    .footer-title {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .social-icons {
        justify-content: center;
        gap: 12px;
    }

    .social-icon {
        width: 48px;
        height: 48px;
    }

    .social-icon svg {
        width: 22px;
        height: 22px;
    }

    .footer-logo {
        width: 85px;
        margin-bottom: 12px;
    }

    .footer-copyright {
        font-size: 13px;
    }

    .legal-links {
        align-items: center;
        gap: 10px;
    }

    .legal-link {
        justify-content: center;
        font-size: 14px;
    }

    .footer-bottom {
        padding: 16px 25px;
    }

    .footer-bottom-text {
        font-size: 12px;
    }
}

/* Mobile (401px - 600px) */
@media (min-width: 401px) and (max-width: 600px) {
    .footer-main {
        padding: 40px 20px 25px;
        gap: 32px;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social,
    .footer-brand,
    .footer-legal {
        justify-self: center;
        text-align: center;
    }

    .footer-title {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .social-icons {
        justify-content: center;
        gap: 12px;
    }

    .social-icon {
        width: 46px;
        height: 46px;
    }

    .social-icon svg {
        width: 21px;
        height: 21px;
    }

    .footer-logo {
        width: 75px;
        margin-bottom: 10px;
    }

    .footer-copyright {
        font-size: 12px;
    }

    .legal-links {
        align-items: center;
        gap: 9px;
    }

    .legal-link {
        justify-content: center;
        font-size: 13px;
    }

    .footer-bottom {
        padding: 15px 20px;
    }

    .footer-bottom-text {
        font-size: 11px;
    }
}

/* Très petit mobile (max 400px) */
@media (max-width: 400px) {
    .footer-main {
        padding: 35px 15px 20px;
        gap: 28px;
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social,
    .footer-brand,
    .footer-legal {
        justify-self: center;
        text-align: center;
    }

    .footer-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .social-icons {
        justify-content: center;
        gap: 10px;
    }

    .social-icon {
        width: 44px;
        height: 44px;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    .footer-logo {
        width: 65px;
        margin-bottom: 8px;
    }

    .footer-copyright {
        font-size: 11px;
    }

    .legal-links {
        align-items: center;
        gap: 8px;
    }

    .legal-link {
        justify-content: center;
        font-size: 12px;
    }

    .footer-bottom {
        padding: 12px 15px;
    }

    .footer-bottom-text {
        font-size: 10px;
        line-height: 1.5;
    }
}

/* ===== COOKIE CONSENT BANNER ===== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
}

.cookie-banner.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.cookie-banner-content {
    max-width: 900px;
    margin: 0 auto 20px;
    padding: 22px 30px;
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(221, 153, 51, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cookie-banner-text {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
}

.cookie-banner-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    fill: #DD9933;
    margin-top: 2px;
}

.cookie-banner-text p {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin: 0;
}

.cookie-banner-text a {
    color: #DD9933;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-banner-text a:hover {
    color: #c4872d;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #DD9933 0%, #c4872d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(221, 153, 51, 0.35);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221, 153, 51, 0.45);
}

.cookie-btn-refuse {
    background: transparent;
    color: #666;
    border: 1.5px solid #ddd;
}

.cookie-btn-refuse:hover {
    background: #f0f0f0;
    border-color: #bbb;
    color: #444;
}

/* ===== RECAPTCHA BLOCKED MESSAGE ===== */

.recaptcha-blocked-msg {
    background: #fff8ee;
    border: 1px solid rgba(221, 153, 51, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recaptcha-blocked-msg svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    fill: #DD9933;
}

.recaptcha-blocked-msg .js-cookie-reopen {
    appearance: none;
    border: none;
    background: none;
    color: #DD9933;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
    padding: 0;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        margin: 0 12px 12px;
        padding: 18px 20px;
        gap: 16px;
        border-radius: 14px;
    }

    .cookie-banner-text {
        gap: 10px;
    }

    .cookie-banner-icon {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }

    .cookie-banner-text p {
        font-size: 13px;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
        text-align: center;
        padding: 10px 16px;
    }
}

/* ===== DARK MODE ===== */

html.dark-mode .cookie-banner-content {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(221, 153, 51, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

html.dark-mode .cookie-banner-text p {
    color: #ccc;
}

html.dark-mode .cookie-btn-refuse {
    color: #aaa;
    border-color: #555;
}

html.dark-mode .cookie-btn-refuse:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #777;
    color: #ddd;
}

html.dark-mode .recaptcha-blocked-msg {
    background: rgba(221, 153, 51, 0.08);
    border-color: rgba(221, 153, 51, 0.2);
    color: #aaa;
}

/* =================================================================
   DARK MODE – Overrides
   CSS variables handle most colors automatically.
   This file only contains rules that CAN'T be expressed with variables:
   - Transition animation class
   - Element-specific overrides (filters, pseudo-elements, forced colors)
   - Component-specific states (hover/active with unique dark colors)
   ================================================================= */

/* ==================== TRANSITION ANIMATION ==================== */
html.animating-theme,
html.animating-theme *,
html.animating-theme *::before,
html.animating-theme *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease !important;
}

/* ==================== HTML ROOT (anti-flash) ==================== */
html.dark-mode {
    background: #1a1a2e;
    color: #e8e8e8;
}

/* ==================== HEADER ==================== */
html.dark-mode .nav-overlay.active {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* Theme toggle in dark mode */
html.dark-mode .theme-toggle {
    background: var(--bg-card-alt);
    border-color: var(--accent);
}

html.dark-mode .theme-toggle svg {
    fill: var(--accent);
}

html.dark-mode .theme-toggle:hover {
    background: var(--accent);
}

html.dark-mode .theme-toggle:hover svg {
    fill: white;
}

/* ==================== HERO ==================== */
/* Protect company/school logos from dark mode filter inversion */
html.dark-mode .entreprise-card,
html.dark-mode .entreprise-logo,
html.dark-mode .ecole-card,
html.dark-mode .ecole-logo {
    filter: none !important;
}

html.dark-mode .entreprise-logo img,
html.dark-mode .entreprise-card img,
html.dark-mode .ecole-logo img,
html.dark-mode .ecole-card img,
html.dark-mode img[alt="Groupe SEMIN"] {
    filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1 !important;
}

/* Cisco logo: black → white in dark mode */
html.dark-mode img[alt="Cisco"] {
    filter: brightness(0) invert(1) !important;
}

/* ==================== BUTTONS ==================== */
/* Ensure white text on accent-colored buttons */
html.dark-mode .nav-btn,
html.dark-mode .nav-btn:link,
html.dark-mode .nav-btn:visited,
html.dark-mode .nav-btn:hover,
html.dark-mode .btn-primary,
html.dark-mode .btn-primary:link,
html.dark-mode .btn-primary:visited,
html.dark-mode .form-submit,
html.dark-mode .form-submit span,
html.dark-mode .btn-veille,
html.dark-mode a.btn-veille,
html.dark-mode a.btn-veille:link,
html.dark-mode a.btn-veille:visited {
    color: white !important;
}

html.dark-mode .btn-secondary {
    background: transparent !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

html.dark-mode .btn-secondary:hover {
    background: var(--accent) !important;
    color: white !important;
}

/* ==================== GENERIC TEXT OVERRIDES ==================== */
/* Catch-all for any text not covered by CSS variables */
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6 {
    color: var(--text-primary);
}

html.dark-mode strong {
    color: var(--text-primary);
}

/* Generic links → accent color */
html.dark-mode a:not(.nav-link):not(.nav-btn):not(.header-logo):not(.btn):not(.btn-primary):not(.btn-secondary):not(.btn-cta):not(.hero-social-icon):not(.social-icon):not(.contact-icon):not(.legal-link):not(.certification-card):not(.certification-link):not(.footer-bottom-text a):not(.synthese-nav-link):not(.synthese-pdf-btn):not(.btn-veille) {
    color: var(--accent) !important;
}

/* ==================== TABLES ==================== */
html.dark-mode table {
    border-color: var(--border-color) !important;
}

html.dark-mode th {
    background: var(--bg-card-alt) !important;
    color: var(--text-primary) !important;
}

html.dark-mode td {
    background: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

html.dark-mode .synthese-table tbody tr {
    border-bottom-color: var(--border-color) !important;
}

html.dark-mode .synthese-table tbody tr:hover {
    background: #1a2745 !important;
}

html.dark-mode .synthese-table tbody td:first-child {
    color: var(--text-primary) !important;
}

/* ==================== SYNTHESE FILTERS ==================== */
html.dark-mode .synthese-nav-link:not(.active) {
    background: var(--bg-card-alt) !important;
    color: var(--text-secondary) !important;
}

html.dark-mode .synthese-nav-link:not(.active):hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

html.dark-mode .synthese-filter-btn:not(.active) {
    background: var(--bg-card-alt) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

html.dark-mode .synthese-filter-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* Competence-specific hover colors */
html.dark-mode .synthese-filter-btn[data-comp="C2"]:hover {
    border-color: #3498db !important;
    color: #3498db !important;
}

html.dark-mode .synthese-filter-btn[data-comp="C3"]:hover {
    border-color: #9b59b6 !important;
    color: #9b59b6 !important;
}

html.dark-mode .synthese-filter-btn[data-comp="C4"]:hover {
    border-color: #27ae60 !important;
    color: #27ae60 !important;
}

html.dark-mode .synthese-filter-btn[data-comp="C5"]:hover {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
}

html.dark-mode .synthese-filter-btn[data-comp="C6"]:hover {
    border-color: #1abc9c !important;
    color: #1abc9c !important;
}

html.dark-mode .synthese-reset-btn {
    background: var(--bg-card-alt) !important;
    color: var(--text-secondary) !important;
}

html.dark-mode .synthese-reset-btn:hover {
    background: #1a2745 !important;
    color: var(--text-primary) !important;
}

/* ==================== PROCEDURES ==================== */
html.dark-mode .proc-search-input {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

html.dark-mode .proc-search-input:focus {
    border-color: var(--accent) !important;
}

html.dark-mode .proc-search-input::placeholder {
    color: var(--text-secondary) !important;
}

html.dark-mode .proc-tab-btn {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

html.dark-mode .proc-tab-count {
    background: var(--bg-card-alt) !important;
    color: var(--text-muted) !important;
}

html.dark-mode .proc-tab-btn.active .proc-tab-count {
    background: var(--tab-color) !important;
    color: white !important;
}

/* ==================== CONTACT FORM ==================== */
html.dark-mode .form-input,
html.dark-mode .form-textarea {
    background: var(--bg-input) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

html.dark-mode .form-input:focus,
html.dark-mode .form-textarea:focus {
    border-color: var(--accent) !important;
    background: var(--bg-card) !important;
    box-shadow: 0 0 0 4px rgba(221, 153, 51, 0.15) !important;
}

html.dark-mode .form-input::placeholder,
html.dark-mode .form-textarea::placeholder {
    color: var(--text-muted) !important;
}

/* ==================== CAROUSEL (VEILLE) ==================== */
html.dark-mode .carousel-arrow {
    background: var(--bg-card) !important;
}

html.dark-mode .carousel-arrow svg {
    fill: var(--text-primary) !important;
}

html.dark-mode .carousel-arrow:hover {
    background: var(--accent-gradient) !important;
}

html.dark-mode .carousel-arrow:hover svg {
    fill: white !important;
}

html.dark-mode .carousel-dot {
    background: var(--border-color) !important;
}

html.dark-mode .carousel-dot.active {
    background: var(--accent) !important;
}

/* ==================== LEGAL PAGES ==================== */
html.dark-mode .legal-page {
    background: var(--bg-body) !important;
}

html.dark-mode .legal-content a {
    color: var(--accent) !important;
}

html.dark-mode .info-divider {
    background: var(--border-color) !important;
}

html.dark-mode .feature-item {
    background: var(--bg-card-alt) !important;
}

html.dark-mode .contact-badge {
    background: var(--bg-card-alt) !important;
}

html.dark-mode .contact-badge-text a {
    color: var(--accent) !important;
}

/* ==================== LABS ==================== */
html.dark-mode .labs-icon {
    background: linear-gradient(135deg, #0f3460 0%, #1a2745 100%) !important;
}

html.dark-mode .labs-badge {
    background: var(--bg-card-alt) !important;
    color: var(--accent) !important;
}

/* ==================== MISSION ICONS ==================== */
html.dark-mode .mission-card.support .mission-icon {
    background: rgba(52, 152, 219, 0.15) !important;
}

html.dark-mode .mission-card.admin .mission-icon {
    background: rgba(221, 153, 51, 0.15) !important;
}

html.dark-mode .mission-card.modern .mission-icon {
    background: rgba(155, 89, 182, 0.15) !important;
}

/* ==================== CERTIFICATION PLACEHOLDERS ==================== */
html.dark-mode .certification-badge.placeholder {
    background: linear-gradient(135deg, #1a2745, #0f3460) !important;
}

html.dark-mode .certification-card.microsoft .certification-badge.placeholder {
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.15), rgba(0, 90, 158, 0.15)) !important;
}

/* ==================== SELECTION ==================== */
html.dark-mode ::selection {
    background: var(--accent);
    color: white;
}
