:root {
    --primary-color: #0d6efd; /* Brighter Bootstrap blue, typically used by btn-primary */
    --secondary-color: #6c757d; /* Bootstrap secondary gray */
    --accent-color: #ffc107; /* Bootstrap yellow for accents, like warning/info */
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --heading-color: #212529;
    --text-color: #343a40;
    --border-color: #dee2e6;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* Customizing Bootstrap variables and general elements */
.navbar-brand .text-primary {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: #0a58ca; /* Darker shade of primary */
    border-color: #0a58ca;
    transform: translateY(-2px);
}

.btn-outline-light, .btn-outline-dark, .btn-outline-primary, .btn-outline-secondary, .btn-outline-info, .btn-outline-success, .btn-outline-warning {
    transition: all 0.3s ease;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-success {
    background-color: #198754 !important; /* Bootstrap success green */
}

.bg-info {
    background-color: #0dcaf0 !important; /* Bootstrap info cyan */
}

.bg-warning {
    background-color: var(--accent-color) !important;
}

.bg-dark {
    background-color: var(--dark-bg) !important;
}

/* Hero Section */
.hero-section {
    background: url('hero_bg.png') no-repeat center center;
    background-size: cover;
    min-height: 70vh; /* Make it a bit shorter */
    position: relative;
    padding: 100px 0;
    display: flex; /* Use flex to center content vertically */
    align-items: center;
    color: white; /* Ensure text is white */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65); /* Slightly darker overlay */
    z-index: 1;
}

.hero-section > .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 3.5rem; /* Larger heading */
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section p.lead {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

/* Section headings with underline effect */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--heading-color);
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px; /* Slightly wider */
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Carousel controls */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1); /* Make icons visible on dark background */
}

.carousel-control-prev, .carousel-control-next {
    width: 5%; /* Smaller control area */
}

/* Cards improvements */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Image hover effect */
.hover-grow {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md) !important;
}

/* Footer styles */
footer a {
    color: rgba(255, 255, 255, 0.75); /* Lighter white for links */
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

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

/* Dashboard Specific Styles (Tailwind equivalent classes should be preferred where possible) */
.sidebar {
    position: fixed;
    top: 4rem;
    bottom: 0;
    left: 0;
    z-index: 40;
    padding: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid theme('colors.gray.200');
}

.sidebar .nav-link {
    font-weight: 500;
    color: theme('colors.gray.700');
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    color: theme('colors.csed-green');
    background-color: theme('colors.gray.200');
    border-radius: 0.25rem;
}

Overrides for specific dashboard sidebars to match their header color
header.bg-csed-dark + .flex .sidebar .nav-link.active,
header.bg-csed-dark + .flex .sidebar .nav-link:hover {
    color: theme('colors.primary-light');
    background-color: theme('colors.gray.200');
}

header.bg-csed-secondary + .flex .sidebar .nav-link.active,
header.bg-csed-secondary + .flex .sidebar .nav-link:hover {
    color: theme('colors.csed-secondary');
    background-color: theme('colors.gray.200');
}

header.bg-primary-light + .flex .sidebar .nav-link.active,
header.bg-primary-light + .flex .sidebar .nav-link:hover {
    color: theme('colors.primary-light');
    background-color: theme('colors.gray.200');
}

header.bg-csed-green + .flex .sidebar .nav-link.active,
header.bg-csed-green + .flex .sidebar .nav-link:hover {
    color: theme('colors.csed-green');
    background-color: theme('colors.gray.200');
} */

/* Adjust main content for fixed sidebar */
.md\:ml-64 { /* Existing Tailwind class */
    margin-left: 16rem; /* Ensures content flows next to sidebar */
}

/* Toast Messages */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1070; /* Above Bootstrap modals */
}

.toast {
    max-width: 350px;
    overflow: hidden;
    font-size: .875rem;
    background-color: rgba(255,255,255,.85);
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.1);
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    border-radius: .25rem;
    animation: fadein 0.5s forwards;
}

