/* ============================================
   JUNSPRO - AUTH MODERN (SaaS Style)
   ============================================ */

/* Reset pour centrer parfaitement */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

:root {
  --auth-primary: #4F46E5;
  --auth-primary-hover: #4338CA;
  --auth-primary-light: #EEF2FF;
  --auth-gray-50: #F9FAFB;
  --auth-gray-100: #F3F4F6;
  --auth-gray-200: #E5E7EB;
  --auth-gray-300: #D1D5DB;
  --auth-gray-400: #9CA3AF;
  --auth-gray-500: #6B7280;
  --auth-gray-600: #4B5563;
  --auth-gray-700: #374151;
  --auth-gray-800: #1F2937;
  --auth-gray-900: #111827;
  --auth-error: #EF4444;
  --auth-error-light: #FEE2E2;
  --auth-success: #10B981;
  --auth-success-light: #D1FAE5;
  --auth-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --auth-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --auth-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --auth-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  --auth-radius: 12px;
  --auth-radius-lg: 20px;
  --auth-radius-full: 9999px;
}

/* ============================================
   CONTAINER
   ============================================ */

.auth-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin: 0;
  background: linear-gradient(135deg, #1e40af 0%, #4c1d95 50%, #7c3aed 100%);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(30, 64, 175, 0.15) 0%, transparent 50%);
  position: relative;
  box-sizing: border-box;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
  opacity: 0.3;
}

.auth-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  z-index: 1;
  margin: 0 auto;
  flex-shrink: 0;
}

.auth-content {
  background: #FFFFFF;
  border-radius: var(--auth-radius-lg);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  padding: 48px 40px;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}

.auth-modal .auth-content {
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.auth-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--auth-gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--auth-gray-600);
  transition: all 0.2s;
  z-index: 10;
}

.auth-close-btn:hover {
  background: var(--auth-gray-200);
  color: var(--auth-gray-900);
}

/* ============================================
   LOGO
   ============================================ */

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo-img {
  height: 52px;
  width: auto;
  max-width: 200px;
}

.auth-logo-text {
  font-size: 32px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.1;
  position: relative;
  display: inline-block;
  text-shadow: 
    -1px -1px 0 rgba(0, 255, 255, 0.5),
    1px 1px 0 rgba(255, 0, 0, 0.5),
    -2px -2px 0 rgba(0, 255, 255, 0.3),
    2px 2px 0 rgba(255, 0, 0, 0.3),
    0 0 10px rgba(255, 255, 255, 0.1);
  animation: chromatic-aberration 3s ease-in-out infinite;
}

@keyframes chromatic-aberration {
  0%, 100% {
    text-shadow: 
      -1px -1px 0 rgba(0, 255, 255, 0.5),
      1px 1px 0 rgba(255, 0, 0, 0.5),
      -2px -2px 0 rgba(0, 255, 255, 0.3),
      2px 2px 0 rgba(255, 0, 0, 0.3),
      0 0 10px rgba(255, 255, 255, 0.1);
  }
  50% {
    text-shadow: 
      -1.5px -1px 0 rgba(0, 255, 255, 0.6),
      1.5px 1px 0 rgba(255, 0, 0, 0.6),
      -2.5px -2px 0 rgba(0, 255, 255, 0.4),
      2.5px 2px 0 rgba(255, 0, 0, 0.4),
      0 0 15px rgba(255, 255, 255, 0.15);
  }
}

.auth-logo-text::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FFFFFF, transparent);
  border-radius: 2px;
}

/* ============================================
   ROLE SELECTOR (Style Preply)
   ============================================ */

.auth-role-selector {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  background: #FFFFFF;
  padding: 0;
  border-radius: var(--auth-radius);
  border: 2px solid var(--auth-gray-200);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.auth-role-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: transparent;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--auth-gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-right: 1px solid var(--auth-gray-200);
}

.auth-role-btn:last-child {
  border-right: none;
}

.auth-role-btn:hover {
  color: var(--auth-gray-900);
  background: var(--auth-gray-50);
}

