:root {
  --kf-blue-dark: #0a1f44;
  --kf-blue: #0d3b8c;
  --kf-blue-light: #1a56db;
  --kf-yellow: #ffc107;
  --kf-yellow-dark: #e6a800;
  --kf-white: #ffffff;
  --kf-gray-50: #f7f9fc;
  --kf-gray-100: #eef1f7;
  --kf-gray-600: #5a6478;
  --kf-radius: 14px;
  --kf-shadow: 0 10px 30px rgba(10, 31, 68, 0.10);
  --kf-shadow-lg: 0 20px 50px rgba(10, 31, 68, 0.18);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--kf-gray-50);
  color: var(--kf-blue-dark);
}

a { text-decoration: none; }

/* ---------- NAVBAR ---------- */
.kf-navbar {
  background: linear-gradient(135deg, var(--kf-blue-dark), var(--kf-blue));
  padding: 14px 0;
  box-shadow: var(--kf-shadow);
}
.kf-navbar .navbar-brand {
  font-weight: 700;
  color: var(--kf-white) !important;
  letter-spacing: 0.5px;
}
.kf-navbar .navbar-brand span { color: var(--kf-yellow); }

/* ---------- HERO ---------- */
.kf-hero {
  background: linear-gradient(135deg, var(--kf-blue-dark) 0%, var(--kf-blue) 55%, var(--kf-blue-light) 100%);
  color: var(--kf-white);
  padding: 90px 0 110px;
  position: relative;
  overflow: hidden;
}
.kf-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255,193,7,0.25) 0%, rgba(255,193,7,0) 70%);
  border-radius: 50%;
}
.kf-hero .badge-event {
  background: var(--kf-yellow);
  color: var(--kf-blue-dark);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 50px;
  display: inline-block;
  margin-bottom: 22px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}
.kf-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 18px;
}
.kf-hero h1 span { color: var(--kf-yellow); }
.kf-hero p.lead { color: #dbe4f5; font-size: 1.12rem; max-width: 620px; }

.kf-hero-infos {
  margin-top: 30px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.kf-hero-infos .info-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--kf-radius);
  padding: 14px 20px;
  min-width: 190px;
}
.kf-hero-infos .info-item small { color: var(--kf-yellow); font-weight: 600; letter-spacing: 0.5px; }
.kf-hero-infos .info-item div { font-weight: 600; margin-top: 4px; }

.btn-kf-primary {
  background: var(--kf-yellow);
  color: var(--kf-blue-dark);
  font-weight: 700;
  border: none;
  padding: 14px 34px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(255,193,7,0.35);
  transition: all .25s ease;
}
.btn-kf-primary:hover { background: var(--kf-yellow-dark); color: var(--kf-blue-dark); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,193,7,0.45); }

.btn-kf-outline {
  border: 2px solid var(--kf-white);
  color: var(--kf-white);
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 50px;
  background: transparent;
  transition: all .25s ease;
}
.btn-kf-outline:hover { background: var(--kf-white); color: var(--kf-blue-dark); }

.kf-hero-poster {
  display: inline-block;
  position: relative;
}
.kf-hero-poster img {
  border-radius: var(--kf-radius);
  box-shadow: var(--kf-shadow-lg);
  max-height: 460px;
  width: auto;
  border: 4px solid rgba(255,255,255,0.15);
  transform: rotate(2deg);
  transition: transform .3s ease;
}
.kf-hero-poster:hover img {
  transform: rotate(0deg) scale(1.02);
}
.kf-hero-poster::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  right: -18px;
  bottom: -18px;
  border: 2px dashed var(--kf-yellow);
  border-radius: var(--kf-radius);
  z-index: -1;
}

/* ---------- SECTIONS ---------- */
.kf-section { padding: 80px 0; }
.kf-section-title {
  text-align: center;
  margin-bottom: 50px;
}
.kf-section-title h2 { font-weight: 800; color: var(--kf-blue-dark); }
.kf-section-title .underline {
  width: 70px;
  height: 5px;
  background: var(--kf-yellow);
  border-radius: 4px;
  margin: 14px auto 0;
}

