:root {
    /* Couleurs issues du thème iOS / Modernes */
    --powder-green: #a6f2d1;
    --powder-green-rgb: 166, 242, 209;
    --midnight-blue: #050d26;
    --cobalt-top: #2e52a6;
    --cobalt-bottom: #142659;
    
    /* Variables Glassmorphism */
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --error: #ff4d4d;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--midnight-blue);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* ========================================= */
/* --- BACKGROUNDS --- */
/* ========================================= */

.bg-gradient {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--cobalt-top), var(--cobalt-bottom));
    z-index: -3;
}

.bg-halos {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(circle at 20% 10%, rgba(var(--powder-green-rgb), 0.25) 0%, transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(var(--powder-green-rgb), 0.20) 0%, transparent 45%);
    filter: blur(60px);
    z-index: -2;
}

.bg-grain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    mix-blend-mode: screen;
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
}

/* ========================================= */
/* --- LAYOUT GLOBAL ---*/
/* ========================================= */

nav {
    width: 92% !important;
    max-width: 1600px !important;
    top: 20px;
    background: rgba(5, 13, 38, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: fixed;
}

main {
    width: 92% !important;
    max-width: 1600px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(120px, 15vh, 180px) 20px 80px 20px !important;
}

.content-section, 
.pair-annonce-section, 
.pair-photos-section,
#ticketsSection, 
#reportsSection, 
#newsSection {
    width: 100% !important;
    max-width: 1600px !important; 
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hy-container, .pair-main {
    width: 100% !important;
    max-width: 1400px !important;
    gap: clamp(30px, 5vw, 60px);
}

.description, .intro-text, .templates-description, .legal-section, .pair-description-left {
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-dim);
    line-height: 1.6;
    font-weight: 400;
}

/* ========================================= */
/* --- NAVIGATION ITEMS --- */
/* ========================================= */

.nav-group { 
    display: flex; 
    gap: clamp(10px, 2vw, 20px);
    list-style: none; 
    align-items: center;
}

.nav-separator {
    margin-left: clamp(5px, 1vw, 15px);
    padding-left: clamp(10px, 2vw, 30px);
    border-left: 1px solid rgba(166, 242, 209, 0.2);
}

.nav-group a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 600;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
}

.nav-group a:hover, .nav-group a.active {
    color: var(--powder-green);
    text-shadow: 0 0 10px rgba(var(--powder-green-rgb), 0.5);
}

/* ========================================= */
/* --- TYPOGRAPHIE GLOBALE --- */
/* ========================================= */

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 20px;
    background: linear-gradient(to bottom, #ffffff 30%, var(--powder-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-align: center;
    width: 100%;
}

.status-tag {
    font-size: 1rem;
    font-weight: 600;
    color: var(--powder-green);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* ========================================= */
/* --- FORMS & INPUTS --- */
/* ========================================= */

.form-container {
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 24px;
    width: 100%;
    max-width: 600px !important;
    margin: 20px auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
}

input, textarea {
    width: 100%;
    padding: 16px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, textarea:focus { 
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--powder-green); 
    box-shadow: 0 0 0 4px rgba(var(--powder-green-rgb), 0.15); 
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--powder-green), #75d4a6);
    color: var(--midnight-blue);
    border: none;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px rgba(var(--powder-green-rgb), 0.25);
}

.btn-submit:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 12px 25px rgba(var(--powder-green-rgb), 0.4); 
}

#msg { margin-top: 15px; font-size: 0.95rem; font-weight: 500; }
.error { color: var(--error); background: rgba(255, 77, 77, 0.1); padding: 10px 15px; border-radius: 8px; width: 100%; text-align: center; }
.success { color: var(--powder-green); background: rgba(166, 242, 209, 0.1); padding: 10px 15px; border-radius: 8px; width: 100%; text-align: center; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================= */
/* --- COMPOSANTS : PAGE HY & EXPLICATIONS --- */
/* ========================================= */

.hy-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.hy-template-img {
    flex: 1;
    min-width: 280px;
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 24px;
    border: 1px solid rgba(166, 242, 209, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.hy-explanations {
    flex: 1.5; 
    min-width: 300px;
    text-align: left;
}

.explanation-item { margin-bottom: 25px; }

.explanation-title {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.explanation-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--powder-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--powder-green);
}

.explanation-text {
    color: var(--text-dim);
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.6;
    padding-left: 18px;
}

/* ========================================= */
/* --- SECTION DES TEMPLATES ET GRILLES --- */
/* ========================================= */

.templates-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: white;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(15px, 3vw, 30px);
    width: 100%;
}

.template-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(166, 242, 209, 0.1);
    border-radius: 20px;
    padding: 15px;
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.template-card:hover {
    transform: translateY(-8px);
    border-color: rgba(166, 242, 209, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.template-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16; 
    border-radius: 12px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    object-fit: cover; 
    cursor: pointer; 
}

.template-card-title {
    color: var(--powder-green);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ========================================= */
/* --- GRILLES PAIR ET NEWS --- */
/* ========================================= */

/* Le haut de la page PAIR (Annonce + Image) reste empilé de haut en bas */
.pair-annonce-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(30px, 5vw, 50px);
    align-items: center;
    width: 100%;
}

.pair-annonce-text {
    text-align: center;
    width: 100%;
}

.pair-description-left {
    margin: 0 auto !important;
    text-align: center;
}

.pair-image-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.pair-image-frame img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Les deux images en bas de PAIR/NEWS restent côte à côte sur TOUS les écrans */
.pair-two-images-grid {
    display: flex;
    flex-direction: row; /* Forcé en côte à côte */
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(10px, 3vw, 40px); /* L'espace entre les images rétrécit sur mobile */
    width: 100%;
    margin-top: clamp(20px, 4vw, 40px);
}

.pair-large-photo-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(166, 242, 209, 0.1);
    border-radius: clamp(12px, 3vw, 24px); /* Les bords s'adaptent */
    padding: clamp(10px, 2vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1; /* Chaque image prend 50% de l'espace disponible */
    min-width: 0; /* Empêche le débordement sur petit écran */
}

.pair-large-photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border-color: rgba(166, 242, 209, 0.3);
}

.pair-large-photo-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; 
    object-fit: cover;
    border-radius: clamp(8px, 2vw, 16px);
    margin-bottom: clamp(10px, 2vw, 20px);
}

