:root {
  --primary: #0a3d62;
  --accent: #2ecc71;
  --accent-dark: #27ae60;
  --bg: #f5f7fa;
  --white: #ffffff;
  --text: #333;
  --muted: #888;
  --border: #eee;
  --shadow: 0 5px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 15px 40px rgba(0,0,0,0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; }

/* HEADER */
header {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
header h1 a { color: var(--accent); font-family: 'Syne', sans-serif; font-size: 1.8rem; text-decoration: none; }
nav a { color: white; margin: 0 1rem; text-decoration: none; font-weight: 500; transition: color 0.3s; }
nav a:hover { color: var(--accent); }
.auth-zone { display: flex; align-items: center; gap: 0.8rem; }
.btn-login {
  padding: 0.5rem 1.2rem; border-radius: 20px;
  border: 2px solid var(--accent); background: transparent;
  color: var(--accent); cursor: pointer; font-weight: 600;
  transition: all 0.3s; font-size: 0.95rem; text-decoration: none;
  display: inline-block;
}
.btn-login:hover { background: var(--accent); color: white; }
.btn-register {
  padding: 0.5rem 1.2rem; border-radius: 20px;
  background: var(--accent); color: white;
  border: none; cursor: pointer; font-weight: 600; font-size: 0.95rem;
  transition: background 0.3s; text-decoration: none; display: inline-block;
}
.btn-register:hover { background: var(--accent-dark); }

/* USER MENU */
.user-menu { position: relative; display: flex; align-items: center; gap: 0.6rem; cursor: pointer; padding: 0.3rem 0.6rem; border-radius: 8px; transition: background 0.2s; }
.user-menu:hover { background: rgba(255,255,255,0.1); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.9rem; }
.dropdown { position: absolute; top: 120%; right: 0; background: white; color: #333; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); min-width: 200px; display: none; overflow: hidden; z-index: 100; }
.dropdown.active { display: block; }
.dropdown a, .dropdown button { display: block; width: 100%; padding: 0.8rem 1rem; text-align: left; background: none; border: none; color: #333; text-decoration: none; font-size: 0.95rem; cursor: pointer; transition: background 0.2s; font-family: inherit; }
.dropdown a:hover, .dropdown button:hover { background: #f0f0f0; }

/* HERO */
.hero {
  background: linear-gradient(rgba(10,61,98,0.85), rgba(10,61,98,0.85)),
    url('https://images.unsplash.com/photo-1548013146-72479768bada?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
  background-size: cover; background-position: center;
  color: white; padding: 5rem 2rem; text-align: center;
}
.hero h2 { font-family: 'Syne', sans-serif; font-size: 3rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; }
.search-bar { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; max-width: 800px; margin: 2rem auto 0; }
.search-bar input, .search-bar select { padding: 1rem; border-radius: 8px; border: none; font-size: 1rem; flex: 1; min-width: 200px; font-family: 'DM Sans', sans-serif; }
.search-bar button { background: var(--accent); border: none; padding: 1rem 2rem; color: white; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: bold; transition: background 0.3s; }
.search-bar button:hover { background: var(--accent-dark); }

/* CATEGORIES */
.categories { display: flex; justify-content: center; gap: 2rem; background: white; padding: 2rem; margin: -2rem auto 0; border-radius: 20px; width: 95%; box-shadow: var(--shadow); flex-wrap: wrap; }
.category { text-align: center; cursor: pointer; padding: 1rem; transition: transform 0.3s; font-weight: 500; text-decoration: none; color: var(--text); }
.category:hover { transform: translateY(-5px); color: var(--accent); }

/* MAIN CONTAINER */
.container { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; padding: 4rem 2rem; max-width: 1400px; margin: 0 auto; }
.container.single { grid-template-columns: 1fr; max-width: 1100px; }

/* JOB CARDS */
.jobs { display: grid; gap: 1.5rem; }
.job-card { background: white; padding: 1.5rem; border-radius: 15px; box-shadow: var(--shadow); transition: all 0.3s; border-left: 5px solid var(--accent); }
.job-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.job-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.job-title { font-size: 1.3rem; font-weight: bold; color: var(--primary); }
.job-company { color: #666; font-weight: 500; }
.job-meta { display: flex; gap: 1rem; font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; flex-wrap: wrap; }
.job-desc { color: #555; margin-bottom: 1rem; }
.job-actions { display: flex; gap: 1rem; }
.apply-btn { background: var(--accent); color: white; border: none; padding: 0.7rem 1.5rem; border-radius: 25px; cursor: pointer; font-weight: 500; transition: background 0.3s; text-decoration: none; display: inline-block; font-family: inherit; font-size: 1rem; }
.apply-btn:hover { background: var(--accent-dark); }
.apply-btn.disabled { background: #aaa; cursor: not-allowed; }
.contract-tag { background:#e8f5e9; color:#27ae60; padding:0.3rem 0.8rem; border-radius:20px; font-size:0.85rem; font-weight:600; }

/* SIDEBAR */
.sidebar { background: white; padding: 2rem; border-radius: 15px; box-shadow: var(--shadow); position: sticky; top: 80px; height: fit-content; }
.sidebar h3 { color: var(--primary); margin-bottom: 1rem; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.filter-group select { width: 100%; padding: 0.8rem; border: 2px solid var(--border); border-radius: 8px; font-family: 'DM Sans', sans-serif; }
.popular-jobs { margin-top: 2rem; }
.popular-item { padding: 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: color 0.2s; }
.popular-item:hover { color: var(--accent); }

/* PROFILE / CV */
.profile-card { background: white; border-radius: 15px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 2rem; }
.profile-banner { height: 180px; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.profile-info { padding: 0 2rem 2rem; }
.profile-avatar { width: 120px; height: 120px; border-radius: 50%; background: var(--primary); color: white; font-size: 2.5rem; font-weight: bold; display: flex; align-items: center; justify-content: center; border: 5px solid white; margin-top: -60px; box-shadow: 0 5px 15px rgba(0,0,0,0.15); }
.profile-name { font-family: 'Syne', sans-serif; font-size: 1.6rem; color: var(--primary); margin-top: 1rem; }
.profile-headline { color: #555; font-size: 1.05rem; margin-top: 0.3rem; }
.profile-location { color: var(--muted); font-size: 0.95rem; margin-top: 0.3rem; }
.profile-actions { display: flex; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.btn-edit { background: var(--primary); color: white; border: none; padding: 0.6rem 1.4rem; border-radius: 20px; cursor: pointer; font-weight: 600; transition: background 0.3s; text-decoration: none; display: inline-block; }
.btn-edit:hover { background: #08314d; }
.btn-view-pub { background: white; color: var(--primary); border: 2px solid var(--primary); padding: 0.6rem 1.4rem; border-radius: 20px; cursor: pointer; font-weight: 600; transition: background 0.3s; text-decoration: none; display: inline-block; }
.btn-view-pub:hover { background: var(--bg); }

.cv-section { background: white; border-radius: 15px; box-shadow: var(--shadow); padding: 2rem; margin-bottom: 1.5rem; }
.cv-section h3 { color: var(--primary); font-family: 'Syne', sans-serif; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--bg); display:flex; justify-content:space-between; align-items:center; }
.cv-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cv-item:last-child { border-bottom: none; }
.cv-item h4 { color: var(--primary); font-size: 1.1rem; margin-bottom: 0.3rem; }
.cv-item .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.cv-item .desc { color: #555; }
.skill-tag { display: inline-block; background: var(--bg); color: var(--primary); padding: 0.4rem 0.9rem; border-radius: 20px; margin: 0.2rem; font-size: 0.9rem; font-weight: 500; }
.skill-tag .level { color: var(--muted); font-size: 0.8rem; margin-left: 0.4rem; }

/* FORMS */
.form-card { background:white; padding:2rem; border-radius:15px; box-shadow:var(--shadow); max-width:500px; margin: 3rem auto; }
.form-card.wide { max-width: 750px; }
.form-card h2 { color:var(--primary); font-family:'Syne', sans-serif; margin-bottom:1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: #444; font-size: 0.95rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.85rem; border: 2px solid #ddd; border-radius: 8px; font-size: 1rem;
  font-family: 'DM Sans', sans-serif; transition: border-color 0.2s;
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.btn-submit { background: var(--accent); color: white; border: none; padding: 0.8rem 1.8rem; border-radius: 25px; cursor: pointer; font-weight: 600; font-size: 1rem; transition: background 0.3s; font-family: inherit; }
.btn-submit:hover { background: var(--accent-dark); }
.btn-cancel { background: #eee; color: #555; border: none; padding: 0.8rem 1.6rem; border-radius: 25px; cursor: pointer; font-weight: 600; font-size: 1rem; transition: background 0.3s; text-decoration:none; display:inline-block; font-family: inherit; }
.btn-cancel:hover { background: #ddd; }
.btn-danger { background: #e74c3c; color: white; border: none; padding: 0.4rem 0.9rem; border-radius: 20px; cursor: pointer; font-weight: 500; font-size: 0.85rem; font-family: inherit; }
.btn-danger:hover { background: #c0392b; }
.btn-add { background: var(--primary); color: white; border: none; padding: 0.5rem 1rem; border-radius: 20px; cursor: pointer; font-weight: 500; font-size: 0.85rem; font-family: inherit; }
.btn-add:hover { background: #08314d; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.alert { padding: 0.9rem 1.2rem; border-radius: 8px; margin-bottom: 1.2rem; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

.status-badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.status-envoyee { background:#fef3cd; color:#856404; }
.status-vue { background:#d1ecf1; color:#0c5460; }
.status-acceptee { background:#d4edda; color:#155724; }
.status-refusee { background:#f8d7da; color:#721c24; }

/* FOOTER */
footer { text-align: center; padding: 3rem 2rem; background: var(--primary); color: white; margin-top: 4rem; }
footer p { margin-bottom: 0.5rem; opacity: 0.85; }

@media (max-width: 768px) {
  header { flex-direction: column; }
  .hero h2 { font-size: 2rem; }
  .search-bar { flex-direction: column; }
  .categories { flex-direction: column; align-items: center; }
  .container { grid-template-columns: 1fr; padding: 2rem 1rem; }
  .two-col { grid-template-columns: 1fr; }
}

/* ============= PAGE HERO (entreprises / formations) ============= */
.page-hero {
  background: linear-gradient(135deg, var(--primary), #1e6091);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
}
.page-hero h2 { font-family: 'Syne', sans-serif; font-size: 2.4rem; margin-bottom: 0.5rem; }
.page-hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 1.5rem; }
.page-hero .search-bar { margin-top: 1.5rem; }

/* ============= ENTREPRISES — GRID + CARDS ============= */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.company-card {
  display: block;
  background: white;
  border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  border: 1px solid var(--border);
}
.company-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.company-cover {
  height: 100px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.company-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  background: white;
  margin-bottom: -40px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.company-body {
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}
.company-body h3 { color: var(--primary); margin-bottom: 0.5rem; font-family: 'Syne', sans-serif; }
.company-loc { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0; }
.company-desc { color: #555; font-size: 0.92rem; margin-top: 0.7rem; line-height: 1.5; }
.company-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.badge-jobs {
  background: #e8f5e9; color: #27ae60;
  padding: 0.3rem 0.7rem; border-radius: 15px; font-size: 0.85rem; font-weight: 600;
}
.company-link { color: var(--accent); font-weight: 600; }

/* ============= ENTREPRISE — DÉTAIL ============= */
.company-detail-card { background: white; border-radius: 15px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.5rem; }
.company-detail-banner { height: 180px; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.company-detail-header { display: flex; gap: 2rem; padding: 0 2rem 2rem; align-items: flex-end; flex-wrap: wrap; }
.company-detail-logo {
  width: 140px; height: 140px; border-radius: 20px; border: 5px solid white;
  background: white; margin-top: -70px; object-fit: cover;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}
.company-detail-info { flex: 1; min-width: 250px; padding-top: 1rem; }
.company-detail-info h2 {
  font-family: 'Syne', sans-serif; color: var(--primary);
  font-size: 1.8rem; margin-bottom: 0.5rem;
}
.company-meta { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0.8rem; }
.contact-grid div { padding: 0.6rem 0; }
.contact-grid a { color: var(--accent); text-decoration: none; font-weight: 500; }

.ad-banner {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}
.ad-banner h3 { color: white; }

/* ============= VIDEO RESPONSIVE ============= */
.video-wrapper {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 12px; background: #000;
}
.video-wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* ============= FORMATIONS — GRID + CARDS ============= */
.formation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.formation-card {
  background: white; border-radius: 15px; overflow: hidden;
  box-shadow: var(--shadow); transition: all 0.3s;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.formation-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.formation-thumb {
  height: 160px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}
.formation-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.formation-thumb .play-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: white; text-shadow: 0 0 20px rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.2); transition: background 0.3s;
}
.formation-card:hover .play-icon { background: rgba(0,0,0,0.4); }
.formation-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.formation-cat {
  display: inline-block; background: var(--bg); color: var(--primary);
  padding: 0.25rem 0.7rem; border-radius: 12px; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.formation-body h3 {
  color: var(--primary); margin-top: 0.6rem; font-family: 'Syne', sans-serif;
  font-size: 1.1rem; line-height: 1.3;
}
.formation-provider { color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; }
.formation-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; }
.formation-desc { color: #555; font-size: 0.9rem; margin-top: 0.7rem; line-height: 1.5; flex: 1; }

/* ============= ADMIN BACK-OFFICE ============= */
.admin-body { display: flex; min-height: 100vh; background: var(--bg); margin: 0; }
.admin-sidebar {
  width: 240px; background: linear-gradient(180deg, #0a3d62, #082a44);
  color: white; padding: 1.5rem 1rem; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-logo { font-family: 'Syne', sans-serif; font-size: 1.4rem; margin-bottom: 0.4rem; }
.admin-logo a { color: var(--accent); text-decoration: none; }
.admin-tag { display: inline-block; background: var(--accent); color: white; font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 10px; vertical-align: middle; }
.admin-nav { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 2rem; flex: 1; }
.admin-nav a { color: white; text-decoration: none; padding: 0.7rem 0.9rem; border-radius: 8px; font-size: 0.95rem; transition: background 0.2s; }
.admin-nav a:hover { background: rgba(255,255,255,0.1); }
.admin-user { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem; background: rgba(0,0,0,0.2); border-radius: 10px; }
.admin-main { flex: 1; padding: 2rem; overflow-x: auto; }
.admin-page-title { font-family: 'Syne', sans-serif; color: var(--primary); margin-bottom: 1.5rem; font-size: 1.8rem; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: 15px; box-shadow: var(--shadow); text-align: center; border-left: 5px solid var(--accent); }
.stat-num { font-size: 2.5rem; font-weight: 800; color: var(--primary); font-family: 'Syne', sans-serif; }
.stat-label { color: var(--muted); margin-top: 0.3rem; }

.admin-card { background: white; border-radius: 15px; box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-card h2 { color: var(--primary); font-family: 'Syne', sans-serif; margin-bottom: 0.5rem; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.admin-table th { background: var(--bg); padding: 0.8rem; text-align: left; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--border); }
.admin-table td { padding: 0.9rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover { background: rgba(0,0,0,0.02); }
.admin-table .btn-add, .admin-table .btn-danger { padding: 0.35rem 0.6rem; font-size: 0.85rem; margin: 0 0.1rem; }

@media (max-width: 768px) {
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-main { padding: 1rem; }
  .admin-table { font-size: 0.85rem; }
}

/* ============= MESSAGERIE / FIL DE DISCUSSION ============= */
.message-thread { display: flex; flex-direction: column; gap: 0.8rem; max-height: 500px; overflow-y: auto; padding: 0.5rem; }
.message {
  background: white; padding: 0.9rem 1rem; border-radius: 12px;
  border: 1px solid var(--border); max-width: 85%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.message-me {
  align-self: flex-end; background: linear-gradient(135deg, var(--primary), #1e6091);
  color: white; border: none;
}
.message-me .message-meta { color: rgba(255,255,255,0.85); }
.message-other {
  align-self: flex-start;
  background: var(--bg);
  border-left: 4px solid var(--accent);
}
.message-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.message-body { line-height: 1.5; word-wrap: break-word; }

/* ============= SPONSORING / PUBLICITÉ ============= */
.job-sponsored {
  position: relative;
  background: linear-gradient(135deg, #fff8e1, #ffffff);
  border-left: 5px solid #f39c12 !important;
  box-shadow: 0 5px 25px rgba(243,156,18,0.15);
}
.sponsor-badge {
  position: absolute; top: 1rem; right: 1rem;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white; padding: 0.3rem 0.8rem; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(243,156,18,0.4);
}

/* Bannières */
.ad-banner-wrap {
  display: block; max-width: 1200px; margin: 1.5rem auto;
  background: white; border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); position: relative;
}
.ad-banner-wrap a { display: block; }
.ad-banner-wrap img { display: block; width: 100%; height: auto; }
.ad-tag {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(0,0,0,0.6); color: white;
  padding: 0.15rem 0.5rem; border-radius: 4px;
  font-size: 0.7rem; letter-spacing: 0.5px;
}
.sidebar .ad-banner-wrap { margin: 0 0 1.5rem; }
