:root {
    --primary: #7451eb;
    /* OpenClassrooms Purple */
    --secondary: #3d2b7a;
    /* Darker Purple for contrast */
    --warning: #FBBC05;
    --danger: #EA4335;
    --dark: #202124;
    --light: #F8F9FA;
    --gray: #5F6368;
    --white: #FFFFFF;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;

    /* OpenClassrooms inspired gradients */
    --gradient-primary: linear-gradient(135deg, #7451eb 0%, #5438c9 100%);
    --gradient-text: linear-gradient(to right, #7451eb, #9a7dff);
    --surface: #ffffff;
    --surface-hover: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    font-family: var(--font-body);
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(116, 81, 235, 0.39);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 81, 235, 0.23);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(116, 81, 235, 0.39);
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    /* Ensure vertical alignment */
}

.nav-links a {
    font-weight: 500;
    color: var(--gray);
    position: relative;
    padding: 8px 16px;
    /* Add padding for a button-like feel if needed, or just space */
    border-radius: 50px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary);
    background-color: rgba(116, 81, 235, 0.1);
    /* Subtle hover background */
}

/* Active/selected state */
/* Active/selected state */
.nav-links a.active {
    background-color: var(--primary);
    color: var(--white) !important;
    /* Force white text */
    box-shadow: 0 4px 10px rgba(116, 81, 235, 0.3);
}

/* Nav Button Specifics (S'inscrire) */
.nav-links .btn {
    padding: 8px 16px;
    /* Match standard link padding */
    font-size: 1rem;
    /* Match standard link size */
    color: var(--white) !important;
    /* Force white text */
    display: inline-block;
    vertical-align: middle;
    line-height: 1.6;
    /* reset standard line height */
}

.nav-links .btn:hover {
    transform: translateY(-2px);
    /* Keep slight hover effect */
    color: var(--white) !important;
}

/* Enhancing Logo Design */
.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
    padding: 100px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    animation: slideUp 1s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    animation: fadeIn 1.5s ease-out;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
}

/* Features */
.features {
    padding: 80px 0;
    background-color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--light);
    padding: 30px;
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

/* Auth Forms */
.auth-container {
    max-width: 450px;
    margin: 80px auto;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

.btn-block {
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    display: block;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--gray);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Burger Menu */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    margin: 5px;
    transition: var(--transition);
}

/* Responsive */
/* Premium Landing Page Styles */
/* Merged into main :root above */
/* Modern Hero */
.hero-section {
    position: relative;
    padding: 120px 0;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(52, 168, 83, 0.1), transparent),
        radial-gradient(circle at bottom left, rgba(66, 133, 244, 0.1), transparent);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.text-gradient {
    background-image: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text .lead {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 40px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.hero-visual {
    position: relative;
}

.hero-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: rotate(-3deg);
    transition: transform 0.3s ease;
}

.hero-card:hover {
    transform: rotate(0) translateY(-10px);
}

.floating-badge {
    position: absolute;
    background: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    animation: float 3s ease-in-out infinite;
}

.badge-top {
    top: -20px;
    right: 20px;
    animation-delay: 0s;
}

.badge-bottom {
    bottom: 40px;
    left: -20px;
    animation-delay: 1.5s;
}

/* Stats Section */
.stats-section {
    background: white;
    padding: 60px 0;
    border-bottom: 1px solid #eee;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-item p {
    color: var(--gray);
    font-weight: 500;
}

/* Popular Courses */
.section-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.badge-soft {
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: inline-block;
}

.course-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.course-image {
    height: 200px;
    background: #eee;
    object-fit: cover;
    width: 100%;
}

.course-content {
    padding: 24px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--gray);
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.nav-active {
    transform: translateX(0%);
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .nav-links {
        position: absolute;
        right: 0;
        height: 92vh;
        top: 80px;
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -2px 5px 10px rgba(0, 0, 0, 0.1);
        padding-top: 50px;
    }

    .nav-links li {
        opacity: 0;
    }

    .burger {
        display: block;
        cursor: pointer;
        z-index: 1001;
        /* Ensure on top of nav-links */
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .nav-active {
        transform: translateX(0%);
    }
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-content {
    text-align: center;
    animation: bounce 2s infinite ease-in-out;
}

.loader-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loader-bar {
    width: 150px;
    height: 4px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: var(--gradient-primary);
    animation: loading 1.5s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(250%);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}