/* ===== STYLE GLOBAL MCB v2 ===== */

/* Polices et couleurs */
:root {
  --green-main: #2e7d32;
  --green-light: #43a047;
  --gray-bg: #f8f9fa;
  --text-dark: #333;
  --text-muted: #666;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-dark);
  background-color: var(--gray-bg);
  margin: 0;
}

/* ===== Hero section ===== */
.hero {
  position: relative;
  background: url('/static/img/professional.png') center/cover no-repeat;
  color: #fff;
  text-align: center;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.hero .container {
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  text-shadow: 0 3px 6px rgba(0,0,0,0.4);
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.3rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  color: #f1f1f1;
}
.hero .btn {
  font-weight: 600;
  border-radius: 8px;
  margin: 0 0.3rem;
}
.hero .btn-light {
  background: #fff;
  color: var(--green-main);
}
.hero .btn-outline-light:hover {
  background: #fff;
  color: var(--green-main);
}

/* ===== Sections génériques ===== */
section {
  padding: 80px 20px;
}
section h2, section h1 {
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}
section p.lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* ===== Cards ===== */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.card img {
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ===== À propos ===== */
.about-section {
  background: #fff;
}
.about-section h4 {
  color: var(--green-main);
  font-weight: 600;
}
.about-section .card {
  border-left: 4px solid var(--green-main);
}

/* ===== Formations ===== */
.section-courses {
  background: #fff;
}
.section-courses h3 {
  font-weight: 700;
  color: var(--green-main);
}
.section-courses .btn {
  border-color: var(--green-main);
  color: var(--green-main);
}
.section-courses .btn:hover {
  background: var(--green-main);
  color: #fff;
}

/* ===== Contact ===== */
.section-contact {
  background: linear-gradient(135deg, var(--green-light), var(--green-main));
  color: #fff;
  text-align: center;
}
.section-contact .btn {
  background: #fff;
  color: var(--green-main);
  font-weight: 600;
}
.section-contact .btn:hover {
  background: #e8f5e9;
}

/* ===== Footer ===== */
footer {
  background: #f1f1f1;
  border-top: 1px solid #ddd;
  padding: 1rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ===== Fonds d’arrière-plan par page ===== */
.page-header {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 100px 20px;
  color: #fff !important;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-header h1,
.page-header h2,
.page-header p {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.page-header.home { background-image: url('/static/img/bg-hero.jpg'); }
.page-header.about { background-image: url('/static/img/bg-about.jpg'); }
.page-header.formations { background-image: url('/static/img/bg-formations.jpg'); }
.page-header.contact { background-image: url('/static/img/bg-contact.jpg'); }
.page-header.blog { background-image: url('/static/img/bg-blog.jpg'); }
.page-header.admin { background-image: url('/static/img/bg-admin.jpg'); }

/* Edge-specific blend fix */
@supports (-ms-ime-align:auto) {
  .page-header::before {
    background: rgba(0, 0, 0, 0.65);
    mix-blend-mode: multiply;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  section { padding: 60px 15px; }
  .card { margin-bottom: 1rem; }
  .page-header h1 { font-size: 1.8rem; }
  .page-header p { font-size: 1rem; }
}

/* ======= Cloudflare Turnstile (Widget Captcha) ======= */
.cf-turnstile {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem auto;
  max-width: 100%;
  min-height: 70px;
  transform: scale(1);
  transform-origin: center;
}

/* Adaptation mobile : réduit légèrement le zoom */
@media (max-width: 480px) {
  .cf-turnstile {
    transform: scale(0.95);
  }
}

/* ======= Turnstile Widget ======= */
.cf-turnstile {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem auto;
  max-width: 100%;
  min-height: 70px;
  transform: scale(1);
  transform-origin: center;
}

@media (max-width: 480px) {
  .cf-turnstile {
    transform: scale(0.95);
  }
}

/* ======= Validation Bootstrap ======= */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border-color: #dc3545;
}
.was-validated .form-control:valid,
.was-validated .form-select:valid {
  border-color: #198754;
}

/* === Uniformisation des boutons Bootstrap (MCB Design) === */
.btn-primary {
  background-color: #198754 !important;  /* Vert MCB */
  border-color: #198754 !important;
  color: #fff !important;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.btn-primary:hover,
.btn-success:hover {
  background-color: #157347 !important;  /* Vert plus foncé au survol */
  border-color: #146c43 !important;
  color: #fff !important;
}

.btn-success {
  background-color: #198754 !important;
  border-color: #198754 !important;
  color: #fff !important;
  font-weight: 600;
}

.btn-success:focus,
.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.4) !important;
}
