/* ============================================
   MAIN CSS - Styles principaux
   IEF Louga - CFEE 2025-2026
   ============================================ */

/* Import des polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700&display=swap');

/* Import des autres fichiers CSS */
@import 'variables.css';
@import 'reset.css';
@import 'components.css';

/* ===== PAGE DE CONNEXION ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: var(--spacing-md);
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-lg);
  background: var(--primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.login-logo svg {
  width: 48px;
  height: 48px;
  color: var(--white);
}

.login-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.login-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.login-form {
  margin-bottom: var(--spacing-lg);
}

.login-footer {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border);
}

.login-footer-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Input avec icône */
.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-left: 3rem;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

/* Bouton de connexion spécial */
.btn-login {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  padding: 1rem;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  min-height: 52px;
}

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

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

.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Animation de chargement */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== HEADER ===== */
.header {
  background: var(--primary);
  color: var(--white);
  height: var(--header-height);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-padding);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--white);
}

.header-logo {
  width: 40px;
  height: 40px;
  background: var(--white);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
}

.user-role {
  font-size: var(--text-sm);
  opacity: 0.9;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-base);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
  .login-card {
    padding: var(--spacing-xl);
  }
  
  .login-logo {
    width: 60px;
    height: 60px;
  }
  
  .login-logo svg {
    width: 36px;
    height: 36px;
  }
  
  .login-title {
    font-size: var(--text-xl);
  }
  
  .login-subtitle {
    font-size: var(--text-sm);
  }
  
  .header-brand span {
    display: none;
  }
  
  .user-info {
    display: none;
  }
}

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

/* Focus visible pour navigation clavier */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
