/* Styles pour la page login/register fusionnée avec effet flip */
/* Compatible avec l'identité visuelle idbook (global.css) */

.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  font-family: 'Quicksand', sans-serif;
}

/* Flip Card Container */
.flip-card {
  background-color: transparent;
  width: 100%;
  max-width: 450px;
  height: auto;
  min-height: 600px;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 600px;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  min-height: 600px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 20px;
  background: var(--container-background);
  box-shadow: 0 20px 60px var(--container-shadow);
  border: 2px solid var(--border-color);
  overflow: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Auth Form */
.auth-form {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 40px;
}

.auth-header {
  margin-bottom: 30px;
}

.auth-header h2 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Messages */
.auth-message {
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  text-align: center;
}

.auth-message.error {
  background-color: #ffe6e6;
  border: 2px solid #e74c3c;
  color: #c0392b;
}

.auth-message.success {
  background-color: #e6ffe6;
  border: 2px solid #27ae60;
  color: #27ae60;
}

/* Social Auth */
.social-auth {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.google-auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.google-auth-wrapper iframe {
  border-radius: 10px;
  overflow: hidden;
  width: 100% !important;
}

.btn-social {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 50px;
}

.btn-social:hover:not(:disabled) {
  background-color: var(--border-color);
  transform: translateY(-2px);
}

.btn-social:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-facebook {
  background-color: #1877f2;
  color: white;
  border-color: #1877f2;
}

.btn-facebook:hover:not(:disabled) {
  background-color: #0d5bb3;
  border-color: #0d5bb3;
}

.btn-facebook i {
  font-size: 1.2rem;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.divider span {
  padding: 0 15px;
  background: var(--container-background);
}

/* Email Toggle Button */
.btn-email-toggle {
  width: 100%;
  padding: 14px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px var(--container-shadow);
}

.btn-email-toggle:hover {
  background-color: var(--button-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--container-shadow);
}

.btn-email-toggle i {
  font-size: 1.1rem;
}

/* Form Content */
.auth-form-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-group label i {
  margin-right: 10px;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.form-group input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Quicksand', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input::placeholder {
  color: var(--text-secondary);
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 14px 30px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--container-shadow);
}

.btn-primary:hover {
  background-color: var(--button-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--container-shadow);
}

.form-footer {
  margin-top: 15px;
  text-align: center;
}

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

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

/* Switch Form */
.switch-form {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.switch-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 12px 24px;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 12px var(--container-shadow);
}

.switch-btn:hover {
  background-color: var(--button-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--container-shadow);
}

/* Responsive */
@media (max-width: 768px) {
  .auth-container {
    padding: 20px 15px;
  }

  .auth-form {
    padding: 30px 20px;
  }

  .auth-header h2 {
    font-size: 1.5rem;
  }

  .btn-primary {
    width: 100%;
  }

  .forgot-password {
    text-align: center;
  }
}

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

  .form-group input {
    padding: 12px;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: var(--container-background);
  border-radius: 20px;
  box-shadow: 0 20px 60px var(--container-shadow), 0 0 0 1px rgba(52, 152, 219, 0.1);
  border: 2px solid var(--border-color);
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
  backdrop-filter: blur(10px);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--container-background) 0%, rgba(52, 152, 219, 0.05) 100%);
}

.modal-header h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-close {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.modal-close:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: rotate(90deg);
}

.modal-form {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-form .form-group label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.modal-form .form-group label i {
  margin-right: 10px;
  color: var(--primary-color);
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.modal-form .form-group input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Quicksand', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.modal-form .form-group input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal-form .form-group input::placeholder {
  color: var(--text-secondary);
}

.modal-form .btn-primary {
  width: 100%;
  padding: 14px 30px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--container-shadow);
}

.modal-form .btn-primary:hover {
  background-color: var(--button-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--container-shadow);
}

.modal-form .form-footer {
  margin-top: 15px;
  text-align: center;
}

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

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