/* ==========================================================================
   PIXELPROD — style.css
   Refactorisé selon les principes du cours Responsive Design
   Architecture : Reset → Variables → Base → Layout → Composants → Responsive
   ========================================================================== */


/* ==========================================================================
   1. RESET & BOX-SIZING (Chapitre 2.2 du cours)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box; /* Crucial : padding/border inclus dans width */
    margin: 0;
    padding: 0;
}

img, video, svg {
    max-width: 100%;   /* Images jamais plus larges que leur conteneur */
    height: auto;
    display: block;    /* Supprime l'espace blanc inline sous les images */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;            /* Prévient le scroll horizontal */
    min-height: 100vh;
    line-height: 1.6;
    font-family: var(--font-base);
}


/* ==========================================================================
   2. VARIABLES CSS (Chapitre 2.3 — Custom Properties)
   ========================================================================== */
:root {
    /* Palette */
    --color-bg:          #1a1a2e;
    --color-bg-dark:     #0b0b10;
    --color-bg-card:     rgba(255, 255, 255, 0.03);
    --color-border:      rgba(255, 255, 255, 0.05);
    --color-text:        #ffffff;
    --color-text-muted:  #b0b0c0;

    /* Marque */
    --color-primary:     #ff4b1f;
    --color-secondary:   #ff9068;
    --color-gradient:    linear-gradient(90deg, #ff4b1f, #ff9068);

    /* Typographie — clamp() pour fluidité (Chapitre 6.2) */
    --font-base:         'Poppins', sans-serif;
    --fs-xs:             clamp(0.75rem, 1.5vw, 0.875rem);
    --fs-sm:             clamp(0.875rem, 1.8vw, 1rem);
    --fs-base:           clamp(1rem, 2vw, 1.125rem);
    --fs-lg:             clamp(1.1rem, 2.5vw, 1.3rem);
    --fs-h3:             clamp(1.4rem, 3vw, 1.8rem);
    --fs-h2:             clamp(2rem, 5vw, 3rem);
    --fs-h1:             clamp(2.5rem, 7vw, 5rem);
    --fs-display:        clamp(1.8rem, 5vw, 3.5rem);

    /* Espacements */
    --sp-xs:   0.25rem;
    --sp-sm:   0.5rem;
    --sp-md:   1rem;
    --sp-lg:   1.5rem;
    --sp-xl:   2rem;
    --sp-2xl:  3rem;
    --sp-3xl:  5rem;

    /* Rayons */
    --radius-sm:   8px;
    --radius-md:   15px;
    --radius-lg:   20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition:  0.3s ease;

    /* Ombres */
    --shadow-md:   0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg:   0 20px 60px rgba(0, 0, 0, 0.6);

    /* Breakpoints — référence commentée (non utilisables dans @media) */
    /* --bp-md:  768px  */
    /* --bp-lg:  992px  */
    /* --bp-xl:  1200px */
}


/* ==========================================================================
   3. HEADER / NAVBAR — Mobile-First (Chapitre 8.1)
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--sp-md) var(--sp-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 200;
    background: linear-gradient(to bottom, rgba(10, 10, 20, 0.9), transparent);
    transition: background var(--transition);
}

header.scrolled {
    background: var(--color-bg-dark);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.logo {
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    color: var(--color-text);
    text-decoration: none;
    flex-shrink: 0;
}

/* ── Navigation desktop ──
   CACHÉE par défaut (mobile) → affichée à partir de 768px via media query
   ────────────────────────────────────────────────────────────────────── */
.nav-desktop {
    display: none; /* caché sur mobile */
}

.nav-desktop ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: var(--sp-xl);
}

.nav-desktop a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--fs-sm);
    transition: color var(--transition);
}

.nav-desktop a:hover {
    color: var(--color-secondary);
}

.btn-register {
    padding: 10px 25px;
    background: var(--color-gradient);
    border-radius: var(--radius-full);
    color: white !important;
    font-weight: 600;
    transition: transform 0.2s;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn-register:hover {
    transform: scale(1.05);
}

/* ── Hamburger ──
   VISIBLE par défaut (mobile) → caché à partir de 768px via media query
   ────────────────────────────────────────────────────────────────────── */
.hamburger {
    display: flex;          /* visible sur mobile */
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--sp-sm);
    z-index: 300;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}

/* Animation hamburger → croix */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ── Menu overlay mobile ──
   Caché par défaut → affiché avec .active
   ────────────────────────────────────────── */
.nav-mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.97);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-xl);
    z-index: 250;
    animation: fadeIn 0.3s ease;
}

.nav-mobile-menu.active {
    display: flex;
}

.nav-mobile-menu a {
    font-size: var(--fs-h3);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition);
    /* Taille tactile min */
    padding: var(--sp-sm) var(--sp-md);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-mobile-menu a:hover {
    color: var(--color-secondary);
}


/* ==========================================================================
   4. HERO SLIDER
   ========================================================================== */
.hero-slider-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Mobile-First : padding réduit */
    padding: 80px var(--sp-xl) var(--sp-2xl);
    background-color: var(--color-bg);
    position: relative;
}

