/* --- VARIABLES ET STYLES GLOBAUX --- */
:root {
    --violet: #7F56D9;
    --blue: #2563EB;
    --bg-dark: #030712;
    --bg-card: #111827;
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(127, 86, 217, 0.5);
    --error-color: #F87171;
    --success-color: #34D399;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

.page { display: block; }

/* --- COMPOSANTS UI --- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

header {
    background-color: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
}

header.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 1rem 1rem;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    top: 0.5rem;
    border-bottom: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    transition: color 0.3s ease;
    font-weight: 500;
    position: relative;
    cursor: pointer;
}
.nav-link:hover, .nav-link.active { color: white; }
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--violet), var(--blue));
    transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.gradient-text {
    background: linear-gradient(90deg, var(--violet), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.gradient-button {
    display: inline-block;
    background: linear-gradient(90deg, var(--violet), var(--blue));
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px -5px rgba(0,0,0,0.5);
}
.gradient-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
    box-shadow: 0 10px 25px -5px var(--shadow-color);
}
.gradient-button:disabled {
    background: #374151;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
    transform: none;
}

.secondary-button {
    display: inline-block;
    background-color: transparent;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease-in-out;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.secondary-button:hover {
    background-color: var(--bg-card);
    border-color: var(--violet);
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
}

.guarantee-card {
    position: relative;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(120deg, var(--violet), var(--blue));
}
.guarantee-card .content {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: calc(1rem - 2px);
}

/* --- ANIMATIONS MODERNISÉES --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform, opacity;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- STYLES DES PAGES LÉGALES --- */
.legal-page { padding: 4rem 0; }
.legal-page h1 { font-size: 2.5rem; font-weight: 800; color: white; margin-bottom: 2rem; text-transform: none; }
.legal-page h2 { font-size: 1.5rem; font-weight: 700; color: white; margin-top: 2.5rem; margin-bottom: 1rem; border-left: 3px solid var(--violet); padding-left: 1rem; text-transform: none;}
.legal-page p, .legal-page li { color: var(--text-secondary); line-height: 1.7; }
.legal-page a { color: var(--text-primary); text-decoration: underline; }
.legal-page ul { padding-left: 20px; }
.legal-page strong { color: var(--text-primary); font-weight: 600; }

/* --- BANDEAU COOKIES --- */
#cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background-color: var(--bg-card);
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 2000;
    gap: 1rem;
    flex-wrap: wrap;
    border-radius: 0.75rem;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* --- ACCORDÉON MODERNISÉ --- */
.accordion-item {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}
.accordion-item:hover {
    border-color: rgba(127, 86, 217, 0.5);
}
.accordion-button {
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
}
.accordion-button .accordion-icon {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    flex-shrink: 0;
    margin-left: 1rem;
}
.accordion-button[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.accordion-content-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin: 0 1.5rem;
    padding-top: 1.5rem;
}
.accordion-content-inner p {
    margin: 0;
    line-height: 1.7;
}

.social-icon {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}
.social-icon:hover {
    color: white;
    transform: scale(1.1) translateY(-2px);
}

.profile-medallion {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(90deg, var(--violet), var(--blue));
    margin: auto auto 1.5rem auto;
    box-shadow: 0 0 40px -10px var(--shadow-color);
}
.profile-medallion img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-dark);
}

.credentials-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
    text-align: left;
}
.credentials-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.credentials-list .icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

/* --- STYLES ESPACE CONNEXION --- */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 4rem 0;
}
.auth-container {
    width: 100%;
    max-width: 450px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
}
.auth-container h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}
.auth-form .form-group {
    margin-bottom: 1.5rem;
}
.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.auth-form .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}
.auth-form .form-input:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(127, 86, 217, 0.3);
}
.auth-form .gradient-button {
    width: 100%;
    font-size: 1.1rem;
}
.auth-toggle-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}
.auth-toggle-link a {
    color: var(--violet);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.auth-toggle-link a:hover {
    text-decoration: underline;
}
.auth-message {
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    display: none;
}
#auth-error-message {
    color: var(--error-color);
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--error-color);
}
#auth-success-message {
    color: var(--success-color);
    background-color: rgba(52, 211, 153, 0.1);
    border: 1px solid var(--success-color);
}

.rgpd-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.rgpd-group input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
    accent-color: var(--violet);
}
.rgpd-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.rgpd-group a {
    color: var(--text-primary);
    text-decoration: underline;
}


/* --- STYLES ESPACE MEMBRE & DASHBOARD --- */
.member-page-header {
    text-align: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
}
.member-page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.member-page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}
.dashboard-content {
    text-align: center;
    padding: 4rem 1.5rem;
}
.dashboard-content .icon {
    font-size: 4rem;
    color: var(--violet);
    margin-bottom: 1.5rem;
}
.dashboard-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}
.dashboard-content p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

/* --- NOUVEAUX STYLES POUR L'ESPACE MEMBRE --- */
.progress-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.progress-bar-bg {
    background-color: var(--bg-card);
    border-radius: 0.5rem;
    height: 1.5rem;
    padding: 4px;
    border: 1px solid var(--border-color);
}
.progress-bar {
    background: linear-gradient(90deg, var(--violet), var(--blue));
    height: 100%;
    width: 0%;
    border-radius: 0.25rem;
    transition: width 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}
.progress-label {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.module-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
}
.module-checkbox-label:hover {
    background-color: rgba(255,255,255,0.05);
}
.module-checkbox {
    width: 1.25em;
    height: 1.25em;
    accent-color: var(--violet);
}

.module-resources {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
.module-resources a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-section {
    padding: 4rem 0;
    background-color: var(--bg-card);
    margin-top: 4rem;
    text-align: center;
}
.contact-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.contact-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}
.contact-section a {
    color: white;
    font-weight: 600;
    text-decoration: none;
}
.contact-section a:hover {
    text-decoration: underline;
}

.video-embed-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    margin-top: 1rem;
    border-radius: 0.5rem;
    background-color: #000;
}
.video-embed-container iframe,
.video-embed-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-watched-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success-color);
    margin-left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- NOUVEAUX STYLES POUR LA PAGE PROFIL --- */
.profile-section {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}
.profile-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.profile-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1.5rem;
}
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.profile-info-grid p {
    margin: 0;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}
.profile-info-grid p strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- STYLES POUR LES MENUS DÉROULANTS --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0;
    margin-top: 10px;
}

.dropdown-content a {
    color: var(--text-secondary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: 500;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* --- SECTION RESPONSIVE CORRIGÉE --- */
#mobile-menu-button {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

#mobile-menu {
    display: none;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--bg-card);
}

#mobile-menu a {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

#mobile-menu a:last-child {
    border-bottom: none;
}

@media (max-width: 992px) {
    #desktop-menu {
        display: none !important;
    }
    #mobile-menu-button {
        display: block;
    }
}