{assign var="page_title" value="Sign In - EasyStream"}

<!DOCTYPE html>
<html lang="en" data-theme="blue">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{$page_title}</title>
    <style>
        body { 
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
            margin: 0; 
            padding: 20px; 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
        }
        .signin-container { 
            max-width: 400px; 
            margin: 50px auto; 
            background: white; 
            padding: 40px; 
            border-radius: 15px; 
            box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
        }
        .logo { text-align: center; margin-bottom: 30px; }
        .logo img { max-height: 60px; }
        h1 { text-align: center; color: #333; margin-bottom: 30px; }
        .form-group { margin-bottom: 20px; }
        label { display: block; margin-bottom: 8px; font-weight: bold; color: #555; }
        input[type="text"], input[type="password"] { 
            width: 100%; 
            padding: 15px; 
            border: 2px solid #ddd; 
            border-radius: 8px; 
            font-size: 16px; 
            box-sizing: border-box; 
        }
        input:focus { border-color: #007bff; outline: none; }
        .btn { 
            width: 100%; 
            padding: 15px; 
            background: #007bff; 
            color: white; 
            border: none; 
            border-radius: 8px; 
            font-size: 18px; 
            font-weight: bold; 
            cursor: pointer; 
        }
        .btn:hover { background: #0056b3; }
        .error { 
            background: #f8d7da; 
            color: #721c24; 
            padding: 15px; 
            border-radius: 8px; 
            margin-bottom: 20px; 
            text-align: center; 
        }
        .test-info { 
            background: #e7f3ff; 
            padding: 20px; 
            border-radius: 8px; 
            margin-top: 25px; 
            text-align: center; 
        }
        .links { text-align: center; margin-top: 20px; }
        .links a { color: #007bff; text-decoration: none; font-weight: bold; }
        .checkbox-group { display: flex; align-items: center; margin: 15px 0; }
        .checkbox-group input { width: auto; margin-right: 10px; }
    </style>
</head>
<body>
    <div class="signin-container">
        <div class="logo">
            <img src="{$main_url}/f_scripts/fe/img/logo-header-blue.svg" alt="EasyStream">
        </div>
        <h1>🔑 Sign In to EasyStream</h1>
        
        {if $error_message}
            <div class="error">❌ {$error_message}</div>
        {/if}
        
        <form method="post" action="{$main_url}/{href_entry key="signin"}">
            <div class="form-group">
                <label>👤 Username or Email</label>
                <input type="text" name="frontend_signin_username" required placeholder="Enter your username or email">
            </div>
            <div class="form-group">
                <label>🔒 Password</label>
                <input type="password" name="frontend_signin_password" required placeholder="Enter your password">
            </div>
            
            {if $cfg.login_remember == 1}
            <div class="checkbox-group">
                <input type="checkbox" name="signin_remember" value="1" id="remember">
                <label for="remember">Remember me</label>
            </div>
            {/if}
            
            <input type="hidden" name="frontend_global_submit" value="1">
            <button type="submit" class="btn">🚀 Sign In</button>
        </form>
        
        <div class="test-info">
            <h4>🧪 Test Accounts</h4>
            <strong>admin</strong> / admin123 (Administrator)<br>
            <strong>creator1</strong> / creator123 (Creator)<br>
            <strong>viewer1</strong> / viewer123 (Viewer)
        </div>
        
        <div class="links">
            <a href="{$main_url}/{href_entry key="signup"}">📝 Create Account</a> | 
            <a href="{$main_url}">🏠 Back to Homepage</a>
        </div>
    </div>
</body>
</html>