/* =====================================================
   Styles pour les pages d'authentification (login, register)
   Design moderne 2026 inspiré d'Infomaniak
   ===================================================== */

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --dark-color: #1a1a1a;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --text-color: #333;
    --text-muted: #666;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

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

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

/* Container de connexion */
.auth-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    animation: fadeInUp 0.5s ease;
}

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

/* Header */
.auth-header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    opacity: 0.9;
}

/* Corps du formulaire */
.auth-body {
    padding: 40px 30px;
}

/* Messages flash */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Formulaire */
.form-group {
    margin-bottom: 24px;
}

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

.form-label .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
    font-family: inherit;
}

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

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

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

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

/* Captcha simple */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.captcha-question {
    flex: 1;
    background: var(--light-gray);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: var(--text-color);
}

.captcha-input {
    flex: 0 0 80px;
}

/* Bouton de soumission */
.btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

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

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

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Footer */
.auth-footer {
    padding: 20px 30px;
    background: var(--light-gray);
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

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

.btn.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: 768px) {
    .auth-container {
        max-width: 100%;
    }

    .auth-header {
        padding: 24px 20px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-body {
        padding: 30px 20px;
    }

    .captcha-container {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-input {
        flex: 1;
    }
}
