/* ===========
   Base DSJ
   =========== */

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Card principale (comme la tienne) */
.dsj-card {
  border-radius: 1.25rem;
  background-color: #ffffff;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.07),
    0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1.5rem;
}

/* ===========
   Champs de formulaire
   =========== */

.dsj-field-group {
  margin-bottom: 0.9rem;
}

.dsj-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151; /* slate-700 */
  margin-bottom: 0.25rem;
}

.dsj-input-wrapper {
  position: relative;
}

.dsj-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db; /* slate-300 */
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  outline: none;
  background-color: #fff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.dsj-input:focus {
  border-color: #4F46E5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.25);
}

/* États validation */
.dsj-input.is-valid {
  border-color: #4F46E5;
  background: #F5F3FF;
}

.dsj-input.is-invalid {
  border-color: #DC2626;
  background: #FEF2F2;
}

/* Message d’aide / d’erreur */
.dsj-helper {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #6b7280; /* slate-500 */
}

.dsj-helper.error {
  color: #DC2626;
}

.dsj-helper.success {
  color: #4F46E5;
}

/* ===========
   Boutons
   =========== */

.dsj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-width: 1px;
  border-style: solid;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

.dsj-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Bouton primaire (violet DSJ) */
.dsj-btn-primary {
  background-color: #4F46E5;
  border-color: #4F46E5;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}

.dsj-btn-primary:hover:not(:disabled) {
  background-color: #4338CA;
  border-color: #4338CA;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

/* Bouton secondaire (contour) */
.dsj-btn-secondary {
  background-color: #ffffff;
  border-color: #d1d5db;
  color: #374151;
}

.dsj-btn-secondary:hover:not(:disabled) {
  border-color: #4F46E5;
  color: #4F46E5;
  background-color: #f9fafb;
}

/* Icône à gauche */
.dsj-btn-icon-left {
  font-size: 1rem;
}

/* État "loading" (géré par JS) */
.dsj-btn.is-loading {
  position: relative;
}

.dsj-btn.is-loading .dsj-btn-label {
  opacity: 0.0;
}

.dsj-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.7);
  border-top-color: rgba(255,255,255,0.1);
  animation: dsj-spin 0.6s linear infinite;
}

@keyframes dsj-spin {
  to { transform: rotate(360deg); }
}
