<% title = 'Join Us'; const v = (typeof values!=='undefined'&&values)?values:{}; const errs=(typeof errors!=='undefined'&&errors)?errors:[]; const has=(f)=>errs.includes(f); %>
<div class="page-head"><div class="inner">
  <div class="tag"><span class="en">Join the Alliance</span><span class="zh">加入联盟</span></div>
  <h1><span class="en">Express Your Interest</span><span class="zh">登记加入意向</span></h1>
  <p><span class="en">Complete the short form below to register your interest. There is no commitment at this stage — on receipt we will share the draft Charter, summit programme and membership details.</span><span class="zh">填写以下简表登记意向。此阶段不具任何约束；收到后我们将与您分享章程草案、峰会议程及会员资料。</span></p>
</div></div>

<section>
  <% if (errs.length) { %>
  <div style="max-width:900px;"><div class="err-msg" style="margin-bottom:18px;">
    <span class="en">Please complete the required fields (name, a valid email, and institution) and submit again.</span>
    <span class="zh">请填写必填项（姓名、有效邮箱、所属机构）后重新提交。</span>
  </div></div>
  <% } %>

  <form class="eoi-form" method="POST" action="/api/eoi" autocomplete="on">
    <input type="text" name="website" class="hp" tabindex="-1" autocomplete="off" aria-hidden="true">

    <div class="row2">
      <div class="fg">
        <label class="lbl"><span class="en">Full name &amp; title <span class="req">*</span></span><span class="zh">姓名与头衔 <span class="req">*</span></span></label>
        <input type="text" name="full_name" value="<%= v.full_name||'' %>" required style="<%= has('full_name')?'border-color:#c0392b':'' %>">
      </div>
      <div class="fg">
        <label class="lbl"><span class="en">Position / Department</span><span class="zh">职称 / 院系</span></label>
        <input type="text" name="position" value="<%= v.position||'' %>">
      </div>
    </div>
    <div class="row2">
      <div class="fg">
        <label class="lbl"><span class="en">Institution / Affiliation <span class="req">*</span></span><span class="zh">所属机构 <span class="req">*</span></span></label>
        <input type="text" name="institution" value="<%= v.institution||'' %>" required style="<%= has('institution')?'border-color:#c0392b':'' %>">
      </div>
      <div class="fg">
        <label class="lbl"><span class="en">Country / Region</span><span class="zh">国家 / 地区</span></label>
        <input type="text" name="country" value="<%= v.country||'' %>">
      </div>
    </div>
    <div class="row2">
      <div class="fg">
        <label class="lbl"><span class="en">Email <span class="req">*</span></span><span class="zh">电子邮箱 <span class="req">*</span></span></label>
        <input type="email" name="email" value="<%= v.email||'' %>" required style="<%= has('email')?'border-color:#c0392b':'' %>">
      </div>
      <div class="fg">
        <label class="lbl"><span class="en">Google Scholar profile (URL)</span><span class="zh">Google Scholar 主页（网址）</span></label>
        <input type="url" name="scholar_url" value="<%= v.scholar_url||'' %>" placeholder="https://scholar.google.com/...">
      </div>
    </div>
    <div class="fg">
      <label class="lbl"><span class="en">Research areas of interest</span><span class="zh">研究兴趣方向</span></label>
      <textarea name="research"><%= v.research||'' %></textarea>
    </div>

    <div class="fg">
      <label class="lbl"><span class="en">I wish to join BR-CESSA as a Founding Scholar</span><span class="zh">我希望以创始学者身份加入 BR-CESSA</span></label>
      <div class="choices">
        <label><input type="radio" name="join_founding" value="Yes"><span class="en">Yes</span><span class="zh">是</span></label>
        <label><input type="radio" name="join_founding" value="Not at this time"><span class="en">Not at this time</span><span class="zh">暂不</span></label>
      </div>
    </div>
    <div class="fg">
      <label class="lbl"><span class="en">I expect to attend the Inaugural Summit (Jan–Feb 2027, Hong Kong)</span><span class="zh">我计划出席成立大会（2027年1–2月，香港）</span></label>
      <div class="choices">
        <label><input type="radio" name="attend" value="In person"><span class="en">Yes, in person</span><span class="zh">现场出席</span></label>
        <label><input type="radio" name="attend" value="Online"><span class="en">Yes, online</span><span class="zh">线上出席</span></label>
        <label><input type="radio" name="attend" value="Undecided"><span class="en">Undecided</span><span class="zh">待定</span></label>
        <label><input type="radio" name="attend" value="Unable"><span class="en">Unable to attend</span><span class="zh">无法出席</span></label>
      </div>
    </div>
    <div class="fg">
      <label class="lbl"><span class="en">My institution may be interested in joining as an Institutional Member</span><span class="zh">我所在机构可能有意以机构会员身份加入</span></label>
      <div class="choices">
        <label><input type="radio" name="inst_interest" value="Yes"><span class="en">Yes</span><span class="zh">是</span></label>
        <label><input type="radio" name="inst_interest" value="Possibly"><span class="en">Possibly</span><span class="zh">可能</span></label>
        <label><input type="radio" name="inst_interest" value="No"><span class="en">No</span><span class="zh">否</span></label>
        <label><input type="radio" name="inst_interest" value="Refer"><span class="en">I will refer to the relevant office</span><span class="zh">将转介相关部门</span></label>
      </div>
    </div>
    <div class="fg">
      <label class="lbl"><span class="en">Preferred role(s) in the Alliance (optional)</span><span class="zh">在联盟中希望担任的角色（可多选）</span></label>
      <div class="choices">
        <% ['Founding Member','Steering Committee','Advisory Board','Scholar Member','Speaker / Collaborator'].forEach(function(r){ %>
          <label><input type="checkbox" name="roles" value="<%= r %>"><%= r %></label>
        <% }); %>
      </div>
    </div>
    <div class="fg">
      <label class="lbl"><span class="en">Thematic panel(s) I would like to contribute to <span style="font-weight:400;color:var(--muted)">(select all that apply)</span></span><span class="zh">希望参与的专题组 <span style="font-weight:400;color:var(--muted)">（可多选）</span></span></label>
      <div class="choices">
        <label><input type="checkbox" name="panels" value="Climate"><span class="en">Climate Panel</span><span class="zh">气候专题组</span></label>
        <label><input type="checkbox" name="panels" value="Environment"><span class="en">Environment Panel</span><span class="zh">环境专题组</span></label>
        <label><input type="checkbox" name="panels" value="Sustainability"><span class="en">Sustainability Panel</span><span class="zh">可持续专题组</span></label>
      </div>
    </div>
    <div class="fg">
      <label class="lbl"><span class="en">Remarks / suggestions (optional)</span><span class="zh">备注 / 建议（可选）</span></label>
      <textarea name="remarks"><%= v.remarks||'' %></textarea>
    </div>

    <button type="submit" class="btn btn-gold"><span class="en">Submit Expression of Interest</span><span class="zh">提交加入意向</span></button>
    <p class="hint" style="margin-top:12px;"><span class="en">Your details are sent to the BR-CESSA Secretariat at HKUST and used only for Alliance coordination.</span><span class="zh">您的信息将发送至设于港科大的 BR-CESSA 秘书处，仅用于联盟协调工作。</span></p>
  </form>
</section>
