Annual report pursuant to Section 13 and 15(d)

Stock-Based Compensation - Additional Information (Details)

v3.19.3.a.u2
Stock-Based Compensation - Additional Information (Details)
1 Months Ended 12 Months Ended
Nov. 07, 2018
USD ($)
solar_energy_system_install
Jan. 01, 2018
Aug. 31, 2017
USD ($)
solar_energy_system_install
$ / shares
shares
Jul. 31, 2015
shares
Mar. 31, 2015
shares
Dec. 31, 2019
USD ($)
purchase_period
$ / shares
shares
Dec. 31, 2018
USD ($)
$ / shares
shares
Dec. 31, 2017
USD ($)
$ / shares
shares
Dec. 31, 2014
shares
Aug. 31, 2014
shares
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)           36,077,000 34,960,000      
Unvested exercisable shares (in shares)             276,660      
Unvested options exercised (in shares)           0 0      
Weighted-average grant-date fair value of stock options granted (in usd per share) | $ / shares           $ 8.27 $ 4.21 $ 2.57    
Total intrinsic value of options exercised | $           $ 37,800,000 $ 21,400,000 $ 2,300,000    
Total fair value of options vested | $           9,500,000 8,800,000 7,500,000    
Compensation expense recognized | $           26,306,000 27,856,000 22,042,000    
Total unrecognized compensation cost | $           $ 30,000,000.0 40,000,000.0      
Weighted-average period of recognition           2 years 3 months 18 days        
Annual contribution limit | $           $ 19,000        
Defined contribution expense | $           $ 8,500,000 $ 7,000,000.0      
Warrants                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Warrant, term     40 months              
Warrant, number purchased (in shares)     11,793,355              
Warrant, exercise price (in dollars per share) | $ / shares     $ 0.01              
Warrant, vesting percentage     50.05%              
Warrant, milestone one, solar energy systems | solar_energy_system_install 6,000   30,000              
Warrant, milestone two, marketing and sales dollars | $     $ 10,000,000.0              
Warrant, vesting term     5 years              
Warrant, milestone two, solar energy systems | solar_energy_system_install 8,000   6,000              
Warrant, vesting percentage, milestone one 10.00%                  
Warrant, vesting percentage, milestone two 13.30%                  
Warrant, milestone one and two, marketing and sales dollars | $ $ 25,000,000.0                  
Warrant, vesting percentage, milestone three 8.30%                  
Warrant, milestone three, solar energy systems | solar_energy_system_install 5,000                  
Restricted Stock Units (RSUs)                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)           3,943,000 4,182,000      
Stock option plan, number of shares granted (in shares)           2,258,000 2,019,000   947,342  
Performance-based Plan                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Compensation expense recognized | $             $ 3,500,000 $ 800,000    
2013 Equity Incentive Plan                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Additional common stock shares reserved for issuance (in shares)         3,000,000          
Common stock reserved for issuance (in shares)         4,500,000          
Stock options vesting period         4 years          
2013 Equity Incentive Plan | Maximum                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)         8,044,829          
Stock options granted, expiration period         10 years          
2013 Equity Incentive Plan | End of One Year                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Vesting award percentage         25.00%          
2013 Equity Incentive Plan | Monthly Over the Remaining Three Years                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Vesting award percentage         75.00%          
2014 Equity Incentive Plan                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)       1,197,342           947,342
2014 Equity Incentive Plan | Restricted Stock Units (RSUs)                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Stock option plan, number of shares granted (in shares)       1,197,342            
2015 Equity Incentive Plan                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)       11,400,000   14,828,000 11,986,000      
Stock options vesting period       4 years            
Minimum annual automatic increase included in common stock reserved for future issuance as of first day of each fiscal year       10,000,000            
Minimum percentage of annual automatic increase included in common stock reserved for future issuance as of last day of immediately preceding fiscal year       4.00%            
Additional common stock shares reserved for issuance           4,525,946 4,294,010      
2015 Equity Incentive Plan | Restricted Stock Units (RSUs)                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Stock options vesting period       4 years            
Outstanding RSUs               350,000    
2015 Equity Incentive Plan | Maximum                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)       15,439,334            
Stock options granted, expiration period       10 years            
2015 Equity Incentive Plan | End of One Year                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Vesting award percentage       25.00%            
2015 Equity Incentive Plan | End of One Year | Restricted Stock Units (RSUs)                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Vesting award percentage       25.00%            
2015 Equity Incentive Plan | Monthly Over the Remaining Three Years                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Vesting award percentage       75.00%            
2015 Equity Incentive Plan | Quarterly Over the Remaining Three Years | Restricted Stock Units (RSUs)                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Vesting award percentage       75.00%            
Employee Stock Purchase Plan                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Common stock reserved for issuance (in shares)           1,000,000        
Minimum percentage of annual automatic increase included in common stock reserved for future issuance as of last day of immediately preceding fiscal year           2.00%        
Additional common stock shares reserved for issuance           2,262,973 2,147,005      
Offering period           24 months        
Number of purchase periods | purchase_period           4        
Purchase period           6 months        
Maximum percentage in payroll deductions to acquire shares of common stock           15.00%        
Maximum deductible fair market value of shares available for employee to purchase per calendar year | $           $ 25,000        
Maximum number of shares available for employee to purchase per offering period           10,000        
Maximum annual shares reserved for issuance (in shares)           5,000,000        
First threshold                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Employer matching contribution, percentage   100.00%                
Percent of pay matched   1.00%                
Second threshold                    
Share-based Compensation Arrangement by Share-based Payment Award [Line Items]                    
Employer matching contribution, percentage   50.00%                
Percent of pay matched   5.00%