/* ===== Variables spécifiques upload ===== */
:root {
  --color-upload: #0066cc;
  --color-upload-light: #e6f2ff;
  --color-upload-dark: #0052a3;
  --color-success: #28a745;
  --color-success-light: #d4edda;
  --color-warning: #ffc107;
  --color-warning-light: #fff3cd;
  --color-error: #dc3545;
  --color-error-light: #f8d7da;
  
  /* Animation */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ===== Instructions de paiement ===== */
.payment-instructions {
  margin-bottom: var(--space-2xl);
}

.instruction-card {
  background: white;
  border-radius: 8px;
  padding: var(--space-xl);
  border-left: 4px solid #0066cc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.4s ease-out;
}

.iban-instructions {
  border-left-color: #28a745;
}

.paypal-instructions {
  border-left-color: #003087;
}

.instruction-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid #eee;
}

.instruction-icon {
  font-size: 24px;
  line-height: 1;
}

.instruction-title {
  font-size: 18px;
  color: #222;
  margin: 0;
}

.instruction-steps {
  margin: 0 0 var(--space-lg) 0;
  padding-left: var(--space-lg);
}

.instruction-steps li {
  margin-bottom: var(--space-md);
  line-height: 1.6;
  color: #333;
}

.instruction-steps li:last-child {
  margin-bottom: 0;
}

.bank-details {
  background: #f5f5f5;
  border-radius: 4px;
  padding: var(--space-lg);
  margin-top: var(--space-md);
}

.bank-detail {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid #ddd;
}

.bank-detail:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.bank-detail.highlight {
  background: white;
  padding: var(--space-md);
  border-radius: 4px;
  border: 1px solid #ddd;
}

.detail-label {
  font-weight: 600;
  color: #555;
  min-width: 120px;
}

.detail-value {
  color: #222;
  flex: 1;
  word-break: break-all;
}

.iban-value {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.instruction-note {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-warning-light);
  border-radius: 4px;
  border: 1px solid var(--color-warning);
}

.note-icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.instruction-note p {
  margin: 0;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}

/* ===== Zone d'upload ===== */
.upload-section {
  margin-bottom: var(--space-2xl);
}

.upload-section-title {
  font-size: 20px;
  color: #222;
  margin-bottom: var(--space-lg);
  text-align: center;
}

.upload-area-container {
  max-width: 600px;
  margin: 0 auto;
}

.upload-area {
  min-height: 280px;
  border: 3px dashed #ccc;
  border-radius: 8px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: #0066cc;
  background: #e6f2ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upload-area:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px #e6f2ff;
}

.upload-area.drag-over {
  border-color: #28a745;
  background: #d4edda;
  transform: scale(1.02);
}

.upload-area.has-error {
  border-color: #dc3545;
  background: #f8d7da;
}

.upload-area.has-file {
  border-color: #28a745;
  background: #d4edda;
  border-style: solid;
}

