/* ============================================
   NAVIGATION PAR CHIPS
   ============================================ */

.profile-nav-chips {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.profile-nav-chips::-webkit-scrollbar {
  display: none;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.profile-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #374151;
}

.profile-chip:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.profile-chip.active {
  background: linear-gradient(135deg, var(--primary, #D4AF37), #b8960c);
  border-color: transparent;
  color: white;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.profile-chip i {
  font-size: 0.9rem;
}

.profile-chip.active i {
  color: white;
}

/* Animation d'apparition des sections */
.profile-subsection {
  animation: fadeInSection 0.3s ease;
}

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

/* Responsive chips */
@media (max-width: 640px) {
  .profile-nav-chips {
    padding: 12px 16px;
    gap: 6px;
  }

  .profile-chip {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .profile-chip span {
    display: none;
  }

  .profile-chip i {
    font-size: 1rem;
  }

  .profile-chip {
    padding: 10px 12px;
    border-radius: 50%;
  }

  .profile-chip.active {
    padding: 10px 16px;
    border-radius: 24px;
  }

  .profile-chip.active span {
    display: inline;
  }
}

/* ============================================
   STYLES FMD - Forfait Mobilite Durable
   ============================================ */

/* Empty State */
.fmd-empty-state {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px dashed #86efac;
  border-radius: 16px;
  margin-bottom: 20px;
}

.fmd-empty-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  color: white;
}

.fmd-empty-state h4 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: #166534;
}

.fmd-empty-state > p {
  margin: 0 0 20px;
  color: #15803d;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.fmd-empty-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.fmd-empty-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #374151;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fmd-empty-info-item i {
  font-size: 1.1rem;
}

.fmd-empty-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #92400e;
  max-width: 500px;
  margin: 0 auto;
}

.fmd-empty-note i {
  color: #d97706;
}

.fmd-fleet-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #7dd3fc;
  border-radius: 10px;
  margin-bottom: 20px;
  color: #0369a1;
}

.fmd-fleet-banner i {
  font-size: 1.2rem;
}

/* Summary Card */
.fmd-summary-card {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.fmd-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.fmd-year-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary, #D4AF37);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
}

.fmd-total-info {
  text-align: right;
}

.fmd-total-label {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
}

.fmd-total-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.fmd-progress-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.fmd-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #D4AF37, #f59e0b);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.fmd-remaining {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #64748b;
}

.fmd-remaining i {
  color: var(--primary, #D4AF37);
}

/* Pockets Grid */
.fmd-pockets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.fmd-pocket-card {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fmd-pocket-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.fmd-pocket-highlight {
  border: 2px solid var(--primary, #D4AF37);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.fmd-pocket-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.fmd-pocket-info {
  flex: 1;
}

.fmd-pocket-info h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  color: #1e293b;
}

.fmd-pocket-desc {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: #64748b;
}

.fmd-pocket-amounts {
  margin-bottom: 8px;
}

.fmd-pocket-used {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.fmd-pocket-max {
  font-size: 0.9rem;
  color: #94a3b8;
}

.fmd-pocket-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.fmd-pocket-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.fmd-pocket-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--primary, #D4AF37);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tadam Budget */
.fmd-tadam-budget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid var(--primary, #D4AF37);
  border-radius: 12px;
  margin-bottom: 24px;
}

.fmd-tadam-budget-icon {
  width: 56px;
  height: 56px;
  background: var(--primary, #D4AF37);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.fmd-tadam-budget-info {
  flex: 1;
}

.fmd-tadam-budget-label {
  display: block;
  font-size: 0.9rem;
  color: #92400e;
  margin-bottom: 4px;
}

.fmd-tadam-budget-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: #78350f;
}

.fmd-tadam-budget-hint {
  display: block;
  font-size: 0.8rem;
  color: #a16207;
}

/* Attestation Section */
.fmd-attestation-section {
  margin-bottom: 24px;
}

.fmd-attestation-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: #1e293b;
}

.fmd-attestation-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
}

.fmd-attestation-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
}

.fmd-attestation-warning .fmd-attestation-icon {
  color: #f59e0b;
}

