:root {
    --bg-color: #f3f4f6;
    --text-main: #111827;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --primary: #2563eb;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 60px 20px 80px 20px; 
    overflow-x: hidden; 
}

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

/* =========================================
   EN-TÊTE
   ========================================= */
.header {
    text-align: center;
    margin-bottom: 50px;
}
.header-logo {
    max-height: 80px;
    width: auto;
    margin-bottom: 24px;
    object-fit: contain;
}
.header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 0;
}
.header p {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* =========================================
   FILTRES & RECHERCHE
   ========================================= */
.filters-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.filter-group.search-group {
    flex: 2;
    min-width: 100%; 
}

@media (min-width: 768px) {
    .filter-group.search-group {
        min-width: 300px;
    }
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select, .filter-group input {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #f9fafb;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.filter-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%236b7280' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.filter-group select:focus, .filter-group input:focus {
    border-color: var(--primary);
    background-color: #ffffff;
}

.custom-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.custom-suggestions li {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f9fafb;
}

.custom-suggestions li:last-child { border-bottom: none; }
.custom-suggestions li:hover { background-color: #f3f4f6; color: var(--primary); }

/* =========================================
   AFFICHAGE (GRILLE / CARTE)
   ========================================= */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-counter {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.view-toggles {
    display: flex;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-btn svg { width: 16px; height: 16px; }

#map-container {
    width: 100%;
    height: 600px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: none;
    z-index: 10;
}

/* =========================================
   CARTES D'OFFRES
   ========================================= */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 24px;
}

.job-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.job-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6); opacity: 0; transition: opacity 0.3s ease;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.1);
}
.job-card:hover::before { opacity: 1; }