.pair-large-photo-card figcaption {
    color: var(--text-dim);
    font-size: clamp(0.7rem, 2vw, 1rem); /* Le texte d'explication réduit proprement sans casser */
    line-height: 1.4;
    width: 100%;
}

/* ========================================= */
/* --- CARROUSEL --- */
/* ========================================= */

/* Limite maximale et minimale raisonnable pour le chariot */
.pulse-carousel-wrapper {
    width: 100% !important;
    min-width: 280px !important; /* Ne devient pas plus petit qu'un smartphone */
    max-width: 900px !important; /* Ne s'étire pas à l'infini sur un grand écran */
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: clamp(16px, 4vw, 28px);
    border: 1px solid rgba(166, 242, 209, 0.2);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.pulse-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.pulse-carousel-slide {
    min-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* Garde le ratio vidéo quoi qu'il arrive */
    object-fit: cover;
}

.pulse-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(5, 13, 38, 0.6);
    color: white;
    border: 1px solid rgba(166, 242, 209, 0.2);
    width: clamp(30px, 8vw, 50px);
    height: clamp(30px, 8vw, 50px);
    border-radius: 50%;
    cursor: pointer;
    font-size: clamp(14px, 4vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: 0.3s ease;
    z-index: 10;
}

.pulse-carousel-btn:hover {
    background: var(--powder-green);
    color: var(--midnight-blue);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(var(--powder-green-rgb), 0.4);
}

.pulse-btn-prev { left: clamp(10px, 2vw, 20px); }
.pulse-btn-next { right: clamp(10px, 2vw, 20px); }

/* ========================================= */
/* --- LIGHTBOX (MODAL) --- */
/* ========================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(5, 13, 38, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.3s ease-out forwards;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(166, 242, 209, 0.3);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px; right: 30px;
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10000;
}
.close-modal:hover { color: var(--powder-green); transform: scale(1.1); }

.prev-modal, .next-modal {
    cursor: pointer; position: absolute; top: 50%;
    transform: translateY(-50%); padding: 15px;
    color: white; font-size: 35px; transition: 0.3s;
    user-select: none; z-index: 10000;
}
.prev-modal { left: 15px; }
.next-modal { right: 15px; }

.prev-modal:hover, .next-modal:hover { color: var(--powder-green); transform: translateY(-50%) scale(1.2); }

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ========================================= */
/* --- FOOTER & TELECHARGEMENT --- */
/* ========================================= */

.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: clamp(40px, 8vw, 60px);
    padding: clamp(20px, 4vw, 40px) 20px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 1600px !important;
}

.app-branding { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.footer-app-logo { width: 45px; height: 45px; border-radius: 12px; }
.footer-app-name { font-size: 1.4rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; }

.store-badges { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; }
.store-badges img { height: clamp(40px, 5vw, 48px); width: auto; border-radius: 8px; transition: 0.3s; }
.store-badges img:hover { transform: translateY(-4px); filter: brightness(1.15); }

footer {
    padding: clamp(30px, 5vw, 40px) 20px;
    font-size: 0.7rem; color: #475569; letter-spacing: 2px;
    text-transform: uppercase; text-align: center; width: 100%;
}

.footer-links { display: flex; justify-content: center; gap: clamp(15px, 3vw, 30px); margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-weight: 600; transition: 0.3s; }
.footer-links a:hover { color: var(--powder-green); }


/* ========================================= */
/* --- RESPONSIVE MOBILE & TABLETTE --- */
/* ========================================= */

@media (max-width: 900px) {
    div[style*="margin-top"], section[style*="margin-top"] {
        margin-top: 60px !important;
    }
    div[style*="margin-bottom"], section[style*="margin-bottom"] {
        margin-bottom: 40px !important;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 15px 20px !important;
        flex-direction: column;
        gap: 15px;
        border-radius: 20px;
        width: 95% !important;
        top: 10px;
    }
    
    .nav-group { gap: 10px; flex-wrap: wrap; justify-content: center; }
    .nav-separator { border-left: none; padding-left: 0; margin-left: 0; }
    
    main { padding-top: 160px !important; padding-left: 15px; padding-right: 15px; }
    
    /* La grille principale des templates passe sur 2 colonnes (et pas 1) pour garder un bel aperçu */
    .templates-grid { grid-template-columns: repeat(2, 1fr); }
    
    .hy-container { flex-direction: column; text-align: center; }
    .hy-explanations { text-align: center; }
    .explanation-title { justify-content: center; }
    .explanation-text { padding-left: 0; }
}

@media (max-width: 480px) {
    div[style*="margin-top"], section[style*="margin-top"] {
        margin-top: 40px !important;
    }
    .nav-group a { font-size: 0.75rem; }
}