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

body {
  font-family: 'Satoshi', sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
  background-attachment: fixed;
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #ffffff;
  overflow: hidden;
}

/* Background animé */
.auth-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  z-index: 1;
  margin: 0 auto;
}

.auth-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(244, 208, 63, 0.1));
  filter: blur(60px);
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 250px;
  height: 250px;
  bottom: -50px;
  right: -50px;
  animation-delay: 5s;
}

.shape-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.1);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* Carte d'authentification */
.auth-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.6s ease-out;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.auth-card::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

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

.create-card {
  max-width: 600px;
}

/* Header */
.auth-header {
  text-align: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.logo-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 90, 95, 0.1);
  border-radius: 16px;
  margin-bottom: 0.75rem;
  border: 2px solid rgba(212, 175, 55, 0.2);
  transition: transform 0.3s ease;
}

.logo-wrapper:hover {
  transform: scale(1.05) rotate(5deg);
}

.auth-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 400;
}

/* Contenu */
.auth-content {
  margin-bottom: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Formulaire */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 0.75rem;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: 'Satoshi', sans-serif;
  outline: none;
  transition: all 0.3s ease;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: rgba(239, 68, 68, 0.5);
}

.form-group .error-message {
  display: none;
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.875rem;
  animation: shake 0.3s ease;
}

.error-message[style*="display: block"] {
  display: block;
}

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

.username-preview {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #6ee7b7;
  font-size: 0.875rem;
}

.username-preview[style*="display: block"] {
  display: block;
}

/* Réduire la taille du captcha Turnstile */
.cf-turnstile {
  transform: scale(0.9);
  transform-origin: left top;
  margin-bottom: 0.25rem;
}

.form-group .cf-turnstile {
  transform: scale(0.85);
  transform-origin: left top;
}

/* Bouton principal */
.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  margin-top: 0.25rem;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

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

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

.btn-primary svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.btn-primary:hover:not(:disabled) svg {
  transform: translateX(5px);
}

/* Bouton Discord */
.btn-discord {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-discord::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-discord:hover::before {
  width: 300px;
  height: 300px;
}

.btn-discord:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.5);
}

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

.btn-discord svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.btn-discord span {
  position: relative;
  z-index: 1;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 0.75rem 0;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
}

/* Footer text */
.auth-footer-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.auth-link {
  color: #d4af37;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
  position: relative;
}

.auth-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #d4af37;
  transition: width 0.3s ease;
}

.auth-link:hover {
  color: #f4d03f;
}

.auth-link:hover::after {
  width: 100%;
}

/* Security badge */
.auth-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.auth-security svg {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.6);
}

/* Input prefix */
.input-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.input-with-prefix {
  position: relative;
}

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

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 0.75rem;
  }

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

  .auth-card {
    padding: 1.25rem;
    max-height: calc(100vh - 1.5rem);
  }

  .auth-title {
    font-size: 1.35rem;
  }

  .auth-subtitle {
    font-size: 0.8rem;
  }

  .form-group input {
    padding: 0.7rem;
    font-size: 0.875rem;
  }

  .btn-primary,
  .btn-discord {
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
  }

  .cf-turnstile {
    transform: scale(0.8);
  }

  .form-group .cf-turnstile {
    transform: scale(0.75);
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .auth-card {
    padding: 1rem;
    max-height: calc(100vh - 1rem);
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .logo-wrapper {
    width: 56px;
    height: 56px;
  }

  .auth-logo {
    width: 36px;
    height: 36px;
  }

  .form-group input {
    padding: 0.65rem;
    font-size: 0.85rem;
  }

  .btn-primary,
  .btn-discord {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .cf-turnstile {
    transform: scale(0.75);
  }

  .form-group .cf-turnstile {
    transform: scale(0.7);
  }
}

/* Animations de chargement */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
