/**
 * Styles pour l'application d'inscriptions UNSA BFC
 * Version 6.0 - Design avec logo UNSA sur chaque événement
 * Préfixe unique : unsaevt- (unsa events)
 */

:root {
  /* Couleurs principales */
  --unsaevt-primary: #4F46E5;
  --unsaevt-primary-hover: #1c13b2;
  --unsaevt-primary-light: #ffffff;
  --unsaevt-primary-dark: #020098;

  /* Couleurs secondaires */
  --unsaevt-secondary: #10B981;
  --unsaevt-secondary-hover: #00864e;
  --unsaevt-secondary-light: #f5ffff;

  /* Accent */
  --unsaevt-accent: #F59E0B;
  --unsaevt-accent-hover: #c26b00;

  /* Neutres */
  --unsaevt-gray-50: #F9FAFB;
  --unsaevt-gray-100: #F3F4F6;
  --unsaevt-gray-200: #E5E7EB;
  --unsaevt-gray-300: #D1D5DB;
  --unsaevt-gray-400: #9CA3AF;
  --unsaevt-gray-500: #6B7280;
  --unsaevt-gray-600: #4B5563;
  --unsaevt-gray-700: #374151;
  --unsaevt-gray-800: #1F2937;
  --unsaevt-gray-900: #111827;

  /* Statuts */
  --unsaevt-success: #10B981;
  --unsaevt-danger: #EF4444;
  --unsaevt-warning: #F59E0B;
  --unsaevt-info: #3B82F6;

  /* Typographie */
  --unsaevt-font-family: 'Inter', -apple-system, sans-serif;
  --unsaevt-font-size-base: 16px;
  --unsaevt-line-height: 1.5;

  /* Espacements & rayons */
  --unsaevt-spacing: 1rem;
  --unsaevt-radius: 8px;
  --unsaevt-radius-lg: 12px;
  --unsaevt-radius-xl: 16px;

  /* Ombres */
  --unsaevt-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --unsaevt-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --unsaevt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --unsaevt-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --unsaevt-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --unsaevt-transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --unsaevt-transition-fast: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--unsaevt-font-family);
  font-size: var(--unsaevt-font-size-base);
  line-height: var(--unsaevt-line-height);
  color: var(--unsaevt-gray-900);
  background: linear-gradient(135deg, var(--unsaevt-gray-50) 0%, var(--unsaevt-gray-100) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Container principal */
.unsaevt-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header minimaliste V6 */
.unsaevt-header-minimal {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2.5rem 4rem 2.5rem 2rem;
  position: relative;
  /* Pas de fond blanc, pas de bordure */
}

.unsaevt-header-minimal-title {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--unsaevt-gray-900);
  max-width: 1100px;
  margin: 0 auto;
}

/* Bouton admin minimaliste - EN HAUT À DROITE */
.unsaevt-admin-btn-minimal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: var(--unsaevt-gray-100);
  border: none;
  border-radius: var(--unsaevt-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--unsaevt-transition);
  color: var(--unsaevt-gray-500);
  text-decoration: none;
  z-index: 10;
  opacity: 0.5;
}

.unsaevt-admin-btn-minimal svg {
  width: 18px;
  height: 18px;
}

.unsaevt-admin-btn-minimal:hover {
  background: var(--unsaevt-primary);
  color: white;
  opacity: 1;
  box-shadow: var(--unsaevt-shadow-md);
}

/* Grille des événements */
.unsaevt-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Carte événement avec logo UNSA */
.unsaevt-event-card {
  background: white;
  border-radius: var(--unsaevt-radius-xl);
  padding: 2rem;
  box-shadow: var(--unsaevt-shadow);
  transition: var(--unsaevt-transition);
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.unsaevt-event-card:hover:not(.disabled) {
  transform: translateY(-6px);
  box-shadow: var(--unsaevt-shadow-xl);
  border-color: var(--unsaevt-primary);
}

.unsaevt-event-card.disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--unsaevt-gray-50);
}

.unsaevt-event-card.disabled:hover {
  transform: none;
  box-shadow: var(--unsaevt-shadow);
}

/* Container pour logo UNSA + icône calendrier */
.unsaevt-event-header-icons {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
}