/* États d'upload */
.upload-state {
  width: 100%;
  text-align: center;
  transition: all 0.25s ease;
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.upload-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-svg {
  width: 40px;
  height: 40px;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.upload-title {
  font-size: 18px;
  color: #222;
  margin: 0;
}

.upload-instructions {
  color: #666;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

.upload-click {
  display: inline-block;
  color: #0066cc;
  font-weight: 600;
  text-decoration: underline;
  margin-top: var(--space-xs);
}

.upload-requirements {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.requirement {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: #666;
  font-size: 14px;
}

.requirement-icon {
  font-size: 16px;
  line-height: 1;
}

/* Preview fichier */
.upload-has-file {
  width: 100%;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

.file-icon {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0066cc;
  flex-shrink: 0;
}

.file-svg {
  width: 32px;
  height: 32px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 16px;
  color: #222;
  margin: 0 0 var(--space-xs) 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details {
  display: flex;
  gap: var(--space-md);
  font-size: 14px;
  color: #666;
}

.file-actions {
  display: flex;
  gap: var(--space-sm);
}

.file-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #e9ecef;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.file-action-btn:hover {
  transform: scale(1.1);
}

.file-remove:hover {
  background: #dc3545;
  color: white;
}

.file-change:hover {
  background: #0066cc;
  color: white;
}

.remove-svg,
.change-svg {
  width: 20px;
  height: 20px;
}

/* Progress bar */
.upload-progress {
  margin-top: var(--space-lg);
  animation: fadeIn 0.3s ease-out;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0066cc, #28a745);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
}

#progressPercent {
  font-weight: 600;
  color: #0066cc;
}

/* Messages d'upload */
.upload-error,
.upload-success {
  margin-top: var(--space-md);
  animation: slideDown 0.3s ease-out;
}

.upload-error {
  background: #f8d7da;
  border-color: #dc3545;
  color: #dc3545;
}

.upload-success {
  background: #d4edda;
  border-color: #28a745;
  color: #28a745;
}

/* ===== Informations complémentaires ===== */
.additional-info-section {
  margin-bottom: var(--space-2xl);
}

.info-section-title {
  font-size: 20px;
  color: #222;
  margin-bottom: var(--space-sm);
  text-align: center;
}

.info-section-subtitle {
  color: #666;
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: 16px;
}

.info-form {
  max-width: 500px;
  margin: 0 auto;
}

/* ===== Validation ===== */
.validation-section {
  background: #f5f5f5;
  border-radius: 8px;
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.checkbox-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.validation-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.validation-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  cursor: pointer;
  font-size: 16px;
  color: #333;
  line-height: 1.4;
}

.checkbox-custom {
  position: relative;
  width: 24px;
  height: 24px;
  border: 2px solid #999;
  border-radius: 4px;
  background: white;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}

.validation-checkbox:checked + .validation-label .checkbox-custom {
  background: #0066cc;
  border-color: #0066cc;
}

.validation-checkbox:checked + .validation-label .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.validation-checkbox:focus + .validation-label .checkbox-custom {
  box-shadow: 0 0 0 3px #e6f2ff;
  border-color: #0066cc;
}

.privacy-note {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: white;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.privacy-icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

.privacy-note p {
  margin: 0;
  color: #555;
  font-size: 14px;
  line-height: 1.4;
}

/* ===== Actions ===== */
.btn-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 56px;
}

.btn-upload:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-upload.loading {
  background: #999;
}

.btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.loading-dots {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
  position: relative;
  animation: dots 1.5s infinite linear;
}

.loading-dots::before,
.loading-dots::after {
  content: '';
  position: absolute;
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
}

.loading-dots::before {
  left: -8px;
  animation: dots 1.5s infinite linear 0.25s;
}

.loading-dots::after {
  right: -8px;
  animation: dots 1.5s infinite linear 0.5s;
}

@keyframes dots {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* ===== Modale de confirmation ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: var(--space-2xl);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
}

.modal-title {
  font-size: 20px;
  color: #222;
  margin-bottom: var(--space-md);
  text-align: center;
}

.modal-description {
  color: #555;
  text-align: center;
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.modal-cancel,
.modal-confirm {
  min-width: 120px;
}

/* ===== Loading Overlay spécifique ===== */
.loading-overlay .loading-content {
  text-align: center;
  margin-top: var(--space-lg);
}

.loading-subtext {
  font-size: 14px;
  color: #666;
  margin-top: var(--space-xs);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #28a745;
  color: white;
  padding: var(--space-md) var(--space-lg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  transition: all 0.25s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-error {
  background: #dc3545;
}

.toast-success {
  background: #28a745;
}

.toast-icon {
  font-size: 18px;
  line-height: 1;
}

.toast-message {
  font-weight: 500;
  font-size: 16px;
}

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* ===== Responsive Breakpoints ===== */

/* Mobile (≥ 480px) */
@media (min-width: 480px) {
  .upload-area {
    min-height: 240px;
  }
  
  .file-preview {
    flex-direction: row;
  }
  
  .btn-action {
    min-height: 56px;
  }
}

/* Tablet (≥ 768px) */
@media (min-width: 768px) {
  .upload-area-container {
    padding: 0 var(--space-xl);
  }
  
  .instruction-steps {
    margin-left: var(--space-xl);
  }
  
  .info-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  
  .form-actions {
    flex-direction: row;
  }
  
  .btn-action {
    min-height: 52px;
  }
}

/* Desktop (≥ 992px) */
@media (min-width: 992px) {
  .upload-section-title,
  .info-section-title {
    text-align: left;
  }
  
  .info-section-subtitle {
    text-align: left;
  }
  
  .btn-action {
    min-height: 48px;
  }
}

/* ===== Section Payment with Details ===== */
.payment-section {
  background: white;
  border-radius: 8px;
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-section .section-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid #f0f0f0;
}

.payment-section .section-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.payment-instruction-box {
  background: #f8f9fa;
  border-left: 4px solid #0066cc;
  padding: var(--space-md) var(--space-lg);
  border-radius: 4px;
  margin-bottom: var(--space-xl);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.instruction-icon {
  flex-shrink: 0;
  color: #0066cc;
  margin-top: 2px;
}

.payment-instruction-box p {
  margin: 0;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

.payment-details-section {
  margin-top: var(--space-lg);
}

.payment-info-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.payment-info-card.iban-card {
  border-top: 4px solid #667eea;
}

.payment-info-card.paypal-card {
  border-top: 4px solid #f39c12;
}

.payment-info-card .card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: var(--space-md) var(--space-lg);
}

.payment-info-card.paypal-card .card-header {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.payment-info-card .card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.payment-info-card .card-content {
  padding: var(--space-lg);
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid #f0f0f0;
  gap: var(--space-md);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #666;
  min-width: 100px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  flex: 1;
  color: #1a1a1a;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.info-value.iban-value {
  letter-spacing: 1px;
  font-weight: 500;
}

.info-value.paypal-value {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


.copy-mini-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0066cc;
  border-radius: 4px;
  transition: all 150ms ease;
  flex-shrink: 0;
  touch-action: manipulation;
  position: relative; /* for tooltip positioning */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Tooltip shown after successful copy */
.copy-tooltip {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: linear-gradient(90deg, #10b981, #059669);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  z-index: 20;
}
.copy-tooltip:after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: inherit;
  transform-origin: center;
  transform: translateX(-50%) rotate(45deg);
}

.copy-mini-btn.copied .copy-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

@media (max-width: 600px), (pointer: coarse) {
  .copy-mini-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    margin-left: 8px;
    margin-right: 4px;
    font-size: 18px;
  }
  .copy-mini-btn svg {
    width: 20px;
    height: 20px;
  }
}

@media (pointer: coarse) {
  /* larger tap targets on touch devices */
  .file-action-btn {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.copy-mini-btn:hover {
  background: #e6f2ff;
  color: #0052a3;
}

.copy-mini-btn:active {
  transform: scale(0.95);
}

.copy-mini-btn svg {
  width: 14px;
  height: 14px;
}

.copy-mini-btn.copied {
  background: linear-gradient(90deg, #10b981, #059669);
  color: #fff;
}

/* ===== Accessibilité ===== */
.upload-area:focus-visible {
  outline: 3px solid #0066cc;
  outline-offset: 2px;
}

.file-action-btn:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* ===== Utilitaires ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.error-message {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #f8d7da;
  border-radius: 4px;
  border: 1px solid #dc3545;
  color: #dc3545;
  font-size: 14px;
  margin-top: var(--space-sm);
}

.success-message {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #d4edda;
  border-radius: 4px;
  border: 1px solid #28a745;
  color: #28a745;
  font-size: 14px;
  margin-top: var(--space-sm);
}

.error-icon,
.success-icon {
  flex-shrink: 0;
  font-weight: bold;
}
