/* --- VARIABLES THEME & COULEURS --- */
:root {
    --cpw-primary: #007bff;
    --cpw-bg: #f8f9fa;
    --cpw-text: #1e293b;
    --cpw-muted: #64748b;
    
    /* Colors */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-highlight: rgba(255, 255, 255, 0.9);
    --shadow-ios: 0 8px 32px -4px rgba(31, 38, 135, 0.08);
    --shadow-glow: 0 0 24px rgba(0, 123, 255, 0.4);
    
    --panel-bg: rgba(255, 255, 255, 0.85);
    --border-light: rgba(0, 0, 0, 0.06);
    --hover-bg: rgba(0, 0, 0, 0.04);
    
    --blog-text: #334155;
    --blog-heading: #0f172a;
    --blog-link: #2563eb;
    --blog-cta-bg: rgba(248, 250, 252, 0.8);
}

[data-theme="dark"] {
    --cpw-bg: #020617;
    --cpw-text: #f8fafc;
    --cpw-muted: #94a3b8;
    
    /* Colors Dark */
    --glass-bg: rgba(15, 23, 42, 0.55);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --shadow-ios: 0 8px 32px -4px rgba(0, 0, 0, 0.4);
    
    --panel-bg: rgba(15, 23, 42, 0.85);
    --border-light: rgba(255, 255, 255, 0.08);
    --hover-bg: rgba(255, 255, 255, 0.06);
    
    --blog-text: #f1f5f9;
    --blog-heading: #ffffff;
    --blog-link: #60a5fa;
    --blog-cta-bg: rgba(15, 23, 42, 0.6);
}

/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--cpw-bg);
    color: var(--cpw-text);
    overflow-x: hidden;
    position: relative;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease, color 0.5s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

::selection {
    background-color: var(--cpw-primary);
    color: white;
}

/* --- ANIMATIONS DE FOND --- */
.bg-animations {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    opacity: 0.5;
    transition: opacity 0.5s ease;
}
[data-theme="dark"] .bg-animations {
    opacity: 0.25;
}

.blob {
    position: absolute;
    top: 0;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(4rem);
    opacity: 0.4;
    animation: blob 12s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}
.blob-blue {
    left: 20%;
    background-color: #60a5fa;
}
.blob-purple {
    right: 20%;
    background-color: #c084fc;
    animation-delay: 2s;
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(40px, -60px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* --- COMPOSANTS UI REUTILISABLES --- */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cpw-primary), #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    transition: transform 0.3s ease;
}
.brand-logo:hover .brand-icon {
    transform: scale(1.1) rotate(5deg);
}
.brand-text {
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    color: var(--cpw-text);
}
.brand-text span {
    color: var(--cpw-primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cpw-primary), #2563eb);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 10px 20px -5px rgba(0, 123, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.btn-primary:active {
    transform: translateY(0);
}

/* --- HEADER PRINCIPAL --- */
.header-main {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1000px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-glass {
    background-color: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-ios);
    border-radius: 9999px;
    padding: 0.625rem;
    padding-left: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.5s ease;
}
.header-glass.shadow-lg {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    background-color: var(--glass-highlight);
}

/* Grille de maintien pour centrer la navigation sans chevauchement */
.header-left {
    display: flex;
    flex: 1;
}

.nav-desktop {
    display: none;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem;
    border-radius: 9999px;
    background-color: var(--hover-bg);
    border: 1px solid var(--border-light);
}

.nav-link {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cpw-text);
    opacity: 0.8;
    transition: all 0.3s ease;
}
.nav-link:hover {
    opacity: 1;
    background-color: var(--glass-highlight);
}
.nav-link.active {
    background-color: var(--cpw-text);
    color: var(--cpw-bg);
    opacity: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 1;
}

.btn-theme, .btn-menu-mobile, .btn-close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cpw-text);
    transition: all 0.3s ease;
    background-color: transparent;
}
.btn-theme:hover, .btn-menu-mobile:hover {
    background-color: var(--hover-bg);
    transform: scale(1.05);
}

