/* ==========================================
   VARIABLES CSS & RESET
   ========================================== */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}

.login-options {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    gap: 1rem;
}

.login-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.login-option i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.login-option.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.login-option.active i {
    color: white;
}

#loginForm {
    display: none;
}

#loginForm.show {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.password-field {
    position: relative;
}

#loginForm input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

.password-field input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 1.1rem;
    user-select: none;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.form-message {
    padding: 0.8rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.forgot-password-link {
    text-align: right;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.forgot-password-link a {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

#loginForm button {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#loginForm button:hover {
    background-color: #0052a3;
}

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a651;
    --accent-color: #ff6b35;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--primary-color), #0052a3);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.2);
}

.btn-login {
    background: var(--accent-color);
    padding: 0.5rem 1.5rem !important;
}

/* ==========================================
   LANGUAGE SWITCHER
   ========================================== */
.language-switcher {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem;
    border-radius: 8px;
}

.lang-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    transition: var(--transition);
    opacity: 0.7;
    color: white;
    letter-spacing: 0.5px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: translateY(-1px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.95);
    opacity: 1;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

/* ==========================================
   RTL SUPPORT FOR ARABIC
   ========================================== */
[dir="rtl"] .header .container {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo-section {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-buttons {
    flex-direction: row-reverse;
}

[dir="rtl"] .stat-card,
[dir="rtl"] .feature-card,
[dir="rtl"] .mission-card {
    text-align: right;
}

[dir="rtl"] .btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .language-switcher {
    flex-direction: row-reverse;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    position: relative;
    height: 500px;
    background: linear-gradient(135deg, #0066cc 0%, #00a651 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%23ffffff"></path></svg>') bottom;
    background-size: cover;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* ==========================================
   STATISTICS SECTION
   ========================================== */
.statistics {
    padding: 3rem 0;
    background: var(--light-color);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-color);
    font-size: 1rem;
}

/* ==========================================
   PRESENTATION SECTION
   ========================================== */
.presentation {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
}

.presentation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
}

.presentation-content .lead {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.feature-list {
    list-style: none;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-list i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.presentation-image img {
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.legal-references {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
}

.legal-references h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.legal-references ul {
    list-style: none;
}

.legal-references li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.legal-references li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* ==========================================
   MISSIONS SECTION
   ========================================== */
.missions {
    padding: 4rem 0;
    background: var(--light-color);
}

.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.mission-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.mission-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.mission-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.mission-icon i {
    font-size: 2rem;
    color: white;
}

.mission-card h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mission-card ul {
    list-style: none;
}

.mission-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.mission-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.objectifs-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.objectifs-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.objectifs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.objectif-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.objectif-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* ==========================================
   HOW IT WORKS
   ========================================== */
.how-it-works {
    padding: 4rem 0;
}

.process-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.process-step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ==========================================
   FEATURES
   ========================================== */
.features {
    padding: 4rem 0;
    background: var(--light-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ==========================================
   CONTACT
   ========================================== */
.contact {
    padding: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-info {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 10px;
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-info i {
    color: var(--primary-color);
    width: 20px;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.contact-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   MODAL
   ========================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.login-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.login-option {
    padding: 2rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.login-option:hover,
.login-option.active {
    border-color: var(--primary-color);
    background: var(--light-color);
}

.login-option i {
    font-size: 2rem;
    color: var(--primary-color);
}

#loginForm input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--primary-color);
        padding: 1rem;
    }

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

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .presentation-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .login-options {
        grid-template-columns: 1fr;
    }

    .process-timeline {
        grid-template-columns: 1fr;
    }

    /* Modal responsive pour mobile */
    .modal-content {
        padding: 1.5rem;
        width: 95%;
        max-height: 85vh;
    }

    .modal-close {
        font-size: 1.5rem;
    }

    #loginForm .btn-primary {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .header-text h1 {
        font-size: 1.2rem;
    }

    .header-text p {
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    /* Modal ultra-petit écran */
    .modal-content {
        padding: 1rem;
        max-height: 80vh;
    }

    .login-options .login-option {
        padding: 1.5rem 1rem;
    }

    #loginForm .form-group {
        margin-bottom: 1rem;
    }

    #loginForm .btn-primary {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
}