.auth-role-btn.active {
  background: linear-gradient(135deg, var(--auth-primary) 0%, #7C3AED 100%);
  color: #FFFFFF;
  box-shadow: none;
}

.auth-role-btn.active:hover {
  background: linear-gradient(135deg, var(--auth-primary-hover) 0%, #6D28D9 100%);
  color: #FFFFFF;
}

/* ── NEXUS : 3ème onglet rose→bleu ──────────────────────── */
.auth-role-btn.nexus-btn {
  font-size: 14px;
  letter-spacing: .01em;
}
.auth-role-btn.nexus-active,
.auth-role-btn.nexus-btn.active {
  background: linear-gradient(135deg, #be185d 0%, #EC4899 45%, #2563EB 100%);
  color: #fff;
  box-shadow: none;
}
.auth-role-btn.nexus-active:hover,
.auth-role-btn.nexus-btn.active:hover {
  background: linear-gradient(135deg, #9d174d 0%, #db2777 45%, #1d4ed8 100%);
  color: #fff;
}
.nexus-icon {
  font-size: .8em;
  opacity: .85;
  margin-right: 2px;
}

/* Bouton submit NEXUS */
.auth-submit-btn.nexus-submit {
  background: linear-gradient(135deg, #be185d 0%, #EC4899 45%, #2563EB 100%);
  box-shadow: 0 4px 14px rgba(236,72,153,.4);
}
.auth-submit-btn.nexus-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #9d174d 0%, #db2777 45%, #1d4ed8 100%);
  box-shadow: 0 6px 20px rgba(236,72,153,.5);
  transform: translateY(-2px);
}

/* Sous-titre NEXUS en italique */
.nexus-subtitle {
  font-style: italic;
  background: linear-gradient(135deg, #be185d, #2563EB);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600 !important;
}

/* ============================================
   HEADER
   ============================================ */

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--auth-gray-900);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--auth-gray-600);
  margin: 0;
  line-height: 1.5;
}

/* ============================================
   ALERTS
   ============================================ */

.auth-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--auth-radius);
  margin-bottom: 24px;
  font-size: 14px;
}

.auth-alert svg {
  flex-shrink: 0;
}

.auth-alert-error {
  background: var(--auth-error-light);
  color: var(--auth-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert-success {
  background: var(--auth-success-light);
  color: var(--auth-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ============================================
   SOCIAL BUTTONS
   ============================================ */

.auth-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--auth-gray-300);
  border-radius: var(--auth-radius);
  background: #FFFFFF;
  color: var(--auth-gray-700);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-social-btn:hover {
  background: var(--auth-gray-50);
  border-color: var(--auth-gray-400);
  box-shadow: var(--auth-shadow-sm);
  transform: translateY(-1px);
}

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

.auth-social-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.auth-social-google {
  color: var(--auth-gray-700);
}

.auth-social-facebook {
  color: #1877F2;
}

.auth-social-apple {
  color: var(--auth-gray-900);
}

/* ============================================
   DIVIDER
   ============================================ */

.auth-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--auth-gray-200);
}

.auth-divider-text {
  position: relative;
  display: inline-block;
  padding: 0 16px;
  background: #FFFFFF;
  color: var(--auth-gray-500);
  font-size: 14px;
}

/* ============================================
   FORM
   ============================================ */

.auth-form {
  margin-bottom: 24px;
}

.auth-form-group {
  margin-bottom: 20px;
}

.auth-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-gray-700);
  margin-bottom: 8px;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.auth-link-forgot {
  font-size: 13px;
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--auth-gray-300);
  border-radius: var(--auth-radius);
  background: #FFFFFF;
  font-size: 15px;
  color: var(--auth-gray-900);
  transition: all 0.2s;
  box-sizing: border-box;
}

.auth-input select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234B5563' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.auth-input::placeholder {
  color: var(--auth-gray-400);
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.auth-input-error {
  border-color: var(--auth-error);
}

.auth-input-error:focus {
  border-color: var(--auth-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--auth-error);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.auth-submit-btn {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: none;
  border-radius: var(--auth-radius-full);
  background: linear-gradient(135deg, var(--auth-primary) 0%, #7C3AED 100%);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.auth-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--auth-primary-hover) 0%, #6D28D9 100%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
}

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

.auth-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-submit-loader {
  display: none;
}

.auth-spinner {
  animation: spin 1s linear infinite;
}

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

/* ============================================
   FOOTER
   ============================================ */

.auth-footer {
  text-align: center;
  margin-top: 32px;
}

.auth-footer-text {
  font-size: 14px;
  color: var(--auth-gray-600);
  margin: 0 0 16px 0;
}

.auth-footer-link {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-footer-link:hover {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

.auth-legal {
  font-size: 12px;
  color: var(--auth-gray-500);
  margin: 0;
  line-height: 1.5;
}

.auth-legal-link {
  color: var(--auth-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-legal-link:hover {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

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

@media (max-width: 640px) {
  .auth-page {
    padding: 16px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-content {
    padding: 32px 24px;
    border-radius: var(--auth-radius);
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-subtitle {
    font-size: 14px;
  }

  .auth-social-btn {
    height: 44px;
    font-size: 14px;
  }

  .auth-submit-btn {
    height: 48px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .auth-content {
    padding: 24px 20px;
  }

  .auth-logo {
    margin-bottom: 24px;
  }

  .auth-logo-img {
    height: 40px;
  }

  .auth-role-selector {
    margin-bottom: 28px;
  }

  .auth-role-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

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

  .auth-social-buttons {
    margin-bottom: 20px;
  }

  .auth-divider {
    margin: 20px 0;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.auth-content {
  animation: fadeIn 0.3s ease-out;
}

.auth-modal {
  animation: fadeIn 0.2s ease-out;
}

