/* ==========================================================
   ODCI Carrière Pro CSS - v3.2
   ========================================================== */

/* ----------- FILTRE ----------- */
.odci-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.odci-filter select,
.odci-filter input[type=text] {
  padding: 10px 12px;
  border: 2px solid var(--odci-color-filter-border, #D31D24);
  border-radius: 6px;
  background: #fff;
  color: #1A2942;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 767px) {
  .odci-filter { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .odci-filter { grid-template-columns: 1fr; }
}


/* ----------- LISTING DES POSTES ----------- */
#odci-jobs-area {
  transition: opacity 0.2s ease-in-out;
}
#odci-jobs-area.odci-loading {
  opacity: 0.5;
}
.odci-jobs-grid {
  display: grid;
  grid-template-columns: repeat(var(--odci-grid-mobile, 1), 1fr);
  gap: 14px;
}
@media (min-width: 768px) {
  .odci-jobs-grid {
    grid-template-columns: repeat(var(--odci-grid-tablet, 2), 1fr);
  }
}
@media (min-width: 1025px) {
  .odci-jobs-grid {
    grid-template-columns: repeat(var(--odci-grid-desktop, 4), 1fr);
  }
}

/* ----------- CARTE DU POSTE ----------- */
.odci-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #cfe6ff;
  background: #fff;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.odci-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.odci-card h3 {
  margin: 0 0 8px;
  color: var(--odci-color-title, #1A2942);
  font-size: 17px;
  font-weight: 600;
}
.odci-card p { margin: 4px 0; font-size: 14px; line-height: 1.3; }
.odci-label {
  color: var(--odci-color-label, #D31D24);
  font-weight: 700;
  margin-right: 6px;
}
.odci-val { color: #1A2942; }

/* Bouton (partagé) */
.odci-btn {
  background: var(--odci-color-button, #D31D24);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
  font-weight: 600;
  text-align: center;
}
.odci-btn:hover { 
  background: var(--odci-color-button-hover, #b5171c);
}
.odci-jobs-grid .odci-card .odci-btn {
  margin-top: 12px;
}

/* ----------- PAGINATION ----------- */
.odci-pagination {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #cfe6ff;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.odci-pagination a.odci-page {
  padding: 8px 12px;
  background: #f2f6fb;
  border: 1px solid #cfe6ff;
  border-radius: 6px;
  text-decoration: none;
  color: #1A2942;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 600;
}
.odci-pagination a.odci-page:hover {
  background-color: #eaf2fb;
  border-color: #9fc8ff;
}

/* ----------- MODALE (POP-UP) ----------- */
#odci-modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.odci-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 41, 66, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  animation: odciFadeIn 0.2s ease;
}
.odci-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 680px;
  width: 100%;
  z-index: 10000;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  animation: odciFadeInModal 0.25s ease;
  border: 2px solid var(--odci-color-form-border, #1A2942);
}
.odci-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f1f1f1;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  color: #555;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
  z-index: 10;
}
.odci-modal-close:hover { 
  background: var(--odci-color-button, #D31D24); 
  color: #fff; 
}

/* ----------- FORMULAIRE DANS LA MODALE ----------- */
.odci-modal-content .odci-apply-info {
  background: #f2f6fb;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #cfe6ff;
  margin-bottom: 20px;
}
.odci-modal-content .odci-apply-info h3 {
  margin: 0 0 8px 0;
  color: #1A2942;
  font-size: 18px;
}
.odci-modal-content .odci-apply-info ul { margin: 0; padding-left: 0; list-style: none; }
.odci-modal-content .odci-apply-info li { margin-bottom: 4px; }

.odci-form { border: none; padding: 0; max-width: none; }
.odci-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
.odci-col { min-width: 0; }
.odci-form label {
  display: block;
  margin-bottom: 6px;
  color: #1A2942;
  font-weight: 600;
  font-size: 14px;
}
.odci-form input[type=text],
.odci-form input[type=email],
.odci-form select { /* NOUVEAU : Style pour le select */
  width: 100%;
  padding: 10px;
  border: 2px solid var(--odci-color-form-border, #1A2942);
  border-radius: 6px;
  color: #1A2942;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 14px;
}
.odci-form input[type=text]:focus,
.odci-form input[type=email]:focus,
.odci-form select:focus {
  border-color: var(--odci-color-form-focus, #1A2942cc);
  box-shadow: 0 0 0 3px var(--odci-color-form-focus, #1A2942cc);
  outline: none;
}

@media (max-width: 480px)  { 
  .odci-row { grid-template-columns: 1fr; gap: 16px; } 
  .odci-modal-content { padding: 16px; }
}

/* Bouton soumission */
.odci-submit-wrap { 
  margin-top: 20px; 
  text-align: center;
}
.odci-submit-btn {
  width: auto;
  min-width: 250px;
  padding: 12px 30px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}
.odci-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.odci-btn-text { transition: opacity 0.2s ease; }

/* NOUVEAU : Spinner de chargement CSS */
.odci-btn-loader {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: odciSpinner 0.6s linear infinite;
  margin-left: -10px; /* Ajustement pour le centrage */
}
@keyframes odciSpinner {
  to { transform: rotate(360deg); }
}


/* ----------- ANIMATION DE SUCCÈS (ENVELOPPE) ----------- */
#odci-success { animation: odciFadeIn 0.25s ease; padding: 20px 0; }
.odci-success-animation {
  position: relative;
  width: 100px;
  height: 80px;
  margin: 0 auto 20px auto;
}
.odci-envelope {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100px;
  height: 60px;
  background: #f2f6fb;
  border: 2px solid var(--odci-color-button, #D31D24);
  border-radius: 6px;
  animation: odciEnvelopeOpen 0.5s ease-out forwards;
}
.odci-envelope::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--odci-color-button, #D31D24);
  transform-origin: top;
  transform: scaleY(0);
  animation: odciEnvelopeFlap 0.5s 0.5s ease-out forwards;
}
.odci-paper {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 80px;
  height: 70px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  transform: translateY(0);
  animation: odciPaperUp 1s 0.7s ease-out forwards;
  z-index: -1;
}
.odci-line {
  position: absolute;
  right: -20px;
  top: 20px;
  height: 3px;
  background: var(--odci-color-button, #D31D24);
  border-radius: 3px;
  opacity: 0;
  animation: odciLines 1s 1.2s ease-out forwards;
}
.odci-line:nth-child(3) { width: 15px; top: 15px; animation-delay: 1.3s; }
.odci-line:nth-child(4) { width: 10px; top: 25px; animation-delay: 1.4s; }
.odci-line:nth-child(5) { width: 15px; top: 35px; animation-delay: 1.5s; }

#odci-success h3 { color: #1A2942; font-size: 22px; }
#odci-success p { color: #555; }

/* ----------- ANIMATIONS ----------- */
@keyframes odciFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes odciFadeInModal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; translateY(0); } }
@keyframes odciEnvelopeOpen { from { height: 0; } to { height: 60px; } }
@keyframes odciEnvelopeFlap { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes odciPaperUp { from { transform: translateY(0); } to { transform: translateY(-70px); opacity: 0; } }
@keyframes odciLines {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-30px); opacity: 0; }
}