/* 
    KING CHARLY DIGITAL AGENCY 
    Design System & Global Styles
    Colors: Black, Blue, White
    Typography: Poppins
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0066ff;
    --primary-dark: #004ecc;
    --primary-light: #4d94ff;
    --black: #0a0a0b;
    --black-soft: #141417;
    --white: #ffffff;
    --gray-light: #f4f4f5;
    --gray-accent: #27272a;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --font-main: 'Poppins', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --container-width: 1200px;
    --header-height: 100px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--black);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

button, .btn {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font-main);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1, h2, h3, h4, h5 {
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -1px; }
h2 { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.5px; }
h3 { font-size: 1.75rem; font-weight: 600; }

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    section { padding: 60px 0; }
    .container { padding: 0 1.5rem; }
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-secondary:hover {
    background: rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

/* Layout Parts */
header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(10px);
}

header.scrolled {
    height: 80px;
    background: var(--black-soft);
    border-bottom: 1px solid var(--gray-accent);
}

header .container {
    width: 100%;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo img {
    height: 65px;
    width: auto;
    transition: var(--transition);
}

header.scrolled .logo img {
    height: 50px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    margin: 0 auto;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cta-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-cta .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--white);
    border-radius: 3px;
    transition: var(--transition);
}

@media (max-width: 992px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--black-soft);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
        z-index: 999;
        box-shadow: -10px 0 30px rgba(0,0,0,0.8);
        gap: 2rem;
    }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: 600;
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
        z-index: 1000;
        margin-left: 0;
    }

    .menu-toggle span {
        background: var(--primary);
    }

    /* Hamburger Animation */
    .menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .nav-cta {
        display: none;
    }
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 1001;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.footer-logo {
    height: 80px;
    width: auto;
    margin-bottom: 2rem;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    color: var(--white);
    font-size: 1.2rem;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }

section {
    padding: 100px 0;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 1s all ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism Card Style */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}
/* Hero Section Adjustments */
.hero, .about-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    padding-top: var(--header-height);
    text-align: center;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .hero, .about-hero {
        min-height: 100vh; /* Keep full height for impact */
        padding-top: calc(var(--header-height) + 40px); /* Extra space for mobile */
        padding-bottom: 40px;
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 300px;
        margin-right: 0 !important;
    }

    h1 {
        font-size: 2rem !important;
        padding: 0 10px;
    }
}

/* Responsive Feature Grid for Branch Section */
.branch-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem;
}

@media (max-width: 992px) {
    .branch-card {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
    }
    
    .branch-grid-img {
        height: 300px !important;
    }
}

/* WhatsApp Icon Enhancements */
.whatsapp-float {
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-float img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

/* Global Responsive Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--min-width, 280px), 1fr));
    gap: 2rem;
}

@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .grid-2 > .reveal[style*="order"] {
        order: 0 !important;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0 !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    .glass-card h3 {
        word-wrap: break-word;
        hyphens: auto;
        font-size: 1.5rem;
    }

    .why-us, .pre-footer-cta {
        padding: 3rem 1.5rem !important;
    }
}

/* ==========================================================================
   ACCESSIBILITÉ
   ========================================================================== */

/* Visibilité au clavier : sans ça, la navigation Tab est invisible. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Lien d'évitement pour les lecteurs d'écran et la navigation clavier. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 1rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
}

.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;
}

/* Respect du réglage système « réduire les animations ». */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Le bouton burger est un <button> : on neutralise le style natif. */
.menu-toggle {
    background: none;
    border: none;
    padding: 0;
}

/* ==========================================================================
   FORMULAIRE DE CONTACT
   ========================================================================== */

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-field .required {
    color: var(--primary-light);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.85rem;
    background: var(--black);
    border: 1px solid var(--gray-accent);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #6b6b74;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: #3f3f46;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    background: #08080a;
}

/* Champ piège anti-robots : invisible mais pas display:none, que certains
   robots savent détecter. */
.form-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.form-actions {
    display: grid;
    gap: 1rem;
}

.form-actions .btn {
    width: 100%;
    padding: 1rem;
}

.btn-whatsapp {
    background: #25d366;
    color: #072d16;
    font-weight: 700;
}

.btn-whatsapp:hover {
    background: #1fb457;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.35);
}

.btn[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
}

/* Message de retour après envoi */
.form-feedback {
    display: none;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-feedback.is-visible {
    display: block;
}

.form-feedback.is-success {
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(37, 211, 102, 0.5);
    color: #7ff0ac;
}

.form-feedback.is-error {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.5);
    color: #ff9aa3;
}

.form-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
