/* ============================================
   NEW LOGIN PAGE - SLIDING PANEL DESIGN
   Thème Matiiou Barber (wheat, marron, noir)
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --primary-brown: #5e493a;
  --dark-brown: #3d2e26;
  --wheat-bg: wheat;
  --wheat-light: #f5e6c8;
  --black: #1a1a1a;
  --white: #ffffff;
  --gold: #d4a574;
  --error-red: #dc3545;
  --success-green: #28a745;
}

/* Container Principal */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 100px);
  padding: 40px 20px;
}

.auth-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  min-height: 700px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(94, 73, 58, 0.15);
  overflow: hidden;
}

/* Formulaires */
.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px 40px;
  transition: all 0.6s ease-in-out;
}

.form-container form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-container h1 {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  color: var(--primary-brown);
  margin-bottom: 3px;
  text-align: center;
}

.form-container p.subtitle {
  color: #666;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 10px;
}

/* Sign In Form */
.sign-in {
  left: 0;
  z-index: 2;
}

/* Sign Up Form */
.sign-up {
  left: 0;
  opacity: 0;
  z-index: 1;
}

/* Input Groups */
.input-group {
  position: relative;
  width: 100%;
}

.input-group i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: black;
  font-size: 0.9rem;
  opacity: 0.7;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: "Roboto", sans-serif;
  transition: all 0.3s ease;
  background: var(--white);
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(94, 73, 58, 0.1);
}

.input-group input::placeholder {
  color: #999;
}

/* Select styling */
.input-group select {
  cursor: pointer;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 15px center;
}

/* Boutons */
.auth-btn {
  width: 100%;
  padding: 12px 30px;
  margin-top: 8px;
  margin-bottom: 25px;
  background: linear-gradient(
    135deg,
    var(--primary-brown) 0%,
    var(--dark-brown) 100%
  );
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(94, 73, 58, 0.3);
}

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

/* Remember me & Forgot */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-top: 5px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #666;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-brown);
  cursor: pointer;
}

.forgot-link {
  color: var(--primary-brown);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.forgot-link:hover {
  color: var(--dark-brown);
  text-decoration: underline;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 15px 0;
  color: #999;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

/* Social Login */
.social-login {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-btn {
  width: 45px;
  height: 45px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #666;
  background: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
}

.social-btn:hover {
  border-color: var(--primary-brown);
  color: var(--primary-brown);
  transform: translateY(-2px);
}

/* Toggle Container - Panel coulissant */
.toggle-container {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: all 0.6s ease-in-out;
  border-radius: 20px 0 0 20px;
  z-index: 100;
}

.toggle {
  position: relative;
  width: 200%;
  height: 100%;
  transform: translateX(-50%);
  transition: all 0.6s ease-in-out;
}

.toggle-panel {
  position: absolute;
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background-size: cover;
  background-position: center;
  color: var(--white);
}

.toggle-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5));
}

/* Panneau gauche - visible quand inscription active (bouton "Se connecter") */
.toggle-left {
  left: 0;
  background-image: url("../images/barber 2.jpg");
}

/* Panneau droit - visible par défaut (bouton "S'inscrire") */
.toggle-right {
  left: 50%;
  background-image: url("../images/barber 1.jpg");
}

.toggle-panel img.logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
  position: relative;
  z-index: 1;
}

.toggle-panel h1 {
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
}