.toast.show {
    animation: fadein 0.5s forwards;
}

.toast.hide {
    animation: fadeout 0.5s forwards;
}

.toast-header {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    color: #6c757d;
    background-color: rgba(255,255,255,.85);
    background-clip: padding-box;
    border-bottom: 1px solid rgba(0,0,0,.05);
}

.toast-body {
    padding: .75rem;
    word-wrap: break-word;
}

/* Toast types */
.toast.toast-success .toast-header {
    color: #198754;
}
.toast.toast-danger .toast-header {
    color: #dc3545;
}
.toast.toast-warning .toast-header {
    color: #ffc107;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeout {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* The sidebar for small screens should be handled by Tailwind's hidden/block and mobile menu logic, not fixed positioning */
}

/* Custom styles to integrate with Tailwind and user's specific requests */
* { font-family: 'Inter', sans-serif; }

.gradient-bg {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
}

.glass-effect {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

.hero-animation {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Specific styling for section headings, keeping the ::after effect */
h2.relative.pb-4::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px; /* Slightly wider */
    height: 4px;
    background-color: var(--tw-colors-primary-light); /* Use Tailwind color variable */
    border-radius: 2px;
}

/* Registration Form Step Indicator */
.progress-indicator {
    position: relative;
}
.progress-indicator .step {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}
.progress-indicator .step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(100% + 15px); /* Center line between circles */
    width: 30px; /* Adjust based on margin */
    height: 2px;
    background-color: #e9ecef; /* Default line color */
    transform: translateY(-50%);
    z-index: 0;
}
.progress-indicator .step.completed + .step::after {
    background-color: #10b981; /* Green color for completed line */
}

/* Toast Messages (Tailwind-compatible styling) */
@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutSlideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.toast-message {
    animation: fadeInSlideUp 0.5s ease-out forwards;
}

.toast-message.hide {
    animation: fadeOutSlideDown 0.5s ease-in forwards;
}

/* ----------------------
   RESET & BASE
-------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #1f2937; /* gris foncé lisible */
  background-color: #f9fafb; /* gris clair élégant */
}

/* Liens */
a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Conteneur global */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ----------------------
   HEADER & NAVBAR
-------------------------*/
header {
  background: #1e3a8a; /* bleu marine */
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: #fff;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #facc15; /* jaune doré */
}

/* ----------------------
   HERO SECTION
-------------------------*/
.hero {
  height: 90vh;
  background: linear-gradient(rgba(30,58,138,0.7), rgba(30,58,138,0.7)),
              url("hero-bg.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.hero .btn {
  background: #facc15;
  color: #1e3a8a;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: bold;
  transition: background 0.3s ease;
}

.hero .btn:hover {
  background: #fde047; /* jaune clair */
}

/* ----------------------
   SECTIONS
-------------------------*/
section {
  padding: 4rem 0;
}

section h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: #1e3a8a;
}

/* ----------------------
   CARDS
-------------------------*/
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card h3 {
  margin-bottom: 1rem;
  color: #111827;
}

.card p {
  color: #4b5563;
}

/* ----------------------
   CTA (Call To Action)
-------------------------*/
.cta {
  background: #1e3a8a;
  color: #fff;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 1rem;
}

.cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta .btn {
  background: #facc15;
  color: #1e3a8a;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: bold;
  transition: background 0.3s ease;
}

.cta .btn:hover {
  background: #fde047;
}

/* ----------------------
   FOOTER
-------------------------*/
footer {
  background: #111827;
  color: #d1d5db;
  padding: 2rem 0;
  text-align: center;
}

footer a {
  color: #facc15;
}

footer a:hover {
  color: #fde047;
}

/* ----------------------
   RESPONSIVE
-------------------------*/
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    background: #1e3a8a;
    position: absolute;
    top: 70px;
    right: 0;
    width: 200px;
    display: none;
    padding: 1rem;
    border-radius: 0 0 0 1rem;
  }

  nav ul.active {
    display: flex;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

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