.kf-card {
  background: var(--kf-white);
  border-radius: var(--kf-radius);
  box-shadow: var(--kf-shadow);
  padding: 34px 28px;
  height: 100%;
  border-top: 4px solid var(--kf-yellow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.kf-card:hover { transform: translateY(-6px); box-shadow: var(--kf-shadow-lg); }
.kf-card .icon-circle {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--kf-blue-dark);
  color: var(--kf-yellow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
}
.kf-card .places-tag {
  display: inline-block;
  margin-top: 14px;
  background: var(--kf-gray-100);
  color: var(--kf-blue);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
}

.kf-alert-warning {
  background: #fff8e6;
  border: 1px solid var(--kf-yellow);
  color: #8a6500;
  border-radius: var(--kf-radius);
  padding: 18px 22px;
  font-weight: 500;
}

/* ---------- FOOTER ---------- */
.kf-footer {
  background: var(--kf-blue-dark);
  color: #c6d1ea;
  padding: 40px 0;
  text-align: center;
  margin-top: 40px;
}
.kf-footer strong { color: var(--kf-white); }

/* ---------- FORM (inscription.php) ---------- */
.kf-form-wrapper {
  background: var(--kf-white);
  border-radius: var(--kf-radius);
  box-shadow: var(--kf-shadow-lg);
  padding: 44px;
  margin: -70px auto 60px;
  position: relative;
  z-index: 5;
  max-width: 900px;
}
.kf-form-header {
  background: linear-gradient(135deg, var(--kf-blue-dark), var(--kf-blue));
  color: var(--kf-white);
  padding: 50px 0 100px;
  text-align: center;
}
.kf-form-header h1 { font-weight: 800; }
.kf-form-header .badge-event { background: var(--kf-yellow); color: var(--kf-blue-dark); font-weight: 600; padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; }

.kf-step-title {
  color: var(--kf-blue);
  font-weight: 700;
  border-left: 5px solid var(--kf-yellow);
  padding-left: 14px;
  margin: 34px 0 20px;
}
.kf-step-title:first-child { margin-top: 0; }

.form-label { font-weight: 600; color: var(--kf-blue-dark); font-size: 0.92rem; }
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid #dfe4ee;
  padding: 11px 14px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--kf-blue-light);
  box-shadow: 0 0 0 0.2rem rgba(26,86,219,0.15);
}

.kf-category-option {
  border: 2px solid #e4e9f3;
  border-radius: var(--kf-radius);
  padding: 18px;
  cursor: pointer;
  transition: all .2s ease;
  height: 100%;
}
.kf-category-option:hover { border-color: var(--kf-yellow); }
.kf-category-option input:checked ~ .kf-cat-label,
.form-check-input:checked + .kf-cat-label { color: var(--kf-blue); }
.kf-category-option.selected {
  border-color: var(--kf-blue-light);
  background: #f2f6ff;
}
.kf-category-option .places-badge {
  background: var(--kf-yellow);
  color: var(--kf-blue-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
}

.kf-interet-chip { display: inline-block; margin: 4px; }
.kf-interet-chip input { display: none; }
.kf-interet-chip label {
  display: inline-block;
  border: 1.5px solid #dfe4ee;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all .2s ease;
}
.kf-interet-chip input:checked + label {
  background: var(--kf-blue);
  border-color: var(--kf-blue);
  color: var(--kf-white);
}

.kf-conditional-block {
  background: var(--kf-gray-50);
  border-radius: var(--kf-radius);
  padding: 22px;
  border: 1px dashed #cdd6e8;
  margin-top: 14px;
}

.btn-kf-submit {
  background: var(--kf-blue-dark);
  color: var(--kf-white);
  font-weight: 700;
  padding: 14px 42px;
  border-radius: 50px;
  border: none;
  width: 100%;
}
.btn-kf-submit:hover { background: var(--kf-blue); color: var(--kf-white); }

/* ---------- CONFIRMATION ---------- */
.kf-confirmation {
  text-align: center;
  padding: 30px 10px;
}
.kf-confirmation .check-circle {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: #e7f8ee;
  color: #1ca25a;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 22px;
}
.kf-confirmation.waitlist .check-circle { background: #fff4e0; color: var(--kf-yellow-dark); }
.kf-confirmation .qr-box { background: var(--kf-white); padding: 18px; border-radius: var(--kf-radius); box-shadow: var(--kf-shadow); display: inline-block; margin-top: 20px; }

/* ---------- ADMIN / BACK-OFFICE ---------- */
.kf-admin-body { background: var(--kf-gray-100); min-height: 100vh; }

.kf-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--kf-blue-dark), var(--kf-blue) 60%, var(--kf-blue-light));
  padding: 30px;
}
.kf-auth-card {
  background: var(--kf-white);
  border-radius: var(--kf-radius);
  box-shadow: var(--kf-shadow-lg);
  padding: 44px;
  width: 100%;
  max-width: 440px;
}
.kf-auth-card .logo-badge {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--kf-blue-dark); color: var(--kf-yellow);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: 18px;
}

