/* === ESPACE PÈLERINS HAJJ - FRONTEND === */

/* === PAGE DE CONNEXION === */
.hajj-login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  padding: 40px 20px;
}

.hajj-login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  max-width: 450px;
  width: 100%;
}

.hajj-login-box h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
  font-size: 24px;
}

.hajj-login-box .form-group { margin-bottom: 20px; }

.hajj-login-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
}

.hajj-login-box input[type="email"],
.hajj-login-box input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.hajj-login-box input:focus {
  outline: none;
  border-color: #0073aa;
}

.hajj-login-box .btn-submit {
  width: 100%;
  padding: 14px;
  background: #0073aa;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 10px;
}

.hajj-login-box .btn-submit:hover { background: #005a87; }
.hajj-login-box .btn-submit:disabled { background: #ccc; cursor: not-allowed; }

.hajj-login-box .form-message {
  padding: 12px;
  margin: 15px 0;
  border-radius: 6px;
  font-size: 14px;
  display: none;
}

.hajj-login-box .form-message.error {
  display: block;
  background: #fee;
  color: #c00;
  border: 1px solid #fcc;
}

.hajj-login-box .form-message.success {
  display: block;
  background: #efe;
  color: #060;
  border: 1px solid #cfc;
}

/* === DASHBOARD === */
.hajj-dashboard {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.hajj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #0073aa;
}

.hajj-header h2 { margin: 0; color: #333; }

.btn-logout {
  padding: 10px 20px;
  background: #dc3232;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-logout:hover { background: #a00; }

/* === LISTE DES ÉTAPES (carte globale) === */
.hajj-etapes-list {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 40px;
}

.hajj-etapes-list h3 {
  margin-top: 0;
  margin-bottom: 25px;
  color: #333;
  font-size: 22px;
}

/* === TIMELINE — BASE (verticale / générique) === */
.etapes-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.etapes-timeline li {
  padding: 15px 20px;
  margin-bottom: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: all 0.3s;
  border-left: 4px solid #ddd;
  position: relative;
}

.etapes-timeline li.current {
  background: #e7f5ff;
  border-left-color: #0073aa;
  box-shadow: 0 2px 8px rgba(0,115,170,0.2);
}

.etapes-timeline li.complete {
  background: #e8f5e9;
  border-left-color: #46b450;
}

/* Numéro et titre — base */
.etapes-timeline .etape-numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;          /* harmonisé */
  height: 28px;         /* harmonisé */
  line-height: 28px;
  border-radius: 50%;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  background: #e9edf2;
  color: #4b5563;
  flex: 0 0 28px;
  margin-right: 15px;
}

.etapes-timeline li.current .etape-numero {
  background: #0073aa;
  color: #fff;
}

.etapes-timeline li.complete .etape-numero {
  background: #46b450;
  color: #fff;
  font-size: 18px;
}

.etapes-timeline .etape-titre {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  flex-grow: 1;
}

.etapes-timeline .etape-statut {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  margin-left: 10px;
}

.etapes-timeline li.current .etape-statut { background: #0073aa; color: #fff; }
.etapes-timeline li.complete .etape-statut { background: #46b450; color: #fff; }

/* === TIMELINE — BARRE STICKY === */
.hajj-steps-bar { 
  z-index: 20;
  background: #fff;
  padding: 12px 0 8px;
  border-bottom: 0;
  overflow-x: visible; /* pas de scroll sur la barre elle-même */
}

/* === TIMELINE — MODE HORIZONTAL SCROLLABLE === */
/* Conteneur avec flèches */
.timeline-wrap{
  position: relative;
  padding: 8px 44px; /* place pour les flèches */
}

/* Liste horizontale scrollable (version spécifique avec la classe) */
.etapes-timeline.etapes-horizontal{
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 8px 6px;
  margin: 0;
  list-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap !important;             /* FIX 1 */
  scrollbar-width: none;                     /* Firefox, hide */
  -ms-overflow-style: none;                  /* IE/Edge legacy */
}

.etapes-timeline.etapes-horizontal::-webkit-scrollbar{ display: none; } /* Chrome/Safari/Edge */

.etapes-timeline.etapes-horizontal > li{
  flex: 0 0 auto !important;                 /* FIX 1 */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #e6ebf1;
  background: #fafcff;
  scroll-snap-align: center;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  min-width: 260px;                          /* ajuste selon ta maquette */
}

/* Pastilles + états */
.etapes-timeline li.done{
  background: #ecfdf5;
  border-color: #d1fae5;
}
.etapes-timeline li.done .etape-numero{
  background: #10b981;
  color: #ffffff;
}

.etapes-timeline li.current{
  background: #e7f2ff;
  border-color: #cfe6ff;
  box-shadow: inset 3px 0 0 #0f62a8;
}
.etapes-timeline li.current .etape-numero{
  background: #0f62a8;
  color: #ffffff;
}

/* Titre (horizontal) */
.etapes-timeline .etape-titre{
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

/* Flèches */
.tl-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: #095378;
  color: #fff;
  font-size: 18px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transition: transform .15s ease, opacity .15s ease;
}
.tl-btn:hover { transform: translateY(-50%) scale(1.06); }
.tl-left{  left: 8px; }
.tl-right{ right: 8px; }
.tl-btn[disabled]{ opacity:.35; cursor: default; transform: translateY(-50%); }

/* Masques de bords — seulement desktop (évite le bug iOS premier paint) */
@media (hover: hover) and (pointer: fine) {
  .etapes-timeline.etapes-horizontal{
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  }
}

/* iOS/touch : pas de masque + force compositing pour fiabiliser le premier render */
@supports (-webkit-overflow-scrolling: touch) {
  .etapes-timeline.etapes-horizontal{
    -webkit-mask-image: none !important;
    mask-image: none !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    contain: paint;
    backface-visibility: hidden;
  }
  .etapes-timeline.etapes-horizontal > li{
    backface-visibility: hidden;
    transform: translateZ(0);
  }
}

/* === DÉTAIL DE L'ÉTAPE === */
.hajj-etape-detail {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.hajj-etape-detail h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #0073aa;
  font-size: 28px;
}

.etape-description {
  color: #666;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 6px;
}

/* === CONTENUS === */
.hajj-contenu { 
  padding-bottom: 30px;
   animation: fadeIn 0.5s ease-out;
}

.hajj-contenu:last-child { border-bottom: none; }

.hajj-contenu h4 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 20px;
}

.contenu-texte { font-size: 16px; line-height: 1.7; color: #555; }
.contenu-video, .contenu-audio { margin: 20px 0; }

.contenu-video video, .contenu-audio audio {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contenu-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contenu-pdf .btn-pdf {
  display: inline-block;
  padding: 12px 24px;
  background: #dc3232;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.3s;
}

.contenu-pdf .btn-pdf:hover { background: #a00; }

/* === FORMULAIRES === */
.hajj-formulaire {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 8px;
  margin-top: 20px;
}

.form-question { margin-bottom: 25px; }

.form-question label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.form-question .required { color: #dc3232; margin-left: 3px; }

.form-question input[type="text"],
.form-question textarea,
.form-question select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.3s;
}

.form-question input:focus,
.form-question textarea:focus,
.form-question select:focus {
  outline: none;
  border-color: #0073aa;
}

.form-question input.error,
.form-question textarea.error,
.form-question select.error { border-color: #dc3232; }

.form-question textarea { resize: vertical; min-height: 100px; }

.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}
.radio-label:hover, .checkbox-label:hover { border-color: #0073aa; background: #f0f8ff; }
.radio-label input, .checkbox-label input { margin: 0; }
.radio-text, .checkbox-text { display: inline; }
.radio-label br, .checkbox-label br { display: none; }

.hajj-formulaire .btn-submit {
  padding: 14px 30px;
  background: #46b450;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 10px;
}

.hajj-formulaire .btn-submit:hover { background: #2ea32e; }
.hajj-formulaire .btn-submit:disabled { background: #ccc; cursor: not-allowed; }

.hajj-formulaire .form-message {
  padding: 15px;
  margin: 20px 0;
  border-radius: 6px;
  font-size: 15px;
  display: none;
}

.hajj-formulaire .form-message.error {
  display: block;
  background: #fee;
  color: #c00;
  border: 1px solid #fcc;
}

.hajj-formulaire .form-message.success {
  display: block;
  background: #efe;
  color: #060;
  border: 1px solid #cfc;
}

/* === VALIDATION D'ÉTAPE === */
.etape-actions { text-align: center; }

.btn-complete-etape {
  background: #0f62a8;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(70,180,80,0.3);
}

.btn-complete-etape:hover {
  background: #0f62a8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(70,180,80,0.4);
}

.btn-complete-etape:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.etape-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  display: none;
}

.etape-message.error {
  display: block;
  background: #fee;
  color: #c00;
  border: 1px solid #fcc;
}

.etape-message.success {
  display: block;
  background: #efe;
  color: #060;
  border: 1px solid #cfc;
}

/* === MESSAGE DE COMPLÉTION === */
.hajj-complete-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(102,126,234,0.3);
  margin-top: 30px;
}

.hajj-complete-message h3 { font-size: 32px; margin: 0 0 20px 0; }
.hajj-complete-message p  { font-size: 18px; line-height: 1.6; margin: 0; opacity: 0.95; }

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hajj-dashboard { padding: 20px 15px; }
  .hajj-header { flex-direction: column; gap: 15px; }
  .hajj-header h2 { font-size: 22px; }
  .hajj-etapes-list, .hajj-etape-detail { padding: 20px; }
  .hajj-etape-detail h3 { font-size: 24px; }
  .etapes-timeline li { padding: 12px 15px; }
  .hajj-formulaire { padding: 20px; }
  .hajj-login-box { padding: 30px 20px; }
}

@media (max-width: 640px){
  .etapes-timeline .etape-titre{
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Ajustements mobile forts */
@media (max-width: 768px) {
  .hajj-etapes-list, .hajj-etape-detail { padding: 0; }
  .card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px !important;
  }
  .wrap {
    max-width: 820px;
    margin: 0 auto !important;
    padding: 0 !important;
  }
  .hajj-dashboard { padding: 20px 3px !important; }

  /* timeline horizontale : hauteur compacte + overflow visible vertical si badges */
  .etapes-timeline.etapes-horizontal { 
    height: 80px;
    overflow-y: visible;
  }

  /* option : masquer les étapes passées */
  .etapes-timeline li.done { display: none; }
}

/* Divers */
.elementor img { border-radius: 20px !important; }

/* === MODALE === */
.hajj-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.hajj-modal.is-open { display: flex; }

.hajj-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}

.hajj-modal__content {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  background: #fff; border-radius: 10px; padding: 10px;
  overflow: auto;
}

.hajj-modal__close {
  position: absolute; top: 6px; right: 8px;
  background: transparent; border: 0; font-size: 28px; line-height: 1; cursor: pointer;
}
/**
 * Styles pour l'auto-save des formulaires
 * À ajouter dans assets/front.css
 */

/* ✅ Statut de complétion du formulaire */
.form-completion-status {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.form-completion-status.incomplete {
    background: #fff4e6;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.form-completion-status.complete {
    background: #e8f9f3;
    color: #0a6e4a;
    border-left: 4px solid #0bb37b;
}

.form-completion-status .status-icon {
    font-size: 18px;
    margin-right: 8px;
}

.form-completion-status .status-text {
    font-size: 14px;
}

/* ✅ Indicateur de sauvegarde */
.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    display: none;
    animation: slideInUp 0.3s ease;
}

.save-indicator.saving {
    background: #fff4e6;
    color: #e65100;
    border-left: 4px solid #ff9800;
}

.save-indicator.success {
    background: #e8f9f3;
    color: #0a6e4a;
    border-left: 4px solid #0bb37b;
}

.save-indicator.error {
    background: #fce8e6;
    color: #a02622;
    border-left: 4px solid #d93025;
}

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

/* ✅ Alerte nouvelle étape */
.hajj-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    display: none;
    animation: slideInDown 0.4s ease;
}

.hajj-alert.success {
    background: linear-gradient(135deg, #e8f9f3 0%, #e6f7ff 100%);
    color: #095378;
    border: 2px solid #0bb37b;
}

@keyframes slideInDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ✅ Style focus pour les champs en cours de modification */
.hajj-formulaire input:focus,
.hajj-formulaire textarea:focus,
.hajj-formulaire select:focus {
    outline: none;
    border-color: #095378;
    box-shadow: 0 0 0 3px rgba(9, 83, 120, 0.1);
}

/* ✅ Indicateur visuel pour champs remplis */
.hajj-formulaire input:valid,
.hajj-formulaire textarea:valid,
.hajj-formulaire select:valid {
    border-left: 3px solid #0bb37b;
}

/* ✅ Animation subtile au changement */
.hajj-formulaire input,
.hajj-formulaire textarea,
.hajj-formulaire select {
    transition: all 0.3s ease;
}

/* ✅ Mobile responsive */
@media (max-width: 768px) {
    .save-indicator {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        font-size: 13px;
        padding: 10px 15px;
    }

    .hajj-alert {
        left: 10px;
        right: 10px;
        transform: none;
        font-size: 14px;
    }
}

/* ========================================
   BOUTON RETOUR EN ARRIÈRE
   ======================================== */

.btn-go-back-etape {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-left: 10px;margin-right: 20px;
}

.btn-go-back-etape:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-go-back-etape:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Gestion des boutons côte à côte */
.etape-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.etape-actions .complete-message {
    width: 100%;
    margin-top: 10px;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .btn-go-back-etape {
        margin-left: 0;
        width: 100%;
		margin-bottom: 20px;
    }
    
    .etape-actions {
        flex-direction: column;
    }
    
    .btn-complete-etape,
    .btn-go-back-etape {
        width: 100%;
    }
}
