/* ═══════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════ */
:root{
  --red:#fe2c55;
  --red-hover:#e8284d;
  --red-active:#d92547;
  --ink:#161823;
  --ink-50:rgba(22,24,35,.5);
  --ink-34:rgba(22,24,35,.34);
  --line:rgba(22,24,35,.12);
  --fill:#f1f1f2;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{color-scheme:light}

body{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:#fff;
  color:var(--ink);
  font-family:"TikTok Sans","Proxima Nova",Arial,Tahoma,PingFangSC,sans-serif;
  font-size:16px;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ═══════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════ */
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:8px;
  line-height:0;
}
.brand .mark{height:31px;width:auto;display:block}
.brand .word{height:20px;width:auto;display:block}

.help{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:16px;
  font-weight:600;
  color:var(--ink);
  text-decoration:none;
}
.help svg{width:20px;height:20px;flex:0 0 20px}
.help:hover{text-decoration:underline}

/* ═══════════════════════════════════════════════
   MAIN
   ═══════════════════════════════════════════════ */
main{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 24px 110px;
}

.panel{width:100%;max-width:375px}

h1{
  font-size:32px;
  font-weight:700;
  letter-spacing:-.9px;
  text-align:center;
  margin-bottom:24px;
}

.label-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.label-row label{font-size:16px;font-weight:600}

.swap{
  font-size:16px;
  font-weight:500;
  color:var(--ink);
  text-decoration:none;
  white-space:nowrap;
}
.swap:hover{text-decoration:underline}

input{
  width:100%;
  height:44px;
  padding:0 14px;
  border:1px solid var(--line);
  border-radius:2px;
  background:var(--fill);
  color:var(--ink);
  font:inherit;
  font-size:16px;
}
input::placeholder{color:var(--ink-50)}
input:focus{outline:none;background:#fff;border-color:var(--ink-34)}

/* ── field spacing ──────────────────────────── */
.email-field{margin-bottom:13px}

.pass-field{position:relative;margin-bottom:11px}
.pass-field input{padding-right:46px}

/* ── password eye ───────────────────────────── */
.eye{
  position:absolute;
  top:50%;
  right:12px;
  transform:translateY(-50%);
  display:grid;
  place-items:center;
  width:26px;
  height:26px;
  padding:0;
  border:0;
  background:none;
  color:var(--ink-50);
  cursor:pointer;
}
.eye svg{width:22px;height:22px;display:none}
.eye .ico-off{display:block}
.eye.showing .ico-off{display:none}
.eye.showing .ico-on{display:block}

.forgot{
  display:block;
  font-size:14px;
  font-weight:400;
  color:var(--ink);
  text-decoration:none;
  margin-bottom:25px;
}
.forgot:hover{text-decoration:underline}

/* ── permanently pink ───────────────────────── */
.primary{
  width:100%;
  height:44px;
  border:0;
  border-radius:2px;
  background:var(--red);
  color:#fff;
  font:inherit;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
  transition:background .15s;
}
.primary:hover{background:var(--red-hover)}
.primary:active{background:var(--red-active)}

.go-back{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  margin-top:45px;
  font-size:16px;
  font-weight:600;
  color:var(--ink);
  text-decoration:none;
}
.go-back svg{width:17px;height:17px}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
footer{margin-top:auto}

.rule{height:1px;background:var(--line)}

.signup{
  text-align:center;
  padding:22px 24px;
  font-size:16px;
}
.signup a{color:var(--red);font-weight:600;text-decoration:none}
.signup a:hover{text-decoration:underline}

.bottom-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 16px 30px;
}

.lang{
  margin-left:128px;
  padding:8px 40px;
  border:1px solid var(--line);
  border-radius:2px;
  background:none;
  color:var(--ink);
  font:inherit;
  font-size:16px;
  cursor:pointer;
}
.lang:hover{background:rgba(22,24,35,.03)}

.copy{font-size:16px;color:var(--ink-50)}

/* ═══════════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════════ */
@media (max-width:760px){
  header{padding:14px 16px}
  .brand{gap:9px}
  .brand .mark{height:26px}
  .brand .word{height:19px}
  .help{font-size:15px}
  .help svg{width:18px;height:18px}

  main{padding:0 20px 60px}
  h1{font-size:28px;letter-spacing:-.7px;margin-bottom:20px}

  .email-field{margin-bottom:11px}
  .pass-field{margin-bottom:9px}
  .forgot{margin-bottom:22px}
  .go-back{margin-top:36px}

  .signup{padding:18px 20px;font-size:15px}
  .lang{margin-left:0;padding:8px 28px;font-size:15px}
  .copy{font-size:15px}
  .bottom-bar{padding:0 16px 22px}
}
/* ═══════════════════════════════════════════════
   PASSWORD ERROR
   ═══════════════════════════════════════════════ */
.pw-error{
  display:block;
  margin:-3px 0 13px;
  padding:10px 12px 11px;
  border:1px solid rgba(254,44,85,.35);
  border-radius:2px;
  background:rgba(254,44,85,.055);
  font-size:13px;
  line-height:1.45;
  color:var(--red);
}
.pw-error[hidden]{display:none}

.pw-error-head{
  display:flex;
  align-items:center;
  gap:7px;
  font-weight:600;
  margin-bottom:5px;
}
.pw-error-head::before{
  content:"!";
  flex:0 0 14px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--red);
  color:#fff;
  font-size:10px;
  font-weight:700;
  line-height:14px;
  text-align:center;
}

.pw-error ul{
  list-style:none;
  margin:0;
  padding-left:21px;
}
.pw-error li{
  position:relative;
  padding-left:12px;
}
.pw-error li::before{
  content:"";
  position:absolute;
  left:0;
  top:.6em;
  width:4px;
  height:4px;
  border-radius:50%;
  background:currentColor;
  opacity:.65;
}

@keyframes shake{
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-5px)}
  40%{transform:translateX(5px)}
  60%{transform:translateX(-3px)}
  80%{transform:translateX(3px)}
}

input.invalid,
input.invalid:focus{
  border-color:var(--red);
  background:#fff;
  animation:shake .3s ease;
}

@media (max-width:760px){
  .pw-error{font-size:12.5px;padding:9px 11px 10px}
}
/* ═══════════════════════════════════════════════
   LOCK PAGE TO VIEWPORT (no scroll)
   ═══════════════════════════════════════════════ */
html{
  height:100%;
  overflow:hidden;
}
body{
  height:100%;
  min-height:0;
  overflow:hidden;
  overscroll-behavior:none;
}

main{
  min-height:0;
  padding:0 24px 56px;
}

header{padding:14px 16px}
.signup{padding:18px 24px}
.bottom-bar{padding:0 16px 22px}
.go-back{margin-top:34px}

@media (max-width:760px){
  main{padding:0 20px 32px}
  header{padding:12px 16px}
  .signup{padding:14px 20px}
  .bottom-bar{padding:0 16px 18px}
  .go-back{margin-top:26px}
}