.kf-sidebar {
  background: var(--kf-blue-dark);
  min-height: 100vh;
  color: #c6d1ea;
  padding: 26px 18px;
}
.kf-sidebar .brand { color: var(--kf-white); font-weight: 800; font-size: 1.2rem; margin-bottom: 30px; display: block; }
.kf-sidebar .brand span { color: var(--kf-yellow); }
.kf-sidebar a.nav-link {
  color: #c6d1ea;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 6px;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.kf-sidebar a.nav-link:hover, .kf-sidebar a.nav-link.active {
  background: rgba(255,255,255,0.08);
  color: var(--kf-yellow);
}

.kf-topbar {
  background: var(--kf-white);
  padding: 16px 26px;
  box-shadow: 0 2px 10px rgba(10,31,68,0.06);
  display: flex; align-items: center; justify-content: space-between;
}

.kf-stat-card {
  background: var(--kf-white);
  border-radius: var(--kf-radius);
  box-shadow: var(--kf-shadow);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.kf-stat-card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: var(--kf-white);
}
.kf-stat-card .value { font-size: 1.6rem; font-weight: 800; color: var(--kf-blue-dark); }
.kf-stat-card .label { color: var(--kf-gray-600); font-size: 0.85rem; }

.kf-panel {
  background: var(--kf-white);
  border-radius: var(--kf-radius);
  box-shadow: var(--kf-shadow);
  padding: 26px;
}

.table-kf thead { background: var(--kf-blue-dark); color: var(--kf-white); }
.table-kf thead th { border: none; font-weight: 600; font-size: 0.85rem; }
.table-kf td, .table-kf th { vertical-align: middle; padding: 12px 14px; }
.badge-confirme { background: #e7f8ee; color: #1ca25a; padding: 5px 12px; border-radius: 50px; font-weight: 600; font-size: 0.78rem; }
.badge-attente { background: #fff4e0; color: var(--kf-yellow-dark); padding: 5px 12px; border-radius: 50px; font-weight: 600; font-size: 0.78rem; }

@media (max-width: 768px) {
  .kf-form-wrapper { padding: 26px; margin-top: -50px; }
  .kf-hero h1 { font-size: 2rem; }
}

/* ---------- MENU PRINCIPAL ---------- */
.kf-menu .nav-link {
  color: #dbe4f5 !important;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  padding: 8px 9px !important;
  white-space: nowrap;
  border-radius: 8px;
  transition: color .2s ease, background .2s ease;
}
.kf-menu .nav-link:hover { color: var(--kf-white) !important; background: rgba(255,255,255,0.08); }
.kf-menu .nav-link.active { color: var(--kf-yellow) !important; }
.kf-navbar .navbar-collapse > .btn { white-space: nowrap; }
.kf-navbar .navbar-toggler { border-color: rgba(255,255,255,0.35); }
.kf-navbar .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(255,193,7,0.35); }
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .kf-menu .nav-link { padding: 8px 6px !important; font-size: 0.75rem; }
  .kf-navbar .navbar-collapse > .btn { font-size: 0.8rem; padding: 8px 14px; }
}
@media (max-width: 1199.98px) {
  .kf-navbar .navbar-collapse { padding: 12px 0 6px; }
  .kf-menu .nav-link { font-size: 0.9rem; }
  .kf-navbar .navbar-collapse .btn { margin-top: 8px; }
}

