/* Reset et variables CSS */
:root {
  --primary-navy: #1e293b;
  --secondary-navy: #334155;
  --accent-blue: #3b82f6;
  --white: #ffffff;
  --light-gray: #f8fafc;
  --text-gray: #64748b;
  --success-green: #10b981;
  --border-gray: #e2e8f0;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.header {
  margin-bottom: 40px;
}

.logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--white) 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.tagline {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.main-content {
  margin-bottom: 40px;
}

.welcome-section {
  margin-bottom: 40px;
}

.welcome-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--white);
}

.description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

.action-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

/* Bouton Google OAuth */
.google-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #374151;
  border: 2px solid rgba(55, 65, 81, 0.1);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.google-btn:hover {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  color: #1f2937;
  border-color: rgba(55, 65, 81, 0.2);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.15);
}

.google-btn .button-icon {
  background: linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc05 50%, #ea4335 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
  font-size: 1.2em;
}

/* Séparateur pour les options d'authentification */
.auth-separator {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
}

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

.auth-separator span {
  padding: 0 16px;
}

.auth-button {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
  color: var(--white);
  border: none;
  border-radius: 16px;
  padding: 18px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 25px -5px rgba(59, 130, 246, 0.3);
  width: 100%;
  position: relative;
  overflow: hidden;
  position: relative;
  overflow: hidden;
  min-width: 160px;
  justify-content: center;
}

.register-btn {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 8px 25px -5px rgba(74, 222, 128, 0.2);
}

/* Bouton Google OAuth */
.google-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #1f2937;
  border: 2px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

.google-btn .button-icon {
  background: linear-gradient(135deg, #4285f4 0%, #34a853 25%, #fbbc05 50%, #ea4335 75%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
  font-size: 1.2em;
}

.google-btn:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e5e7eb 100%);
  border-color: rgba(59, 130, 246, 0.4);
  color: #111827;
  transform: translateY(-2px);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.15);
}

.auth-button::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;
}

.auth-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px -5px rgba(147, 197, 253, 0.3);
}

.register-btn:hover {
  box-shadow: 0 12px 35px -5px rgba(34, 197, 94, 0.3);
}

.auth-button:hover::before {
  left: 100%;
}

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

/* Modales */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  margin: 10% auto;
  padding: 32px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
}

.close {
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--white);
}

.form-group {
  margin-bottom: 16px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

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

.form-group input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
  color: var(--white);
  border: none;
  border-radius: 16px;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px -5px rgba(59, 130, 246, 0.4);
}

/* Dashboard */
.dashboard {
  max-width: 800px;
  padding: 40px;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 50px;
}

.main-title h1 {
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 8px;
  font-weight: 700;
}

.user-welcome {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  font-weight: 400;
}

.dashboard-content {
  text-align: center;
}

.logout-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px -5px rgba(239, 68, 68, 0.4);
}

.service-description {
  text-align: center;
  margin-bottom: 40px;
}

.service-description h2 {
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 16px;
}

.service-description p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.search-section {
  margin-bottom: 50px;
}

.search-container {
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 8px;
  max-width: 500px;
  margin: 0 auto;
}

.dashboard-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.logout-btn, .settings-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: var(--white);
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-btn {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(248, 113, 113, 0.3);
}

.settings-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(147, 197, 253, 0.3);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1rem;
  padding: 12px 16px;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-btn {
  background: var(--accent-blue);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

.account-actions {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.delete-account-btn {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: var(--white);
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-account-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(248, 113, 113, 0.3);
}

.admin-panel-btn {
  background: linear-gradient(135deg, #fdba74 0%, #fdba74 100%);
  color: var(--white);
  border: none;
  border-radius: 16px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.admin-panel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(253, 186, 116, 0.3);
}

/* Modal des paramètres */
.settings-section {
  margin-bottom: 30px;
  text-align: left;
}

.settings-section h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-actions button {
  justify-content: flex-start;
}

.user-info {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.5;
}

.user-info strong {
  color: var(--white);
}

/* Modal Admin */
.admin-modal {
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
}

.admin-section {
  margin-bottom: 35px;
}

.admin-section h4 {
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
}

.admin-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  color: var(--white);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
  text-align: left;
  font-family: inherit;
}

.admin-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.3);
}

.admin-action-btn .button-icon {
  font-size: 1.8rem;
  min-width: 40px;
  text-align: center;
}

.button-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.button-content .button-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
}

.button-content .button-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Boutons spécialisés - Glow blanc uniforme */
.n8n-btn:hover,
.database-btn:hover,
.users-btn:hover,
.stats-btn:hover,
.config-btn:hover,
.backup-btn:hover,
.logs-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 25px -5px rgba(255, 255, 255, 0.2);
}

.register-button::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;
}

.register-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px -5px rgba(59, 130, 246, 0.4);
}

.register-button:hover::before {
  left: 100%;
}

.register-button:active {
  transform: translateY(0);
}

.button-text {
  font-weight: 600;
  letter-spacing: 0.025em;
}

.button-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.register-button:hover .button-icon {
  transform: translateX(4px);
}

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.footer p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Responsive design */
@media (max-width: 640px) {
  .container {
    padding: 24px;
    margin: 16px;
  }
  
  .logo h1 {
    font-size: 2rem;
  }
  
  .welcome-section h2 {
    font-size: 1.25rem;
  }
  
  .description {
    font-size: 0.95rem;
  }
  
  .register-button {
    padding: 16px 32px;
    font-size: 1rem;
    min-width: 180px;
  }
}

/* Styles pour la gestion des mots de passe */
.forgot-password-link {
  display: block;
  text-align: right;
  margin-bottom: 15px;
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.forgot-password-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.change-password-btn {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 15px;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.change-password-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.password-form {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.password-form .form-group {
  margin-bottom: 15px;
  text-align: left;
}

.password-form label {
  display: block;
  margin-bottom: 5px;
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
}

.password-form input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 14px;
  transition: border-color 0.2s;
}

.password-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-form input[type="password"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #2563eb 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.password-info {
  padding: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  color: var(--white);
  font-size: 14px;
  margin-top: 10px;
}

.settings-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h4 {
  margin-bottom: 15px;
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
}