.badge-container { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.badge {
    display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; 
}
.badge-cdi { background: #dcfce7; color: #166534; }
.badge-cdd { background: #fef08a; color: #854d0e; }
.badge-alt { background: #f3e8ff; color: #6b21a8; }
.badge-def { background: #e0e7ff; color: #3730a3; }
.badge-time { background: #f3f4f6; color: #4b5563; }

.job-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 16px 0; line-height: 1.3; color: var(--text-main); }
.job-details-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 20px; }
.job-detail { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); }
.job-detail svg { width: 16px; height: 16px; opacity: 0.6; flex-shrink: 0; }
.job-detail-highlight { color: var(--text-main) !important; font-weight: 600; }

.card-benefits-container { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; margin-bottom: 20px; }
.card-benefit-badge { font-size: 0.75rem; font-weight: 600; background: #f1f5f9; color: #475569; padding: 6px 12px; border-radius: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }

.spacer { flex-grow: 1; }

.card-actions { display: flex; gap: 12px; margin-top: auto; align-items: stretch; }
.job-button {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 20px;
    background-color: var(--text-main); color: #ffffff; border-radius: 10px;
    font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: all 0.2s; flex-grow: 1; 
    border: none; cursor: pointer;
}
.job-button:hover { background-color: var(--primary); }
.job-button svg { transition: transform 0.2s; }
.job-button:hover svg { transform: translateX(4px); }

.share-button {
    display: flex; align-items: center; justify-content: center; width: 48px;
    background-color: #ffffff; color: var(--text-muted); border: 1px solid var(--border-color);
    border-radius: 10px; cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.share-button:hover { color: var(--primary); border-color: var(--primary); background-color: #eff6ff; }
.share-button svg { width: 20px; height: 20px; }

.no-results {
    grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--text-muted);
    font-size: 1.1rem; background: var(--card-bg); border-radius: 12px; border: 1px dashed var(--border-color);
}

/* =========================================
   ANIMATION SKELETON (Chargement)
   ========================================= */
@keyframes shimmer { 0% { background-position: -800px 0; } 100% { background-position: 800px 0; } }
.skeleton {
    background-color: #e5e7eb; background-image: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 800px 100%; animation: shimmer 1.5s infinite linear;
}
.skeleton-card { border-color: transparent !important; box-shadow: none !important; }
.skeleton-badge { height: 24px; border-radius: 6px; }
.skeleton-title { height: 24px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-text { height: 16px; border-radius: 4px; }
.skeleton-button { height: 48px; border-radius: 10px; }

/* =========================================
   OFF-CANVAS (Volet Candidature)
   ========================================= */
.offcanvas-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.6); backdrop-filter: blur(4px);
    z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.offcanvas-overlay.active { opacity: 1; pointer-events: auto; }

.offcanvas {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 100%; max-width: 550px; background: #ffffff;
    z-index: 1000; box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
}
.offcanvas.active { transform: translateX(0); }

.offcanvas-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); background: #f9fafb; }
.offcanvas-header h2 { margin: 0; font-size: 1.2rem; color: var(--text-main); }
.offcanvas-close { background: transparent; border: none; font-size: 2rem; line-height: 1; color: var(--text-muted); cursor: pointer; transition: color 0.2s; padding: 0; }
.offcanvas-close:hover { color: var(--danger); }

.offcanvas-body { flex-grow: 1; overflow-y: auto; padding: 24px; }

.oc-section-title { font-size: 1.1rem; margin: 25px 0 15px 0; color: var(--text-main); border-bottom: 2px solid var(--primary); display: inline-block; padding-bottom: 4px; }
.oc-extra-box { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; margin-top: 15px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.oc-info-line { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; color: var(--text-main); }
.oc-info-line svg { width: 18px; height: 18px; color: var(--primary); }
.oc-benefits-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; margin-bottom: 20px; }
.oc-benefit-badge { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }

.oc-description {
    font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); background: #f9fafb; padding: 15px;
    border-radius: 8px; margin-bottom: 20px; word-wrap: break-word; word-break: break-word; overflow-wrap: break-word; overflow-x: auto; 
}
.oc-description * { max-width: 100% !important; }
.oc-description ul, .oc-description ol { padding-left: 20px; margin-left: 0; }

/* Actions externes */
.oc-external-action { margin-top: 10px; }
.oc-external-action p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; }
.oc-external-action a { display: block; text-align: center; text-decoration: none; }

/* Formulaire */
.apply-form .form-group { margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px; }
.apply-form label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.apply-form input, .apply-form textarea, .apply-form select { padding: 12px; border-radius: 8px; border: 1px solid var(--border-color); font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.apply-form input:focus, .apply-form textarea:focus, .apply-form select:focus { border-color: var(--primary); }

.apply-submit-btn { display: inline-block; width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 10px; transition: background 0.2s; text-align: center; text-decoration: none; }
.apply-submit-btn:hover { background: #1d4ed8; color: white; }

/* Conteneurs et labels RGPD */
.rgpd-container { flex-direction: row !important; align-items: flex-start !important; gap: 10px; margin-top: 10px; }
.rgpd-checkbox { width: auto !important; margin-top: 4px; }
.rgpd-label { text-transform: none !important; color: var(--text-muted) !important; font-size: 0.85rem !important; font-weight: 400 !important; line-height: 1.4 !important; }
.rgpd-label a { color: var(--primary); text-decoration: underline; }

/* Sélecteurs de postes en badges (Formulaire Spontané) */
.checkbox-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.checkbox-badges label { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 8px 14px; border-radius: 20px; cursor: pointer; user-select: none; transition: 0.2s; font-size: 0.85rem; color: var(--text-main); font-weight: 500; }
.checkbox-badges input[type="checkbox"] { display: none; }
.checkbox-badges input[type="checkbox"]:checked + label { background: var(--primary); color: white; border-color: var(--primary); }
.custom-job-container { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.custom-job-input { flex: 1; margin: 0 !important; }
.btn-add-badge { padding: 10px 15px; border-radius: 8px; border: 1px solid var(--border-color); background: #f1f5f9; color: var(--text-main); font-weight: 600; cursor: pointer; white-space: nowrap; transition: 0.2s; }
.btn-add-badge:hover { background: #e2e8f0; }

/* =========================================
   POPUP MAP LEAFLET
   ========================================= */
.leaflet-popup-content-wrapper { border-radius: 12px; padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; font-family: 'Inter', sans-serif; width: 260px !important; }
.map-popup-header { background: #f9fafb; padding: 12px 15px; border-bottom: 1px solid var(--border-color); }
.map-popup-location { font-size: 0.9rem; font-weight: 700; color: var(--text-main); margin: 0; text-transform: uppercase; }
.map-popup-list { max-height: 250px; overflow-y: auto; padding: 0; margin: 0; list-style: none; overflow-x: hidden; }
.map-popup-item { padding: 15px; border-bottom: 1px solid var(--border-color); }
.map-popup-title { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin: 0 0 4px 0; }
.map-popup-company { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 10px 0; }
.map-popup-btn { display: block; text-align: center; background: var(--text-main); color: white !important; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; transition: background 0.2s; }
.map-popup-btn:hover { background: var(--primary); }

/* =========================================
   FOOTER & BOUTON FLOTTANT
   ========================================= */
.site-footer {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px);
    border-top: 1px solid var(--border-color); padding: 12px 20px;
    text-align: center; font-size: 0.85rem; color: var(--text-muted);
    z-index: 900; box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}
.site-footer a { color: var(--text-muted); text-decoration: underline; font-weight: 600; transition: color 0.2s; margin-left: 5px; }
.site-footer a:hover { color: var(--primary); }

.btn-spontaneous {
    position: fixed; bottom: 70px; right: 20px;
    background-color: var(--text-main); color: white;
    padding: 14px 24px; border-radius: 50px; font-weight: 600; font-size: 0.95rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border: none; cursor: pointer;
    z-index: 850; display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.btn-spontaneous:hover { background-color: var(--primary); transform: translateY(-3px); }
.btn-spontaneous svg { width: 20px; height: 20px; }

@media (max-width: 768px) {
    .btn-spontaneous { bottom: 65px; padding: 12px 20px; font-size: 0.9rem; }
}

/* =========================================
   ANIMATION DE SUCCÈS (SOBRE ET ÉLÉGANTE)
   ========================================= */
.success-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-message {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    padding: 0 20px;
}

.success-message svg {
    margin-bottom: 20px;
}

.success-message-sub {
    font-size: 1.2rem;
    font-weight: 500;
    color: #9ca3af;
    display: block;
    margin-top: 15px;
}

.success-overlay.active .success-message {
    transform: translateY(0) scale(1);
    opacity: 1;
}

@media (max-width: 768px) {
    .success-message { font-size: 1.5rem; }
    .success-message-sub { font-size: 1rem !important; }
}

/* =========================================
   PAGE POLITIQUE RH (LEGAL)
   ========================================= */
.legal-page { padding: 40px 20px; line-height: 1.6; }
.legal-page .container { max-width: 800px; margin: 0 auto; }
.btn-back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; font-weight: 600; margin-bottom: 20px; transition: color 0.2s; }
.btn-back:hover { color: var(--primary); }
.legal-card { background: var(--card-bg); padding: 40px; border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); border: 1px solid var(--border-color); }
.legal-card h1 { font-size: 2rem; font-weight: 800; margin-top: 0; margin-bottom: 10px; letter-spacing: -0.025em; }
.last-updated { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 40px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.legal-card h2 { font-size: 1.25rem; font-weight: 700; color: #1f2937; margin-top: 35px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.number-badge { background: #e0e7ff; color: var(--primary); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.9rem; }
.legal-card p, .legal-card li { color: var(--text-muted); font-size: 1rem; margin-bottom: 12px; }
.legal-card ul { padding-left: 20px; margin-bottom: 20px; }
.legal-card strong { color: var(--text-main); }
.contact-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 20px; margin-top: 30px; }
.contact-box-title { display: block; margin-bottom: 10px; font-size: 1.1rem; color: #1e3a8a; }
.contact-box-text { margin-bottom: 0; }
.contact-box-link { color: var(--primary); }
.legal-footer-note { margin-top: 20px; font-size: 0.9rem; }

@media (max-width: 640px) {
    .legal-card { padding: 25px; }
    .legal-card h1 { font-size: 1.5rem; }
}