/* ---------- PAGES DU MENU ---------- */
.kf-page-header {
  background: linear-gradient(135deg, var(--kf-blue-dark), var(--kf-blue));
  color: var(--kf-white);
  padding: 60px 0 70px;
  text-align: center;
}
.kf-page-header h1 { font-weight: 800; }
.kf-page-header p { color: #dbe4f5; max-width: 720px; margin: 0 auto; }
.kf-page-header .badge-event { background: var(--kf-yellow); color: var(--kf-blue-dark); font-weight: 600; padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; display: inline-block; }

.kf-a-completer {
  border: 2px dashed var(--kf-yellow);
  background: #fffbef;
  color: #8a6500;
  border-radius: var(--kf-radius);
  padding: 14px 18px;
  font-size: 0.9rem;
}

.kf-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.kf-timeline::before { content: ""; position: absolute; left: 22px; top: 6px; bottom: 6px; width: 3px; background: var(--kf-gray-100); }
.kf-timeline li { position: relative; padding: 0 0 26px 64px; }
.kf-timeline li:last-child { padding-bottom: 0; }
.kf-timeline .dot {
  position: absolute; left: 0; top: 0;
  width: 47px; height: 47px; border-radius: 50%;
  background: var(--kf-blue-dark); color: var(--kf-yellow);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.kf-timeline .heure { color: var(--kf-blue); font-weight: 700; font-size: 0.85rem; }

.kf-edition-card { background: var(--kf-white); border-radius: var(--kf-radius); box-shadow: var(--kf-shadow); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.kf-edition-card .affiche { aspect-ratio: 3 / 4; background: var(--kf-gray-100); display: flex; align-items: center; justify-content: center; color: var(--kf-gray-600); font-size: 2.5rem; }
.kf-edition-card .affiche img { width: 100%; height: 100%; object-fit: cover; }
.kf-edition-card .corps { padding: 22px; flex-grow: 1; }
.kf-edition-card.en-cours { outline: 3px solid var(--kf-yellow); }

.kf-logo-slot {
  background: var(--kf-white); border: 2px dashed #cfd7e6; border-radius: var(--kf-radius);
  height: 110px; display: flex; align-items: center; justify-content: center;
  color: var(--kf-gray-600); font-weight: 600; font-size: 0.85rem;
}

/* ---------- INTERVENANTS & GALERIE ---------- */
.kf-intervenant {
  background: var(--kf-white); border-radius: var(--kf-radius); box-shadow: var(--kf-shadow);
  padding: 28px 20px; text-align: center; height: 100%;
}
.kf-intervenant img, .kf-intervenant .sans-photo {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--kf-yellow); display: inline-flex;
}
.kf-intervenant .sans-photo { align-items: center; justify-content: center; background: var(--kf-gray-100); color: var(--kf-gray-600); font-size: 3rem; }

.kf-galerie-item {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--kf-gray-100); cursor: zoom-in;
}
.kf-galerie-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.kf-galerie-item:hover img, .kf-galerie-item:focus-visible img { transform: scale(1.05); }
.kf-galerie-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.45); color: #fff; border: 0; width: 44px; height: 64px; font-size: 1.6rem;
}
.kf-galerie-nav:hover { background: rgba(0,0,0,0.7); }
.kf-edition-card a.stretched-link:focus-visible { outline: 3px solid var(--kf-yellow); }

/* ---------- BADGE PARTICIPANT ---------- */
.kf-badge-page { background: linear-gradient(135deg, var(--kf-blue-dark), var(--kf-blue)); min-height: 100vh; }
.kf-badge {
  background: var(--kf-white); border-radius: 18px; box-shadow: var(--kf-shadow-lg);
  max-width: 400px; margin: 0 auto; overflow: hidden; text-align: center;
}
.kf-badge-haut {
  background: linear-gradient(135deg, var(--kf-blue-dark), var(--kf-blue));
  padding: 18px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.kf-badge-edition { background: var(--kf-yellow); color: var(--kf-blue-dark); font-weight: 700; font-size: 0.8rem; padding: 4px 14px; border-radius: 50px; letter-spacing: 0.4px; }
.kf-badge-corps { padding: 22px 22px 16px; }
.kf-badge-categorie { color: var(--kf-blue); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; }
.kf-badge-nom { font-size: 1.6rem; font-weight: 600; line-height: 1.15; margin: 8px 0 4px; color: var(--kf-blue-dark); overflow-wrap: anywhere; }
.kf-badge-nom span { font-weight: 800; }
.kf-badge-qr { margin: 18px auto 8px; padding: 10px; border: 3px solid var(--kf-yellow); border-radius: 14px; display: inline-block; }
.kf-badge-qr img { display: block; width: 220px; height: 220px; max-width: 100%; }
.kf-badge-bas { background: var(--kf-gray-100); padding: 12px 16px; font-size: 0.82rem; font-weight: 600; display: grid; gap: 4px; }
@media print {
  .kf-badge-page { background: #fff; }
  .kf-badge { box-shadow: none; border: 1px solid #ccc; }
  .kf-badge-haut, .kf-badge-edition, .kf-badge-bas { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Liens du menu bloqués (pages pas encore ouvertes) */
.kf-menu .nav-link.kf-nav-bloque { opacity: 0.45; cursor: not-allowed; pointer-events: auto; }
.kf-menu .nav-link.kf-nav-bloque:hover { background: transparent; color: inherit !important; }
