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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

/* Container principal */
.container {
    width: 100%;
    max-width: 480px;
}

/* Wrapper d'authentification */
.auth-wrapper {
    background: var(--surface);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.6s ease-out;
}

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

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

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: var(--primary-light);
    border-radius: 16px;
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

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

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
}

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

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

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -4px;
}

/* Options du formulaire */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: -8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

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

.checkbox-label span {
    user-select: none;
}

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

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

/* Boutons */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

/* Divider */
.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0;
}

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

.form-divider span {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* Alertes */
.alert-container {
    margin-top: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

/* Loading state */
.btn-primary.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
    .auth-wrapper {
        padding: 30px 24px;
    }

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

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

/* Transitions de page */
.page-transition {
    animation: fadeIn 0.4s ease-out;
}

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

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px; /* espace pour l’icône */
  padding-left: 10px;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

.password-wrapper .toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-wrapper .eye-icon,
.password-wrapper .eye-slash-icon {
  width: 20px;
  height: 20px;
  color: #555;
}

.password-wrapper .toggle-password:hover .eye-icon,
.password-wrapper .toggle-password:hover .eye-slash-icon {
  color: #000;
}

/* Messages Django */
.messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out;
    display: flex;
    justify-content: between;
    align-items: center;
}

.alert-success {
    background: #10b981;
    color: white;
    border: 1px solid #059669;
}

.alert-error {
    background: #ef4444;
    color: white;
    border: 1px solid #dc2626;
}

.alert-info {
    background: #3b82f6;
    color: white;
    border: 1px solid #2563eb;
}

.alert-warning {
    background: #f59e0b;
    color: white;
    border: 1px solid #d97706;
}

.close-message {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bouton Google */
.btn-google {
    display: block;
    width: 100%;
    background: white;
    color: #374151;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