.toggle-panel p {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 25px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.toggle-btn {
  padding: 12px 40px;
  background: transparent;
  border: 2px solid var(--white);
  border-radius: 10px;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.toggle-btn:hover {
  background: var(--white);
  color: var(--primary-brown);
  border: 2px solid var(--primary-brown);
}

/* Active State - Animation */
.auth-container.active .sign-in {
  transform: translateX(100%);
  opacity: 0;
  z-index: 1;
}

.auth-container.active .sign-up {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
  animation: slideIn 0.6s;
}

.auth-container.active .toggle-container {
  transform: translateX(-100%);
  border-radius: 0 20px 20px 0;
}

.auth-container.active .toggle {
  transform: translateX(0);
}

.auth-container.active .toggle-left {
  opacity: 1;
}

@keyframes slideIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Messages d'alerte */
.auth-alert {
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.auth-alert.error {
  background: #ffe6e6;
  color: var(--error-red);
  border: 1px solid #ffcccc;
}

.auth-alert.success {
  background: #e6ffe6;
  color: var(--success-green);
  border: 1px solid #ccffcc;
}

.auth-alert.info {
  background: #fff9e6;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* Remembered identifier info */
.remembered-info {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 20px 15px;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border-radius: 8px;
  color: #2e7d32;
  font-size: 0.85em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.4s ease-out;
}

.remembered-info i {
  color: #4caf50;
}

/* Admin access link */
.admin-link {
  margin-top: 15px;
  text-align: center;
  font-size: 0.85rem;
}

.admin-link a {
  color: var(--primary-brown);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s;
}

.admin-link a:hover {
  color: var(--dark-brown);
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .auth-wrapper {
    padding: 20px 10px;
    min-height: 0;
  }

  .auth-container {
    min-height: 0;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    overflow: hidden;
  }

  .form-container {
    position: relative !important;
    width: 100% !important;
    left: 0 !important;
    padding: 30px 20px;
    transform: none !important;
    opacity: 1 !important;
  }

  .form-container form {
    width: 100%;
  }

  .sign-in {
    order: 1;
  }

  .sign-up {
    display: none;
    order: 1;
  }

  .auth-container.active .sign-in {
    display: none;
  }

  .auth-container.active .sign-up {
    display: flex;
  }

  .toggle-container {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
    border-radius: 0 !important;
    order: 2;
  }

  .toggle {
    width: 100% !important;
    height: auto !important;
    transform: none !important;
  }

  .toggle-panel {
    position: relative !important;
    width: 100% !important;
    left: 0 !important;
    height: auto !important;
    padding: 40px 20px;
    transform: none !important;
  }

  .toggle-left,
  .toggle-right {
    display: none !important;
  }

  .auth-container.active .toggle-left {
    display: flex !important;
  }

  .auth-container:not(.active) .toggle-right {
    display: flex !important;
  }

  .toggle-panel h1 {
    font-size: 1.3rem;
  }

  .toggle-panel p {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .toggle-btn {
    padding: 10px 30px;
    font-size: 0.9rem;
  }

  .form-container h1 {
    font-size: 1.5rem;
  }

  .form-container p.subtitle {
    font-size: 0.85rem;
  }

  .input-group input,
  .input-group select {
    padding: 12px 12px 12px 40px;
    font-size: 0.9rem;
  }

  .form-options {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .auth-btn {
    width: 100%;
    padding: 12px;
  }

  .admin-link {
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 15px 10px;
  }

  .form-container {
    padding: 25px 15px;
  }

  .form-container form {
    max-width: 100%;
  }

  .form-container h1 {
    font-size: 1.4rem;
  }

  .toggle-panel {
    padding: 25px 15px;
  }

  .toggle-panel h1 {
    font-size: 1.2rem;
  }

  .toggle-panel p {
    font-size: 0.9rem;
  }

  .auth-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .toggle-btn {
    padding: 10px 25px;
    font-size: 0.85rem;
  }

  .social-login {
    gap: 10px;
  }

  .social-btn {
    width: 40px;
    height: 40px;
  }

  .input-group input,
  .input-group select {
    padding: 10px 10px 10px 35px;
    font-size: 0.85rem;
  }

  .input-group i {
    left: 10px;
    font-size: 0.8rem;
  }
}

/* ============================================
   SUCCESS PAGE STYLES
   ============================================ */

.success-container {
  text-align: center;
  padding: 60px 40px;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--success-green) 0%, #20c997 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  animation: scaleIn 0.5s ease;
}

.success-icon i {
  font-size: 3rem;
  color: var(--white);
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.success-container h1 {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  color: var(--primary-brown);
  margin-bottom: 15px;
}

.success-container p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 10px;
}

.success-container .user-name {
  color: var(--primary-brown);
  font-weight: 600;
}

.success-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.success-actions .btn {
  padding: 12px 25px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.success-actions .btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-brown) 0%,
    var(--dark-brown) 100%
  );
  color: var(--white);
}

.success-actions .btn-secondary {
  background: var(--wheat-bg);
  color: var(--primary-brown);
  border: 2px solid var(--primary-brown);
}

.success-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.redirect-info {
  margin-top: 25px;
  font-size: 0.85rem;
  color: #999;
}

.redirect-info .countdown {
  font-weight: 700;
  color: var(--primary-brown);
}

/* ============================================
   ANIMATIONS PARTICULES ET SUCCÈS/ERREUR
   ============================================ */

/* Particules flottantes */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: rgba(94, 73, 58, 0.2);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
  width: 80px;
  height: 80px;
  left: 10%;
  animation-delay: 0s;
}
.particle:nth-child(2) {
  width: 60px;
  height: 60px;
  left: 20%;
  animation-delay: 1s;
}
.particle:nth-child(3) {
  width: 100px;
  height: 100px;
  left: 35%;
  animation-delay: 2s;
}
.particle:nth-child(4) {
  width: 40px;
  height: 40px;
  left: 50%;
  animation-delay: 1.5s;
}
.particle:nth-child(5) {
  width: 120px;
  height: 120px;
  left: 70%;
  animation-delay: 0.5s;
}
.particle:nth-child(6) {
  width: 50px;
  height: 50px;
  left: 85%;
  animation-delay: 3s;
}

.particle.error {
  background: rgba(220, 53, 69, 0.2);
}

.particle.success {
  background: rgba(40, 167, 69, 0.2);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Container de confirmation */
.confirmation-container {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 50px 40px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  margin: 40px auto;
  position: relative;
  z-index: 2;
  animation: slideUp 0.8s ease-out;
}

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

/* Icône de succès */
.confirmation-container .success-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #4caf50, #45a049);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  animation: bounceIn 1s ease-out;
  box-shadow: 0 10px 25px rgba(76, 175, 80, 0.3);
}

.confirmation-container .success-icon i {
  font-size: 40px;
  color: white;
}

/* Icône d'erreur */
.error-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #f44336, #d32f2f);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  animation: bounceIn 1s ease-out;
  box-shadow: 0 10px 25px rgba(244, 67, 54, 0.3);
}

.error-icon i {
  font-size: 40px;
  color: white;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Étoiles décoratives */
.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.star {
  position: absolute;
  color: #ffd700;
  animation: twinkle 2s infinite;
}

.star:nth-child(1) {
  top: 15%;
  left: 10%;
  animation-delay: 0s;
}
.star:nth-child(2) {
  top: 25%;
  right: 15%;
  animation-delay: 0.5s;
}
.star:nth-child(3) {
  bottom: 20%;
  left: 8%;
  animation-delay: 1s;
}
.star:nth-child(4) {
  bottom: 30%;
  right: 12%;
  animation-delay: 1.5s;
}
.star:nth-child(5) {
  top: 50%;
  left: 5%;
  animation-delay: 2s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Texte de bienvenue */
.welcome-text h1 {
  font-family: "Playfair Display", serif;
  color: #4caf50;
  font-size: 1.8rem;
  margin-bottom: 15px;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.welcome-text h1.error {
  color: #f44336;
}

.welcome-text p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 12px;
  line-height: 1.6;
  animation: fadeInUp 0.8s ease-out 0.7s both;
}

.welcome-text .user-name {
  color: var(--primary-brown);
  font-weight: 700;
}

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

/* Boutons d'action */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

.action-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  border: none;
  border-radius: 25px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-buttons .btn-primary {
  background: linear-gradient(135deg, var(--primary-brown), var(--dark-brown));
  color: white;
  box-shadow: 0 5px 15px rgba(94, 73, 58, 0.3);
}

.action-buttons .btn-secondary {
  background: transparent;
  color: var(--primary-brown);
  border: 2px solid var(--primary-brown);
}

.action-buttons .btn-tercary {
  background: var(--wheat-bg);
  color: var(--primary-brown);
  border: 2px solid var(--gold);
}

.action-buttons .btn-danger {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  box-shadow: 0 5px 15px rgba(244, 67, 54, 0.3);
}

.action-buttons .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Message de redirection automatique */
.auto-redirect {
  margin-top: 25px;
  padding: 12px 20px;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 10px;
  border-left: 4px solid #ffc107;
  animation: fadeInUp 0.8s ease-out 1.1s both;
  font-size: 0.9rem;
  color: #666;
}

.auto-redirect .countdown {
  font-weight: 700;
  color: var(--primary-brown);
  font-size: 1.1rem;
}