.hero-slider {
    position: relative;
    width: 100%;
    max-width: 1000px;
    /* clamp() pour la hauteur : adaptatif (Chapitre 6.2) */
    height: clamp(280px, 55vw, 520px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.slide {
    position: absolute;
    inset: 0;                  /* Remplace top/left/width/height */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    padding-left: 8%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.bg-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -1;
    transform: scale(1);
    transition: transform 6s ease;
    border-radius: var(--radius-lg);
}

.slide.active .bg-image {
    transform: scale(1.05);
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(10, 10, 20, 0.75) 0%,
        rgba(10, 10, 20, 0.1) 60%,
        transparent 100%
    );
}

.content {
    position: relative;
    z-index: 10;
    /* Largeur max en % pour s'adapter (pas de px fixes sur mobile) */
    max-width: min(450px, 90%);
    transform: translateY(20px);
    opacity: 0;
    transition: all 1s ease-out 0.5s;
}

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

.tag {
    display: inline-block;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 20px;
    margin-bottom: var(--sp-md);
    background: var(--color-gradient);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 15px rgba(255, 75, 31, 0.3);
}

h1 {
    font-size: var(--fs-h1);
    line-height: 1.1;
    margin-bottom: var(--sp-lg);
}

p.description {
    font-size: var(--fs-base);
    line-height: 1.6;
    margin-bottom: var(--sp-xl);
    opacity: 0.9;
}

.btn-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: var(--fs-sm);
}

.btn-main:hover {
    background: white;
    color: var(--color-bg);
}

/* ── Contrôles slider ── */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(38px, 5vw, 50px);
    height: clamp(38px, 5vw, 50px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    z-index: 20;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.arrow-left  { left: 15px; }
.arrow-right { right: 15px; }

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--sp-sm);
    z-index: 20;
}

.dot {
    width: clamp(34px, 4vw, 45px);
    height: clamp(34px, 4vw, 45px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.dot.active {
    background: var(--color-gradient);
    border-color: var(--color-secondary);
    transform: scale(1.15);
    box-shadow: 0 5px 20px rgba(255, 75, 31, 0.4);
}

/* Flèche scroll-down */
.scroll-down-arrow {
    position: absolute;
    bottom: 30px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 20;
    transition: all var(--transition);
    animation: bounce 2s infinite;
}

.scroll-down-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}


/* ==========================================================================
   5. SECTIONS GLOBALES
   Mobile-First : 1 colonne → 2 colonnes sur md (Chapitre 5.4)
   ========================================================================== */
.section-padding {
    padding: var(--sp-2xl) var(--sp-xl);
}

/* Grille 1 colonne par défaut → 2 colonnes à partir de md */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;          /* 1 col sur mobile */
    gap: var(--sp-2xl);
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Titres h2 fluides */
h2 {
    font-size: var(--fs-h2);
    margin-bottom: var(--sp-lg);
    background: linear-gradient(90deg, #fff, #a8a8ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.text-content p {
    font-size: var(--fs-base);
    line-height: 1.8;
    color: var(--color-text-muted);
    margin-bottom: var(--sp-xl);
    /* Longueur optimale de ligne : 70 caractères (Chapitre 6.3) */
    max-width: 70ch;
}

.about-section      { background-color: #161625; }
.community-section  { background-color: var(--color-bg); }

/* Inversion layout sur desktop */
.reverse-layout .text-content { order: 2; }
.reverse-layout .image-content { order: 1; }

/* Images avec object-fit (Chapitre 7.2) */
.image-content img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition);
    /* Hauteur fixe avec object-fit pour éviter déformation */
    max-height: 500px;
    object-fit: cover;
}

.image-content img:hover {
    transform: scale(1.02);
}

/* Petites cartes features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* auto-fit sans media query */
    gap: var(--sp-lg);
    margin-top: var(--sp-xl);
}

.feature-card {
    background: var(--color-bg-card);
    padding: var(--sp-lg);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.feature-card h3 {
    font-size: var(--fs-h3);
    margin-bottom: 5px;
    color: var(--color-secondary);
}

.feature-card span {
    font-size: var(--fs-xs);
    color: #888;
    text-transform: uppercase;
}


/* ==========================================================================
   6. SECTION CONTACT
   ========================================================================== */
.newsletter-section {
    position: relative;
    padding: var(--sp-3xl) var(--sp-xl);
    text-align: center;
    background:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.8)),
        url('https://images.unsplash.com/photo-1550745165-9bc0b252726f?q=80&w=2070');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.newsletter-content {
    max-width: 700px;
    margin: 0 auto;
}

.contact-form {
    margin-top: var(--sp-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

.form-row {
    display: grid;
    /* 1 colonne mobile → 2 colonnes à partir de md (Chapitre 3.1) */
    grid-template-columns: 1fr;
    gap: var(--sp-md);
}

.contact-form input,
.contact-form textarea {
    padding: 15px 25px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    color: white;
    outline: none;
    font-size: var(--fs-base);
    width: 100%;
    transition: var(--transition);
    /* min height tactile ≥ 44px (Chapitre 9.1 règle 8) */
    min-height: 44px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-secondary);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    padding: 15px 30px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--color-gradient);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--fs-base);
    margin-top: var(--sp-sm);
    /* Hauteur minimale tactile */
    min-height: 50px;
}

