/* --- Imports & Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

@font-face {
    font-family: 'Sky-Bold';
    src: url('../fonts/sky-bold.ttf') format('truetype');
    font-weight: bold;
}

:root {
    --jjd-blue: #005eb8;
    --jjd-dark-blue: #003478;
    --jjd-orange: #FFA000;
    --bg-beige-pattern: #fdfbf7; /* Fond beige très clair */
}

body {
    font-family: 'Tajawal', sans-serif;
    /* Création du motif beige simple (petits points) */
    background-color: var(--bg-beige-pattern);
    background-image: radial-gradient(#e3decb 1.5px, transparent 1.5px);
    background-size: 20px 20px; /* Taille du motif */
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- 1. Top Header --- */
.top-header {
    background-color: white;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 20;
}

.header-logo img {
    max-height: 80px;
    width: auto;
}

.header-extras {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-header {
    background-color: #00aa4f;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- 2. Hero Banner --- */
.hero-banner {
    position: relative;
    width: 100%;
    height: 200px;
    background-image: url('../img/back.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 52, 120, 0.9);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.hero-title {
    font-family: 'Sky-Bold', 'Tajawal', sans-serif;
    color: var(--jjd-orange);
    font-size: 3.5rem;
    margin: 0;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* --- Signature Blanche Corrigée --- */
.signature-svg {
    width: 400px;
    height: auto;
    display: block;
    margin: -90px auto 0 auto;
}   

.signature-path {
    fill: none;
    stroke: #ffffff; /* Couleur BLANCHE demandée */
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    /* Valeur augmentée pour éviter que l'animation soit incomplète */
    stroke-dasharray: 2000; 
    stroke-dashoffset: 2000;
    animation: drawSignature 2.5s ease-out forwards 0.5s;
}

@keyframes drawSignature {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- 3. Intro Text --- */
.intro-text-section {
    text-align: center;
    padding: 40px 20px 20px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.intro-title {
    color: var(--jjd-dark-blue);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.intro-desc {
    color: var(--jjd-dark-blue);
    font-size: 1.1rem;
    line-height: 1.8;
    font-weight: 500;
}

/* --- 4. Formulaire --- */
/* Wrapper pour centrer le formulaire et pousser le footer en bas */
.main-content-wrapper {
    flex: 1;
}

.form-container {
    background: white;
    max-width: 900px;
    margin: 20px auto 50px auto;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.section-header {
    color: var(--jjd-blue);
    font-weight: bold;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 25px;
    margin-top: 20px;
}

.form-label { font-weight: 700; color: #555; margin-bottom: 8px; }
.form-control, .form-select {
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #fff;
}
.form-control:focus {
    border-color: var(--jjd-blue);
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.15);
}

.btn-submit {
    background-color: var(--jjd-blue);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px 40px;
    border-radius: 5px;
    border: none;
    transition: 0.3s;
    width: 100%;
    margin-top: 20px;
}
.btn-submit:hover { background-color: #004a94; }

/* --- 5. Footer Bleu --- */
/* --- Footer : Logo Centré et Texte à Droite --- */
.main-footer {
    background-color: #004a94;
    min-height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    /* En RTL, flex-start aligne les éléments à DROITE */
    justify-content: flex-start; 
    padding: 0 5%; /* Marge sur les côtés */
    position: relative; /* Indispensable pour centrer le logo */
    color: white;
    margin-top: auto;
}

.footer-text {
    font-size: 0.95rem;
    font-weight: 500;
    /* Le texte reste naturellement à droite grâce au RTL */
    z-index: 2; /* S'assure que le texte est cliquable/sélectionnable */
}

.footer-logo {
    height: 40px;
    width: auto;
    /* Technique pour centrer parfaitement un élément en absolu */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* --- Adaptation Mobile --- */
@media (max-width: 768px) {
    .main-footer {
        flex-direction: column; /* Empile les éléments */
        justify-content: center;
        padding: 20px 10px;
        gap: 10px;
        text-align: center;
    }
    
    .footer-logo {
        position: static; /* On désactive le positionnement absolu sur mobile */
        transform: none;
        margin-bottom: 5px;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .top-header { height: 80px; justify-content: center; }
    .header-extras { display: none; }
    .header-logo img { max-height: 60px; }
    
    .hero-banner { height: 120px; }
    .hero-title { font-size: 2.2rem; }
    .signature-svg { width: 200px;
         margin: -30px auto 0 auto;
        }
    
    .form-container { padding: 20px; margin: 15px; }
}