/* Variables CSS */
:root {
    --primary: #4d8a3f;
    --primary-dark: #3a6b2e;
    --secondary: #2c5aa0;
    --gray: #e0e0e0;
    --dark: #333;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    line-height: 1.6;
}

/* Container principal */
.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
    animation: fadeIn 0.5s ease;
}

/* Card d'authentification */
.auth-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

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

.auth-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.auth-header p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Formulaire */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e5e5;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(77, 138, 63, 0.1);
}

.form-group input:hover {
    border-color: #ccc;
}

.form-group input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(77, 138, 63, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 138, 63, 0.4);
}

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

.btn-block {
    width: 100%;
}

/* Alertes et erreurs */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.alert-danger {
    background: #fee;
    color: var(--danger);
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: var(--success);
    border: 1px solid #cfc;
}

.alert ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.alert ul li {
    margin: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.alert ul li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    font-weight: bold;
}

#form-errors:empty {
    display: none;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.auth-footer p {
    color: #666;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

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

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

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 2rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
}

/* Loading states */
.htmx-request .btn {
    opacity: 0.7;
    cursor: not-allowed;
}

.htmx-request .btn::after {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

/* Checkbox personnalisé */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-check input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
    text-transform: none;
}

/* Social login (si nécessaire) */
.social-login {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.social-login p {
    text-align: center;
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.social-buttons {
    display: flex;
    gap: 1rem;
}

.btn-social {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    background: white;
    color: #666;
}

.btn-social:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

/* Amélioration visuelle avec gradient sur le fond */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Focus visible pour l'accessibilité */
.btn:focus-visible,
input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Message d'invitation style */
.invitation-info {
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

.inviter-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid #d0e5ff;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
}

.inviter-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.inviter-details h4 {
    margin: 0 0 0.25rem 0;
    color: var(--secondary);
    font-size: 1rem;
}

.inviter-message {
    font-size: 0.875rem;
    color: #5a7aa0;
    margin: 0;
    font-style: italic;
}