.btn-icon-primary {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--cpw-primary);
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.btn-icon-primary:hover {
    background-color: var(--cpw-primary);
    color: white;
}

.nav-login {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cpw-text);
    opacity: 0.9;
}
.nav-login:hover {
    opacity: 1;
    color: var(--cpw-primary);
}
.nav-login i {
    font-size: 1.125rem;
}

.btn-project {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--cpw-text);
    color: var(--cpw-bg);
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}
.btn-project:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.2);
}

/* --- MENU MOBILE --- */
.offcanvas-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.offcanvas-panel {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    width: 85%;
    max-width: 320px;
    background-color: var(--panel-bg);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 1.5rem;
    z-index: 2000;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}
.btn-close:hover {
    transform: rotate(90deg) scale(1.1);
    background-color: var(--hover-bg);
}

.offcanvas-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-link {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    color: var(--cpw-text);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.mobile-link:hover {
    background-color: var(--hover-bg);
    transform: translateX(5px);
}
.mobile-link.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--cpw-primary);
    border-color: rgba(0, 123, 255, 0.2);
}

.flex-center {
    display: flex;
    align-items: center;
}
.divider {
    height: 1px;
    background-color: var(--border-light);
    border: none;
    margin: 1.5rem 0;
}

/* --- FOOTER --- */
.footer-main {
    margin-top: 8rem;
    padding-top: 5rem;
    padding-bottom: 2.5rem;
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--glass-border);
    background-color: var(--glass-bg);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
}

.footer-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-desc {
    color: var(--cpw-text);
    opacity: 0.8;
    line-height: 1.625;
    margin-bottom: 2rem;
    max-width: 320px;
    font-size: 0.875rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
}
.social-btn {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.social-btn:hover {
    transform: translateY(-4px) scale(1.05);
}
.social-btn:active {
    transform: scale(0.95);
}
.social-btn.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(37, 211, 102, 0.4);
}
.social-btn.email {
    background-color: var(--glass-highlight);
    color: var(--cpw-text);
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--cpw-text);
}
.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.footer-col a {
    color: var(--cpw-text);
    opacity: 0.7;
    font-size: 0.875rem;
    font-weight: 500;
}
.footer-col a:hover {
    opacity: 1;
    color: var(--cpw-primary);
    transform: translateX(4px);
    display: inline-block;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--cpw-text);
    opacity: 0.7;
}
.system-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}
.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* --- STYLES BLOG --- */
.blog-article-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--blog-text);
}
.blog-article-body h1, .blog-article-body h2, .blog-article-body h3, 
.blog-article-body h4, .blog-article-body strong, .blog-article-body b {
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--blog-heading);
}
.blog-article-body a {
    font-weight: 700;
    color: var(--blog-link);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: all 0.3s ease;
}
.blog-article-body a:hover {
    text-decoration-color: transparent;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 4px;
}
.blog-article-body ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.blog-article-body ul::marker {
    color: var(--cpw-primary);
}
.blog-article-body hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid var(--border-light);
}
.blog-cta-box {
    margin-top: 4rem;
    padding: 2.5rem;
    border-radius: 1.5rem;
    text-align: center;
    border: 1px solid var(--glass-border);
    background-color: var(--blog-cta-bg);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    box-shadow: var(--shadow-ios);
    transition: all 0.4s ease;
}
.blog-cta-box h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (min-width: 640px) {
    .btn-project { display: flex; }
    .blog-cta-box { padding: 3rem; }
}

@media (min-width: 768px) {
    .btn-icon-primary, .nav-login { display: flex; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: row; }
    .blog-article-body { font-size: 1.125rem; }
}

@media (min-width: 1024px) {
    .header-glass {
        padding: 0.5rem;
    }
    .nav-desktop { display: flex; }
    .btn-menu-mobile { display: none; }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}