.contact-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 75, 31, 0.4);
}


/* ==========================================================================
   7. FOOTER
   ========================================================================== */
footer {
    background: var(--color-bg-dark);
    padding: var(--sp-2xl) var(--sp-xl);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--sp-lg);
    margin-bottom: var(--sp-lg);
    flex-wrap: wrap;
}

.social-links a {
    color: #888;
    font-size: 1.5rem;
    transition: var(--transition);
    /* Taille tactile min (Chapitre 9.1 règle 8) */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.social-links a:hover {
    color: white;
    transform: translateY(-3px);
}

.copyright {
    color: #555;
    font-size: var(--fs-xs);
}


/* ==========================================================================
   8. MODALES
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s;
    /* Padding pour les petits mobiles */
    padding: var(--sp-lg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #161625, #0f0f1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--sp-2xl);
    width: 100%;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    animation: slideDown 0.4s ease-out;
    /* Empêche la modale d'être trop haute sur mobile */
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.close-modal:hover {
    color: var(--color-primary);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: var(--fs-display);
    margin-bottom: var(--sp-sm);
    background: linear-gradient(90deg, #fff, var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-content p {
    color: #bbb;
    margin-bottom: var(--sp-xl);
    font-size: var(--fs-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

.input-icon {
    position: relative;
    width: 100%;
}

.input-icon i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-secondary);
    font-size: 1.1rem;
}

.input-icon input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    outline: none;
    transition: var(--transition);
    /* min-height tactile */
    min-height: 50px;
}

.input-icon input:focus {
    border-color: var(--color-secondary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 144, 104, 0.2);
}

.btn-submit {
    padding: 15px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--color-gradient);
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: var(--fs-base);
    transition: var(--transition);
    margin-top: var(--sp-sm);
    min-height: 50px;
}

.btn-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(255, 75, 31, 0.4);
}

.switch-auth {
    margin-top: var(--sp-lg);
    font-size: 0.85rem;
}

.switch-auth a {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.switch-auth a:hover {
    text-decoration: underline;
    color: var(--color-primary);
}


/* ==========================================================================
   9. ALERTES CONTACT
   ========================================================================== */
.alert-box {
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-lg);
    text-align: center;
    font-weight: 600;
    font-size: var(--fs-sm);
    animation: fadeIn 0.5s ease-in-out;
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid #2ecc71;
    color: #2ecc71;
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    color: #e74c3c;
}


/* ==========================================================================
   10. RESPONSIVE — MOBILE FIRST avec min-width (Chapitre 3.2)
   Breakpoints pilotés par le contenu (Chapitre 3.3)

   sm  : 576px  — Grands mobiles
   md  : 768px  — Tablettes
   lg  : 992px  — Desktop
   xl  : 1200px — Grand desktop
   ========================================================================== */


/* ── sm : ≥ 576px ──────────────────────────────────────────── */
@media (min-width: 576px) {
    header {
        padding: var(--sp-lg) var(--sp-2xl);
    }

    .form-row {
        /* Formulaire : 2 colonnes à partir de sm */
        grid-template-columns: 1fr 1fr;
    }
}


/* ── md : ≥ 768px ──────────────────────────────────────────── */
@media (min-width: 768px) {
    /* Section padding plus généreux sur tablette/desktop */
    .section-padding {
        padding: var(--sp-3xl) var(--sp-3xl);
    }

    /* Grille 2 colonnes */
    .grid-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-2xl);
    }

    /* Hamburger CACHÉ à partir de 768px */
    .hamburger {
        display: none !important;
    }

    /* Nav desktop AFFICHÉE à partir de 768px */
    .nav-desktop {
        display: block;
    }

    /* Hero slider plus haut */
    .hero-slider-wrapper {
        padding: 100px var(--sp-2xl) var(--sp-2xl);
    }

    /* Contrôles slider repositionnés */
    .arrow-left  { left: 30px; }
    .arrow-right { right: 30px; }

    .slider-dots {
        bottom: 40px;
        gap: var(--sp-md);
    }

    /* Image content : hauteur fixe avec object-fit (Chapitre 7.2) */
    .image-content img {
        max-height: none;
        height: 450px;
    }
}


/* ── lg : ≥ 992px ──────────────────────────────────────────── */
@media (min-width: 992px) {
    .section-padding {
        padding: 100px 10%;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Inversion layout sur desktop */
    .reverse-layout .text-content { order: 2; }
    .reverse-layout .image-content { order: 1; }

    .newsletter-section {
        padding: 120px var(--sp-xl);
    }
}


/* ── xl : ≥ 1200px ─────────────────────────────────────────── */
@media (min-width: 1200px) {
    header {
        padding: var(--sp-lg) 50px;
    }

    .arrow-left  { left: 30px; }
    .arrow-right { right: 30px; }
}