/* Logo UNSA sur la carte - RÉDUIT */
.unsaevt-event-logo {
  display: flex;
  align-items: center;
}

.unsaevt-event-logo-img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Icône calendrier à droite du logo */
.unsaevt-event-calendar-icon {
  width: 32px;
  height: 32px;
  background: var(--unsaevt-gray-100);
  border-radius: var(--unsaevt-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--unsaevt-gray-600);
}

.unsaevt-event-calendar-icon svg {
  width: 18px;
  height: 18px;
}

/* Status de l'événement */
.unsaevt-event-status {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1;
}

.unsaevt-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: unsaevt-pulse 2s infinite;
}

.unsaevt-event-status.open {
  background: var(--unsaevt-secondary-light);
  color: var(--unsaevt-success);
}

.unsaevt-event-status.open .unsaevt-status-indicator {
  background: var(--unsaevt-success);
}

.unsaevt-event-status.closed {
  background: var(--unsaevt-gray-100);
  color: var(--unsaevt-gray-600);
}

.unsaevt-event-status.closed .unsaevt-status-indicator {
  background: var(--unsaevt-gray-600);
  animation: none;
}

@keyframes unsaevt-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Titre événement */
.unsaevt-event-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--unsaevt-gray-900);
  line-height: 1.4;
  margin-top: 2.5rem;
}

/* Description événement */
.unsaevt-event-description {
  color: var(--unsaevt-gray-600);
  line-height: 1.6;
  flex-grow: 1;
}

/* Meta informations */
.unsaevt-event-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--unsaevt-gray-200);
}

.unsaevt-event-meta-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--unsaevt-gray-600);
  font-size: 0.9375rem;
}

.unsaevt-event-meta-item svg {
  width: 18px;
  height: 18px;
  color: var(--unsaevt-primary);
  flex-shrink: 0;
}

/* CTA inscription */
.unsaevt-event-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--unsaevt-primary);
  color: white;
  border-radius: var(--unsaevt-radius);
  font-weight: 600;
  margin-top: 0.5rem;
  transition: var(--unsaevt-transition);
}

.unsaevt-event-cta svg {
  width: 20px;
  height: 20px;
}

.unsaevt-event-card:hover:not(.disabled) .unsaevt-event-cta {
  background: var(--unsaevt-primary-hover);
  transform: translateX(4px);
}

/* État vide */
.unsaevt-empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: var(--unsaevt-radius-xl);
  box-shadow: var(--unsaevt-shadow-md);
  max-width: 600px;
  margin: 0 auto;
}

.unsaevt-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  background: var(--unsaevt-gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--unsaevt-gray-400);
}

.unsaevt-empty-icon svg {
  width: 40px;
  height: 40px;
}

.unsaevt-empty-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--unsaevt-gray-900);
  margin-bottom: 0.75rem;
}

.unsaevt-empty-text {
  color: var(--unsaevt-gray-600);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Modal */
.unsaevt-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 1rem;
}

.unsaevt-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.unsaevt-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: unsaevt-fadeIn 0.2s ease-out;
}

.unsaevt-modal-content {
  position: relative;
  background: white;
  border-radius: var(--unsaevt-radius-xl);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--unsaevt-shadow-xl);
  animation: unsaevt-slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

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

@keyframes unsaevt-slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header modal */
.unsaevt-modal-header {
  padding: 2rem;
  border-bottom: 1px solid var(--unsaevt-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.unsaevt-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--unsaevt-primary), var(--unsaevt-primary-dark));
}

.unsaevt-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--unsaevt-gray-900);
}

.unsaevt-modal-close {
  background: none;
  border: none;
  color: var(--unsaevt-gray-400);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--unsaevt-radius);
  transition: var(--unsaevt-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.unsaevt-modal-close svg {
  width: 24px;
  height: 24px;
}

.unsaevt-modal-close:hover {
  background: var(--unsaevt-gray-100);
  color: var(--unsaevt-gray-900);
}

/* Formulaire */
.unsaevt-form {
  padding: 2rem;
}

.unsaevt-form-group {
  margin-bottom: 1.5rem;
}

.unsaevt-form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--unsaevt-gray-700);
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
}

.unsaevt-form-label svg {
  width: 18px;
  height: 18px;
  color: var(--unsaevt-primary);
}

