/* ============================================================
   SERVICES.CSS
   Styles pour la page Services & Commande.
   
   Structure :
   1. Layout général
   2. En-tête de page
   3. Section Services (liste des prestations)
   4. Formulaire de commande
   5. Section Suivi de commande (lookup par code)
   6. Éléments de formulaire partagés (inputs, boutons)
   7. Messages / Toasts (succès, erreur)
   ============================================================ */

/* ---- 1. LAYOUT GÉNÉRAL ---- */
.services {
  min-height: 100vh;
  padding: var(--space-3xl) var(--space-xl);
  max-width: 900px;
  margin: 0 auto;
}

/* ---- 2. EN-TÊTE ---- */
.services__header {
  margin-bottom: var(--space-3xl);
  text-align: center;
}

.services__back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding: var(--space-sm) 14px 10px 14px;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: var(--color-default);
  border-radius: 50px;
  cursor: pointer;
  position: relative;        /* Nécessaire pour le ::before */
  overflow: hidden;           /* Cache le ::before qui déborde */
  z-index: 1;                /* Le texte reste cliquable */
  transition: color var(--transition-base);
}

/* Barre de remplissage (pseudo-élément) */
.services__back-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;                  /* Invisible par défaut */
  height: 0;
  background: var(--color-secondary);
  transition: height 0.2s ease;
  z-index: -1;               /* Derrière le texte */
}

/* Hover : le remplissage s'étend + le texte change de couleur */
.services__back-link:hover {
  color: var(--color-default);
}

.services__back-link:hover::before {
  height: 100%;               /* Remplit tout le bouton */
}

.services__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 900;
  color: var(--color-secondary);
  text-shadow: var(--glow-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.services__subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
  letter-spacing: 0.1em;
}

/* ---- 3. SECTION SERVICES (liste des prestations) ---- */
.services__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
}

.service-card {
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 15px;
  background: var(--color-bg-secondary);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.service-card:hover {
  border-color: var(--color-default-dim);
  box-shadow: 0 0 20px var(--color-default-glow);
}

.service-card__icon {
  display: flex;
  justify-content: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}
.service-card__icon img {
  width: 64px;
  height: 64px;
}

.service-card__title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.service-card__desc {
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ---- 4. FORMULAIRE DE COMMANDE ---- */
.order-section {
  margin-bottom: var(--space-3xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  border-radius: 20px;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.order-section__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-2xl);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}


.order-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.order-form .form-input {
  background: var(--color-bg-primary);}

/* ---- 5. SECTION SUIVI DE COMMANDE ---- */
.tracking-section {
  margin-bottom: var(--space-3xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  border-radius: 20px;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.tracking-section__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--text-2xl);
  color: var(--color-yellow);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.tracking-form {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
}

.tracking-form .form-input {
  background: var(--color-bg-primary);
}

/* Résultat du suivi de commande */
.tracking-result {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-primary);
  display: none; /* Affiché via JS quand un résultat est trouvé */
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.tracking-result.is-visible {
  display: block;
}

.tracking-result__status {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  padding: var(--space-sm) var(--space-xl);
  display: inline-block;
}
.tracking-result__status--pending {
  color: var(--color-orange);
  border: 1px solid var(--color-orange);
  border-radius: 50px;
}
.tracking-result__status--accepted {
  color: var(--color-blue);
  border: 1px solid var(--color-blue);
  border-radius: 50px;
}
.tracking-result__status--rejected {
  color: var(--color-red);
  border: 1px solid var(--color-red);
  border-radius: 50px;
}
.tracking-result__status--completed {
  color: var(--color-text-primary);
  background: var(--color-default);
  border-radius: 50px;
}

.tracking-result__detail {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}
.tracking-result__detail strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* Barre de progression */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-bg-tertiary);
  margin-top: var(--space-md);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-green);
  transition: width var(--transition-slow);
}

/* ---- 6. ÉLÉMENTS DE FORMULAIRE ---- */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-group__label--required::after {
  content: ' *';
  color: var(--color-red);
}

.form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-deep);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  border-radius: 10px;
}
.form-input:focus {
  border-color: var(--color-default);
  box-shadow: 0 0 8px var(--color-default-glow);
}
.form-input::placeholder {
  color: var(--color-text-muted);
}

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

.form-select {
  appearance: none;
  /* Flèche personnalisée en SVG encodé */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Bouton principal */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm2) var(--space-xl);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: var(--color-default);
  border-radius: 50px;
  cursor: pointer;
  position: relative;        /* Nécessaire pour le ::before */
  overflow: hidden;           /* Cache le ::before qui déborde */
  z-index: 1;                /* Le texte reste cliquable */
  transition: color var(--transition-base);
}

/* Barre de remplissage (pseudo-élément) */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;                  /* Invisible par défaut */
  height: 0;
  background: var(--color-secondary);
  transition: height 0.2s ease;
  z-index: -1;               /* Derrière le texte */
}

/* Hover : le remplissage s'étend + le texte change de couleur */
.btn-primary:hover {
  color: var(--color-default);
}

.btn-primary:hover::before {
  height: 100%;               /* Remplit tout le bouton */
}

/* Bouton secondaire */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm2) var(--space-xl);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--color-secondary);
  background: var(--color-default);
  border-radius: 50px;
  cursor: pointer;
  position: relative;        /* Nécessaire pour le ::before */
  overflow: hidden;           /* Cache le ::before qui déborde */
  z-index: 1;                /* Le texte reste cliquable */
  transition: color var(--transition-base);
}

/* Barre de remplissage (pseudo-élément) */
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;                  /* Invisible par défaut */
  height: 0;
  background: var(--color-secondary);
  transition: height 0.2s ease;
  z-index: -1;               /* Derrière le texte */
}

/* Hover : le remplissage s'étend + le texte change de couleur */
.btn-secondary:hover {
  color: var(--color-default);
}

.btn-secondary:hover::before {
  height: 100%;               /* Remplit tout le bouton */
}

/* ---- 7. MESSAGES / TOASTS ---- */
.toast {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  border: var(--color-border)1px solid;
  border-radius: 20px;
  background: var(--color-bg-deep);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateX(100%);
  transition: 
    opacity var(--transition-base),
    transform var(--transition-base);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.toast--success {
  color: var(--color-green);
}
.toast--error {
  color: var(--color-red);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .services {
    padding: var(--space-xl) var(--space-md);
  }
  .tracking-form {
    flex-direction: column;
    align-items: center;
  }
  .tracking-form label{
    text-align: center;
  }
}