.fmd-attestation-success {
  background: #d1fae5;
  border: 1px solid #10b981;
}

.fmd-attestation-success .fmd-attestation-icon {
  color: #10b981;
}

.fmd-attestation-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.fmd-attestation-content h5 {
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.fmd-attestation-content p {
  margin: 0 0 16px 0;
  font-size: 0.9rem;
  color: #64748b;
}

/* Legal Info */
.fmd-legal-info {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #64748b;
}

.fmd-legal-info i {
  color: #94a3b8;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Modal styles */
.fmd-sign-intro {
  margin-bottom: 16px;
  color: #64748b;
}

.fmd-sign-checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.fmd-sign-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
}

.fmd-sign-checklist li i {
  color: #10b981;
  margin-top: 3px;
}

.fmd-sign-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  cursor: pointer;
}

.fmd-sign-checkbox input {
  margin-top: 3px;
}

/* Responsive */
@media (max-width: 640px) {
  .fmd-summary-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .fmd-total-info {
    text-align: center;
  }

  .fmd-pockets-grid {
    grid-template-columns: 1fr;
  }

  .fmd-tadam-budget {
    flex-direction: column;
    text-align: center;
  }

  .fmd-attestation-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   STYLES FACTURATION & STRIPE
   ============================================ */

/* Portail Stripe */
.billing-stripe-portal {
  margin-bottom: 24px;
}

.stripe-portal-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px solid #c7d2fe;
  border-radius: 16px;
}

.stripe-portal-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #635bff, #4f46e5);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.stripe-portal-info {
  flex: 1;
}

.stripe-portal-info h4 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: #1e293b;
}

.stripe-portal-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

/* Subscription Summary */
.billing-subscription-summary {
  margin-bottom: 24px;
}

.billing-subscription-summary h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
  color: #1e293b;
}

.subscription-card {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  border-radius: 12px;
}

.subscription-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscription-label {
  font-size: 0.8rem;
  color: #065f46;
}

.subscription-date,
.subscription-amount {
  font-size: 1.1rem;
  font-weight: 600;
  color: #047857;
}

/* Invoices Section */
.billing-invoices-section {
  margin-bottom: 20px;
}

.invoices-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.invoices-header h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  color: #1e293b;
}

.invoices-filter select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #374151;
  background: white;
  cursor: pointer;
}

/* Invoices List */
.invoices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.invoices-loading,
.invoices-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #94a3b8;
}

.invoices-loading .loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary, #D4AF37);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.invoices-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: #cbd5e1;
}

/* Invoice Card */
.invoice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: box-shadow 0.2s;
}

.invoice-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.invoice-month-badge {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.invoice-month-badge .month {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.invoice-month-badge .year {
  font-size: 0.65rem;
  color: #94a3b8;
}

.invoice-info {
  flex: 1;
}

.invoice-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.invoice-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
}

.invoice-detail-chip.subscription { background: #dbeafe; color: #1d4ed8; }
.invoice-detail-chip.accessory { background: #ede9fe; color: #6d28d9; }
.invoice-detail-chip.service { background: #fef3c7; color: #b45309; }
.invoice-detail-chip.deposit { background: #d1fae5; color: #047857; }

.invoice-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-right: 12px;
}

.invoice-status {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
}

.invoice-status.paid {
  background: #d1fae5;
  color: #047857;
}

.invoice-status.pending {
  background: #fef3c7;
  color: #b45309;
}

.invoice-status.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.invoice-actions {
  display: flex;
  gap: 8px;
}

.invoice-action-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.invoice-action-btn:hover {
  background: #f8fafc;
  color: var(--primary, #D4AF37);
  border-color: var(--primary, #D4AF37);
}

/* Billing Legend */
.billing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #64748b;
}

.legend-item i {
  font-size: 0.9rem;
}

/* Responsive Billing */
@media (max-width: 640px) {
  .stripe-portal-card {
    flex-direction: column;
    text-align: center;
  }

  .subscription-card {
    flex-direction: column;
    gap: 12px;
  }

  .invoice-card {
    flex-wrap: wrap;
  }

  .invoice-amount {
    margin-right: 0;
    width: 100%;
    text-align: right;
  }
}

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