.unsaevt-form-input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--unsaevt-gray-200);
  border-radius: var(--unsaevt-radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--unsaevt-transition);
  background: white;
}

.unsaevt-form-input:focus {
  outline: none;
  border-color: var(--unsaevt-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.unsaevt-form-input.error {
  border-color: var(--unsaevt-danger);
}

.unsaevt-form-input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.unsaevt-form-error {
  display: none;
  color: var(--unsaevt-danger);
  font-size: 0.875rem;
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--unsaevt-radius);
  border-left: 3px solid var(--unsaevt-danger);
  align-items: flex-start;
  gap: 0.625rem;
}

.unsaevt-form-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.unsaevt-form-error.active {
  display: flex;
  animation: unsaevt-shake 0.3s ease-in-out;
}

@keyframes unsaevt-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.unsaevt-form-success {
  display: none;
  color: var(--unsaevt-success);
  font-size: 0.875rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--unsaevt-secondary-light);
  border-radius: var(--unsaevt-radius);
  border-left: 3px solid var(--unsaevt-success);
  align-items: center;
  gap: 0.625rem;
}

.unsaevt-form-success svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.unsaevt-form-success.active {
  display: flex;
  animation: unsaevt-slideDown 0.3s ease-out;
}

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

/* Boutons */
.unsaevt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--unsaevt-radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--unsaevt-transition);
  text-decoration: none;
  width: 100%;
}

.unsaevt-btn svg {
  width: 20px;
  height: 20px;
}

.unsaevt-btn-primary {
  background: var(--unsaevt-primary);
  color: white;
}

.unsaevt-btn-primary:hover:not(:disabled) {
  background: var(--unsaevt-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--unsaevt-shadow-lg);
}

.unsaevt-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Spinner de chargement */
.unsaevt-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: unsaevt-spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 1200px) {
  .unsaevt-header-minimal-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .unsaevt-container {
    padding: 1rem;
  }
  
  .unsaevt-header-minimal {
    padding: 2rem 1rem;
    margin-bottom: 2rem;
  }
  
  .unsaevt-header-minimal-title {
    font-size: 1.25rem;
    line-height: 1.3;
  }
  
  .unsaevt-admin-btn-minimal {
    width: 32px;
    height: 32px;
    top: 0.75rem;
    right: 0.75rem;
  }
  
  .unsaevt-admin-btn-minimal svg {
    width: 16px;
    height: 16px;
  }
  
  .unsaevt-events-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .unsaevt-event-card {
    padding: 1.5rem;
  }
  
  .unsaevt-event-header-icons {
    top: 1rem;
    left: 1rem;
    gap: 0.5rem;
  }
  
  .unsaevt-event-logo-img {
    height: 32px;
  }
  
  .unsaevt-event-calendar-icon {
    width: 28px;
    height: 28px;
  }
  
  .unsaevt-event-calendar-icon svg {
    width: 16px;
    height: 16px;
  }
  
  .unsaevt-event-title {
    margin-top: 2.25rem;
    font-size: 1.125rem;
  }
  
  .unsaevt-modal-content {
    margin: 1rem;
  }
  
  .unsaevt-modal-header,
  .unsaevt-form {
    padding: 1.5rem;
  }
  
  .unsaevt-empty-state {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .unsaevt-header-minimal {
    padding: 1.5rem 0.875rem;
  }
  
  .unsaevt-header-minimal-title {
    font-size: 1.125rem;
  }
  
  .unsaevt-event-card {
    padding: 1.25rem;
  }
  
  .unsaevt-event-header-icons {
    top: 0.875rem;
    left: 0.875rem;
    gap: 0.5rem;
  }
  
  .unsaevt-event-logo-img {
    height: 28px;
  }
  
  .unsaevt-event-calendar-icon {
    width: 26px;
    height: 26px;
  }
  
  .unsaevt-event-calendar-icon svg {
    width: 14px;
    height: 14px;
  }
  
  .unsaevt-event-status {
    top: 1rem;
    right: 1rem;
    padding: 0.325rem 0.75rem;
    font-size: 0.6875rem;
  }
  
  .unsaevt-event-title {
    margin-top: 2rem;
  }
}
