/* Connexion Admin CSS - Design Moderne et Polyvalent */

:root {
  /* Couleurs principales - Charte Goo-school */
  --primary: #0078e9;
  --primary-dark: #0056b3;
  --primary-light: #3b82f6;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #06b6d4;

  /* Couleurs de texte */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --text-white: #ffffff;

  /* Couleurs de fond */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #0078e9 0%, #3f37c9 100%);
  --bg-welcome: linear-gradient(135deg, #0078e9 0%, #ccccd3 50%, #f0f4f9 100%);

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

  /* Bordures */
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Pattern */
.background-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.pattern-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.circle-1 {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.circle-3 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.pattern-dots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 1px
  );
  background-size: 50px 50px;
  animation: moveDots 20s linear infinite;
}

/* Animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes moveDots {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50px);
  }
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 120, 233, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 120, 233, 0.6);
  }
}

/* Container principal */
.connexion-container {
  position: relative;
  z-index: 1;
 display: flex;
 flex-wrap: wrap;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 4rem;
}

/* Section de bienvenue */
.welcome-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeInUp 1s ease-out;
}

.welcome-content {
  text-align: center;
  max-width: 500px;
}

.school-logo {
  margin-bottom: 2rem;
}

.logo-container {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #0078e9, #3f37c9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
  animation: pulse 3s ease-in-out infinite;
}

.logo-container i {
  font-size: 3rem;
  color: white;
  z-index: 2;
}

.logo-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(135deg, #0078e9, #3f37c9);
  border-radius: 50%;
  opacity: 0.3;
  animation: glow 2s ease-in-out infinite;
}

.welcome-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(100deg, #eeeeee, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.highlight {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.welcome-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-weight: 400;
}

/* Types d'utilisateurs */
.user-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.user-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  cursor: pointer;
}

.user-type:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

.user-type i {
  font-size: 2rem;
  color: white;
  margin-bottom: 0.5rem;
}

.user-type span {
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Carte de connexion */
.connexion-card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUp 1s ease-out 0.3s both;
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
}

.card-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 20s linear infinite;
}

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

.header-icon {
  position: relative;
  z-index: 2;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  backdrop-filter: blur(10px);
}

.header-icon i {
  font-size: 1.5rem;
}

.card-header h2 {
  position: relative;
  z-index: 2;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-header p {
  position: relative;
  z-index: 2;
  opacity: 0.9;
  font-size: 1rem;
}

.card-body {
  padding: 2.5rem;
  background-color: var(--text-white);
}

/* Messages flash */
.messages-container {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 1rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  animation: fadeInUp 0.5s ease-out;
}

.alert-success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  border: 1px solid #f87171;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fbbf24;
}

.alert-info {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border: 1px solid #60a5fa;
}

.alert i {
  font-size: 1.25rem;
}

/* Formulaire */
.form-section {
  margin-bottom: 1.5rem;
}

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

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: rgb(44, 44, 44);
  font-size: 0.95rem;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-light);
  z-index: 2;
  transition: var(--transition);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="tel"] {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--bg-primary);
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
}

/* Styles spécifiques pour les champs de type date */
input[type="date"] {
  position: relative;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 1rem;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition);
  z-index: 1;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  transform: scale(1.1);
}

input[type="date"]:focus::-webkit-calendar-picker-indicator {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(27%) sepia(95%) saturate(1352%) hue-rotate(199deg) brightness(97%) contrast(96%);
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none;
}

/* Styles spécifiques pour les champs de type tel */
input[type="tel"] {
  letter-spacing: 0.5px;
}

input[type="tel"]::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

input[type="date"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 120, 233, 0.1);
  transform: translateY(-2px);
}

input:focus + .input-icon,
.input-container:focus-within .input-icon {
  color: var(--primary);
  transform: scale(1.1);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
  z-index: 2;
}

.toggle-password:hover {
  color: var(--primary);
}

/* Options du formulaire */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.remember-me input[type="checkbox"] {
  transform: scale(1.2);
  accent-color: var(--primary);
}

.remember-me label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.forgot-password {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.forgot-password:hover {
  text-decoration: underline;
  color: var(--secondary);
}

/* Bouton de connexion */
.form-actions {
  margin-top: 2rem;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 120, 233, 0.4);
}

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

/* Footer de la carte */
.card-footer {
  text-align: center;
  padding: 1.5rem 2.5rem;
  border-top: 1px solid #e5e7eb;
  background: var(--bg-secondary);
}

.card-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.card-footer a:hover {
  text-decoration: underline;
  color: var(--secondary);
}

.alt-login-professeurs {
  margin: 1.5rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.alt-login-professeurs a {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.alt-login-professeurs a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Éléments flottants */
.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floating-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: float 8s ease-in-out infinite;
}

.floating-icon i {
  color: white;
  font-size: 1.2rem;
}

.icon-1 {
  top: 20%;
  left: 5%;
  animation-delay: 0s;
}

.icon-2 {
  top: 30%;
  right: 10%;
  animation-delay: 2s;
}

.icon-3 {
  bottom: 30%;
  left: 8%;
  animation-delay: 4s;
}

.icon-4 {
  bottom: 20%;
  right: 5%;
  animation-delay: 6s;
}

/* États des champs */
.has-error .input-container {
  border-color: var(--error) !important;
  background-color: #fef2f2;
}

.error-message {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .connexion-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem;
    justify-content: center;
  }

  .welcome-section {
    order: 2;
    padding: 1rem;
  }

  .connexion-card {
    order: 1;
    max-width: 100%;
    margin: 0 auto;
  }

  .welcome-title {
    font-size: 2.5rem;
  }

  .user-types {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .user-type {
    padding: 1rem;
  }

  .user-type i {
    font-size: 1.5rem;
  }

  .user-type span {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .connexion-container {
    padding: 0.5rem;
    justify-content: center;
  }

  .welcome-title {
    font-size: 2rem;
  }

  .welcome-subtitle {
    font-size: 1.1rem;
  }

  .card-body {
    padding: 2rem;
  }

  .card-footer {
    padding: 1.5rem 2rem;
  }

  .user-types {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .floating-elements {
    display: none;
  }
}

@media (max-width: 480px) {
  .welcome-title {
    font-size: 1.75rem;
  }

  .logo-container {
    width: 100px;
    height: 100px;
  }

  .logo-container i {
    font-size: 2.5rem;
  }

  .card-body {
    padding: 1.5rem;
  }

  .card-footer {
    padding: 1rem 1.5rem;
  }

  .user-types {
    grid-template-columns: 1fr;
  }
}

/* Animations d'entrée */
.connexion-card {
  animation: fadeInUp 1s ease-out 0.3s both;
  margin: 0 auto;
}

.welcome-section {
  animation: fadeInUp 1s ease-out;
}

.user-type {
  animation: fadeInUp 0.6s ease-out;
}

.user-type:nth-child(1) {
  animation-delay: 0.1s;
}
.user-type:nth-child(2) {
  animation-delay: 0.2s;
}
.user-type:nth-child(3) {
  animation-delay: 0.3s;
}
.user-type:nth-child(4) {
  animation-delay: 0.4s;
}

/* Amélioration de l'accessibilité */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
  }

  .connexion-card {
    margin: 0 auto;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  input[type="text"],
  input[type="password"],
  input[type="date"],
  input[type="tel"] {
    background-color: var(--bg-primary);
    border-color: #374151;
    color: var(--text-primary);
  }

  input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
  }

  input[type="date"]:focus::-webkit-calendar-picker-indicator {
    opacity: 1;
  }
}
